Re: nasty problem with redhat 6.2 + pg 7.02

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
Cc: leonbloy(at)sinectis(dot)com(dot)ar, pgsql-general(at)postgresql(dot)org
Subject: Re: nasty problem with redhat 6.2 + pg 7.02
Date: 2000-09-19 16:59:58
Message-ID: 20000919115958.C6108@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Meskes 2000-09-19 17:04:15 Re: pgdump
Previous Message Ross J. Reedstrom 2000-09-19 16:53:29 Re: nasty problem with redhat 6.2 + pg 7.02