A creepy story about dates. How to prevent it?

Поиск
Список
Период
Сортировка
От Conxita Marín
Тема A creepy story about dates. How to prevent it?
Дата
Msg-id 001d01c335b2$78dce860$0cd8a8c0@dims
обсуждение исходный текст
Ответы Re: A creepy story about dates. How to prevent it?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: A creepy story about dates. How to prevent it?  (Andrew Snow <andrew@modulus.org>)
Список 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










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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: Linux supports hot-swappable hardware? [was Re:
Следующее
От: Tom Lane
Дата:
Сообщение: Re: A creepy story about dates. How to prevent it?