Re: to_timestamp not stable if date string shorter than template

From: "Mendola Gaetano" <mendola(at)bigfoot(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: to_timestamp not stable if date string shorter than template
Date: 2003-09-05 19:32:01
Message-ID: 008801c373e6$45da69c0$92700b3e@mm.eutelsat.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Newsgroups: comp.databases.postgresql.bugs
Sent: Wednesday, September 03, 2003 1:05 AM
Subject: Re: to_timestamp not stable if date string shorter than template

> "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?

I get on Postgres 7.3.3:

test=# select to_timestamp('2003-06-01', 'YYYY-MM-DD HH24:MI:SS') ;
to_timestamp
------------------------
2003-06-01 00:08:00+02
(1 row)

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

test=# select to_timestamp('2003-06-01', 'YYYY-MM-DD HH24:MI:SS') ;
to_timestamp
------------------------
2003-06-01 00:08:00+02
(1 row)

Why 00:08:00+02 ?

Regards
Gaetano Mendola

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message terry 2003-09-05 20:05:59 Re: Unclear documentation (IMMUTABLE functions)
Previous Message Neil Conway 2003-09-05 18:32:02 Re: Unclear documentation (IMMUTABLE functions)