Re: Problem with zero year

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problem with zero year
Date: 2009-03-17 19:24:57
Message-ID: 200903171924.n2HJOvS12684@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > The problem is that the 2-digit year check is for <=2 digits, not
> > exactly two digits:
> > ...
> > This leads to some unexpected outputs:
>
> > test=> select '1-1-0'::date;
> > date
> > ------------
> > 2000-01-01
>
> We've interpreted that like that since 7.4, without complaints; and
> I think it was an intentional change then (since 7.3 doesn't accept it).
> I do not recommend changing it.

OK, the release note text will be:

Reject year '0 BC' and years '000' and '0000' (Tom)

Previously these were interpreted as 1 BC.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2009-03-17 19:47:41 Re: hstore improvements?
Previous Message Tom Lane 2009-03-17 18:49:16 Re: DTrace probes broken in HEAD on Solaris?