Re: bug in timestamp and out of range values

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: bug in timestamp and out of range values
Date: 2006-11-03 03:52:56
Message-ID: 200611022252.56768.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thursday 02 November 2006 17:48, Tom Lane wrote:
> Robert Treat <xzilla(at)users(dot)sourceforge(dot)net> writes:
> > pagila=# select to_date('3232098', 'MM/DD/YYYY');
> > to_date
> > ---------------
> > 4568-06-26 BC
> > (1 row)
>
> to_date's absymal lack of error checking is well known. It should
> surely refuse that input altogether, given that format string.
> Feel free to send a patch ...
>
> As for the range issue, date_in does refuse negative Julian dates:
>
> regression=# select '4714-01-27 BC'::date;
> ERROR: date out of range: "4714-01-27 BC"
>
> but again to_date doesn't:
>
> regression=# select to_date('4714-01-27 BC', 'YYYY-MM-DD BC');
> to_date
> ---------------
> 4714-01-27 BC
> (1 row)
>

I'm not concerned about to_date so much as I am that timestamp_in lets you
store values you can't read with timestamp_out. Once the value is in there
you can happily move it around with create table as and such...

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Joshua D. Drake 2006-11-03 04:27:46 Re: [HACKERS] bug in timestamp and out of range values
Previous Message Leonid Shlyapnikov 2006-11-03 02:01:41 BUG #2731: Cannot install PostgreSQL server on WinXP Media Center Edition

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2006-11-03 04:12:30 Re: Design Considerations for New Authentication Methods
Previous Message Joshua D. Drake 2006-11-03 03:49:01 Re: Design Considerations for New Authentication Methods