Re: to_timestamp not stable if date string shorter than template

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Stacy White" <harsh(at)computer(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org, "Aaron Harsh" <ajh(at)rentrak(dot)com>
Subject: Re: to_timestamp not stable if date string shorter than template
Date: 2003-09-02 23:05:00
Message-ID: 21044.1062543900@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Stacy White" <harsh(at)computer(dot)org> writes:
> to_timestamp appears to pick up the time-of-day from the previous call's
> return value if a date string has no time component. For example:

Weird. I do not see that here, on either 7.3.4 or current sources.
Can anyone else reproduce it?

For the record, I get:

regression=# select to_timestamp('2003-06-01', 'YYYY-MM-DD HH24:MI:SS') ;
to_timestamp
------------------------
2003-06-01 00:00:00-04
(1 row)

regression=# select to_timestamp('2003-06-02 12:13:14', 'YYYY-MM-DD HH24:MI:SS') ;
to_timestamp
------------------------
2003-06-02 12:13:14-04
(1 row)

regression=# select to_timestamp('2003-06-01', 'YYYY-MM-DD HH24:MI:SS') ;
to_timestamp
------------------------
2003-06-01 00:00:00-04
(1 row)

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-09-02 23:06:25 Re: Cursor bug
Previous Message Andreas Pflug 2003-09-02 22:51:24 Re: session variable