RES: RES: Dates rejected

From: "Carlos H(dot) Reimer" <carlos(dot)reimer(at)opendb(dot)com(dot)br>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Andreas Kretschmer" <akretschmer(at)spamfence(dot)net>, "Pgsql-General(at)Postgresql(dot)Org" <pgsql-general(at)postgresql(dot)org>
Subject: RES: RES: Dates rejected
Date: 2006-10-16 19:14:24
Message-ID: PEEPKDFEHHEMKBBFPOOKOELKDFAA.carlos.reimer@opendb.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Tom,

You are right, I´ve discovered that the to_date was changed to return a
timestamp, the original function is returning the right values.

The to_date I´ve found:
CREATE OR REPLACE FUNCTION PUBLIC.TO_DATE(text, text) RETURNS TIMESTAMP
AS '
BEGIN
RETURN pg_Catalog.TO_TIMESTAMP($1,$2);
END;
' language 'plpgsql';

I don´t know why they have changed it but anyway why is this changed
function returning 01:00:00 in the hour field only for the date 15/10/2006
(DD/MM/YYYY)?

It started happening in the first day when Linux has changed to the day
light time (15/10/2006).

Thanks in advance!

Carlos

> -----Mensagem original-----
> De: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Enviada em: segunda-feira, 16 de outubro de 2006 16:27
> Para: carlos(dot)reimer(at)opendb(dot)com(dot)br
> Cc: Andreas Kretschmer; Pgsql-General(at)Postgresql(dot)Org
> Assunto: Re: RES: [GENERAL] Dates rejected
>
>
> "Carlos H. Reimer" <carlos(dot)reimer(at)opendb(dot)com(dot)br> writes:
> > select to_date('16/10/2006','DD/MM/YYYY');
> > to_date
> > ---------------------
> > 2006-10-16 00:00:00
> > (1 row)
>
> Um... what have you done to to_date()? The standard version returns a
> date, not a timestamp:
>
> regression=# select to_date('15/10/2006','DD/MM/YYYY');
> to_date
> ------------
> 2006-10-15
> (1 row)
>
>
> regards, tom lane
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2006-10-16 19:17:16 Re: function for current date-time
Previous Message Vivek Khera 2006-10-16 19:05:20 Re: old Pg interface