Re: nasty problem with redhat 6.2 + pg 7.02 - Mailing list pgsql-general

From Ross J. Reedstrom
Subject Re: nasty problem with redhat 6.2 + pg 7.02
Date
Msg-id 20000919115958.C6108@rice.edu
Whole thread Raw
In response to Re: nasty problem with redhat 6.2 + pg 7.02  (Lamar Owen <lamar.owen@wgcr.org>)
List 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 by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: nasty problem with redhat 6.2 + pg 7.02
Next
From: leonbloy@sinectis.com.ar
Date:
Subject: Re: nasty problem with redhat 6.2 + pg 7.02