@postgresql.org
Asunto: Re: [BUGS] BUG #1630: Wrong conversion in to_date() function. See
example.
Michael Fuhr <[EMAIL PROTECTED]> writes:
> If anything I'd expect 2005-02-32 to be rejected as invalid, but I
> don't know the history or rationale behind to_date's behavior.
It
>
> However we consider that to_date() exists to be
> Oracle compatible,
> and so I would regard this as a bug if and only if
> Oracle does
> something different with the same input. Anyone
> know?
>
Here is the output I get from Oracle:
=
Co
Even _javascript_ handles those dates the same way...
On 4/27/05, Tom Lane <[EMAIL PROTECTED]> wrote:
"Ariel E. Carná/Elizabeth Sosa" <[EMAIL PROTECTED]> writes:
> PROD=# select to_date('2005-02-32', '-MM-DD');> to_date> > 2005-03-04> (1 row)I'm not convinced that's a bug --- m
Michael Fuhr <[EMAIL PROTECTED]> writes:
> If anything I'd expect 2005-02-32 to be rejected as invalid, but I
> don't know the history or rationale behind to_date's behavior.
It is rejected by the standard date input converter:
regression=# select '2005-02-32'::date;
ERROR: date/time field value
"Ariel E. Carná/Elizabeth Sosa" <[EMAIL PROTECTED]> writes:
> PROD=# select to_date('2005-02-32', '-MM-DD');
> to_date
>
> 2005-03-04
> (1 row)
I'm not convinced that's a bug --- most implementations of the Unix
mktime function will handle out-of-range day numbers like that.
On Tue, Apr 26, 2005 at 11:48:12PM +0100, Ariel E. Carná/Elizabeth Sosa wrote:
>
> Case PgSQL 7.3.8/SuSE Linux 8.2 (i586)
> ==
> PROD=# select to_date('2005-02-32', '-MM-DD');
> to_date
>
> 2005-03-04
> (1 row)
>
> Case PgSQL 7.4.6/SuSE Linu
The following bug has been logged online:
Bug reference: 1630
Logged by: Ariel E. Carná/Elizabeth Sosa
Email address: [EMAIL PROTECTED]
PostgreSQL version: 7.3.8/7.4.6
Operating system: SuSE Linux
Description:Wrong conversion in to_date() function. See example.
Detail