Re: [HACKERS] Strange results from to_timestamp

2006-04-19 Thread Bruce Momjian
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

Re: [HACKERS] Strange results from to_timestamp

2006-04-19 Thread Bruce Momjian
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

Re: [HACKERS] Strange results from to_timestamp

2006-04-18 Thread Bruce Momjian
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

Re: [HACKERS] Strange results from to_timestamp

2006-04-07 Thread Mario Weilguni
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

Re: [HACKERS] Strange results from to_timestamp

2006-04-07 Thread Adrian Maier
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.

Re: [HACKERS] Strange results from to_timestamp

2006-04-06 Thread Tom Lane
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

Re: [HACKERS] Strange results from to_timestamp

2006-04-06 Thread William ZHANG
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

Re: [HACKERS] Strange results from to_timestamp

2006-04-06 Thread Mario Weilguni
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

[HACKERS] Strange results from to_timestamp

2006-04-06 Thread 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(' 0300','mmdd hh24mi'); to_timestamp 0300-12