A creepy story about dates. How to prevent it?

From: Conxita Marín <comarin(at)telefonica(dot)net>
To: "Pgsql-General-post (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: A creepy story about dates. How to prevent it?
Date: 2003-06-18 15:58:31
Message-ID: 001d01c335b2$78dce860$0cd8a8c0@dims
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.

I will explain my experience to prevent other to fall in the same problem.

We upgraded from 7.2 to 7.3 few days ago. We reload the data via pg_dump an
psql -i <file_dumped>.

The pg_dump was made with PGDATESTYLE=SQL, European (dd/mm/yyyy).

When we load the database we didn't configure te pgdestyle yet, then it was
the default (mm/dd/yy). We populate the data successfully.

Some days later we catch on that some dates are correct and some not. Some
dates appears with day and month exchanged. In this case Postgres
flexibility turn against us.

The load proces did this:

INSERT INTO taula VALUES('12/01/2003,..
INSERT INTO taula VALUES('13/01/2003,..

SELECT fecha FROM taula:

fecha
--------
12/01/03
01/13/03 !!!!!

I suggest that maybe the pg_dump has to store the datestyle in order to
prevent this problems, no?

Regards,

Conxita Marín

Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-06-18 16:12:31 Re: Linux supports hot-swappable hardware? [was Re:
Previous Message Jonathan Bartlett 2003-06-18 15:57:41 Re: Linux supports hot-swappable hardware? [was Re: