Re: [HACKERS] Dates BC.

2004-03-30 Thread Bruce Momjian
I have applied a patch to fix the issues mentioned below. Thanks. --- Karel Zak wrote: On Fri, Dec 19, 2003 at 01:12:08AM -0800, Dann Corbit wrote: There is no zero calendar year. The first year of Anno Domini is 1.

Re: [HACKERS] Dates BC.

2003-12-19 Thread Karel Zak
On Thu, Dec 18, 2003 at 02:11:20PM +0100, Kurt Roeckx wrote: I find this a little strange: select date_part('year', '0002-01-01 BC'::date); date_part --- -1 It seems 1 BC and 0 are the same year. Is there connection between formatting.c and date_part() ? I don't

Re: [HACKERS] Dates BC.

2003-12-19 Thread Dann Corbit
There is no zero calendar year. The first year of Anno Domini is 1. It's ordinal, not cardinal. -Original Message- From: Karel Zak [mailto:[EMAIL PROTECTED] Sent: Friday, December 19, 2003 12:04 AM To: Kurt Roeckx Cc: [EMAIL PROTECTED] Subject: Re: [HACKERS] Dates BC

Re: [HACKERS] Dates BC.

2003-12-19 Thread Karel Zak
On Fri, Dec 19, 2003 at 01:12:08AM -0800, Dann Corbit wrote: There is no zero calendar year. The first year of Anno Domini is 1. It's ordinal, not cardinal. I agree. But the follow quoted code is not use in date_part() there Kurt found bug. It's used in to_timestamp() _only_, and

[HACKERS] Dates BC.

2003-12-18 Thread Kurt Roeckx
I find this a little strange: select date_part('year', '0002-01-01 BC'::date); date_part --- -1 It seems 1 BC and 0 are the same year. In backend/utils/adt/formatting.c: if (tmfc.bc) { if (tm-tm_year 0) tm-tm_year =

Re: [HACKERS] Dates BC.

2003-12-18 Thread Bruce Momjian
Kurt Roeckx wrote: I find this a little strange: select date_part('year', '0002-01-01 BC'::date); date_part --- -1 It seems 1 BC and 0 are the same year. In backend/utils/adt/formatting.c: if (tmfc.bc) { if (tm-tm_year 0)

Re: [HACKERS] Dates BC.

2003-12-18 Thread David Fetter
In article [EMAIL PROTECTED] you wrote: I find this a little strange: select date_part('year', '0002-01-01 BC'::date); date_part --- -1 It seems 1 BC and 0 are the same year. There is an unresolveable legacy problem here, in that Brahmagupta did not yet invent the