Re: nasty problem with redhat 6.2 + pg 7.02

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: nasty problem with redhat 6.2 + pg 7.02
Дата
Msg-id 20000919115958.C6108@rice.edu
обсуждение исходный текст
Ответ на Re: nasty problem with redhat 6.2 + pg 7.02  (Lamar Owen <lamar.owen@wgcr.org>)
Список pgsql-general
On Tue, Sep 19, 2000 at 12:36:22PM -0400, Lamar Owen wrote:
>
> I can't duplicate:
> test=# SET datestyle=postgres;
> SET VARIABLE
> test=# create table serv2 (fecha1 date, fecha2 date);
> CREATE
> test=# insert into serv2 values ('13-01-2000','01-10-2000');
> INSERT 407754 1
> test=# select * from serv2;
>    fecha1   |   fecha2
> ------------+------------
>  01-13-2000 | 01-10-2000
> (1 row)
>
> test=#
> System is RedHat 6.2 with the PostgreSQL 7.0.2-2 RPMset loaded. Hmmm,
> but 13-01-2000 got flipped to 01-13-2000, and 01-10-2000 didn't flip...
> Now that is strange.

Right: Lamar, you're using US conventions. Leon appears to be using
European. One of the postgresql 'features' is that it will try hard to
parse dates, even using the other convention if necessary. There is no
13th month, so the first one got taken directly. The 10th of January, on
the other hand...

This looks suspiciously like a timezone/daylight savings time issue, to
me. Somewhere, the date is getting represented as a full date/time, then
an hour is getting subtracted, then truncated to a date again.

Leon, try something like:

INSERT INTO serv2 VALUES ('13-01-2000'::date,'01-10-2000'::date);

That _might_ force the correct conversion, but I cant' test it, since
I don't see your problem here.

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

В списке pgsql-general по дате отправления:

Предыдущее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: nasty problem with redhat 6.2 + pg 7.02
Следующее
От: leonbloy@sinectis.com.ar
Дата:
Сообщение: Re: nasty problem with redhat 6.2 + pg 7.02