Attachment now attached. :-)
---
Bruce Momjian wrote:
>
> Interesting bug report. The problem is that sscanf(buf, "%d", &val)
> eats leading white space, but our functions were not handling that.
>
> I have applied the a
Interesting bug report. The problem is that sscanf(buf, "%d", &val)
eats leading white space, but our functions were not handling that.
I have applied the attached patch that fixes this:
test=> select to_timestamp(' 0300','mmdd hh24mi');
to_timestamp
dded Oracle functions.
---
>
> Regards,
> mario weilguni
>
>
> -Urspr?ngliche Nachricht- Von:
> [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Im Auftrag von Tom Lane
> Gesendet: Freitag, 07. April 2006 06:09 An: Mario Weilguni Cc:
> PostgreSQL-deve
t: Freitag, 07. April 2006 06:09
An: Mario Weilguni
Cc: PostgreSQL-development
Betreff: Re: [HACKERS] Strange results from to_timestamp
Mario Weilguni <[EMAIL PROTECTED]> writes:
> I think all except the first one should raise a warning, isn't it?
to_timestamp (and friends) all
On 4/7/06, Tom Lane <[EMAIL PROTECTED]> wrote:
> Mario Weilguni <[EMAIL PROTECTED]> writes:
> > I think all except the first one should raise a warning, isn't it?
>
> to_timestamp (and friends) all seem to me to act pretty bizarre when
> faced with input that doesn't match the given format string.
Mario Weilguni <[EMAIL PROTECTED]> writes:
> I think all except the first one should raise a warning, isn't it?
to_timestamp (and friends) all seem to me to act pretty bizarre when
faced with input that doesn't match the given format string. However,
in the end that is an Oracle-compatibility fun
ISTM, and mismatch between the date/time string and the format string will
lead to
strange results.
The source code of to_timestamp() is in src/backend/utils/adt/formatting.c:
Datum
to_timestamp(PG_FUNCTION_ARGS)
Regards,
William ZHANG
"Mario Weilguni" <[EMAIL PROTECTED]>
> Am Donnerstag, 6. Ap
Am Donnerstag, 6. April 2006 14:57 schrieb Mario Weilguni:
> mydb=# select to_timestamp(' 0300','mmdd hh24mi');
>to_timestamp
> ---
> 0001-01-01 03:00:00+01 BC
> (1 row)
>
> Questionable, but probably valid.
>
>
>
> mydb=# select to_timestamp(' 0
mydb=# select to_timestamp(' 0300','mmdd hh24mi');
to_timestamp
---
0001-01-01 03:00:00+01 BC
(1 row)
Questionable, but probably valid.
mydb=# select to_timestamp(' 0300','mmdd hh24mi');
to_timestamp
0300-12