Re: [GENERAL] recovery dump on database with different timezone

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] recovery dump on database with different timezone
Дата
Msg-id 15215.1485220037@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [GENERAL] recovery dump on database with different timezone  (Edmundo Robles <edmundo@sw-argos.com>)
Список pgsql-general
Edmundo Robles <edmundo@sw-argos.com> writes:
> * this the  constraint:  "time_stamp_201012ad" CHECK (time_stamp >=
> '2010-12-01'::date AND time_stamp < '2011-01-01'::date)

If that's on a timestamptz column, it's a seriously dangerous constraint,
because the limitations it enforces are dependent on the current timezone
setting (which will determine what is the midnight boundary for those
dates).  It's entirely possible that your database is unrestorable because
different entries in the column were made under different timezone
settings and there is *no* zone value in which all of them will be able to
pass the constraint.  Even if there is such a zone value, you already know
that UTC isn't it.

I'd suggest dropping the constraint in the source database (or editing the
dump file to remove it), restoring the data, and then looking to clean up
the data before you try to put the constraint back on.  And this time,
express it as something like time_stamp >= '2010-12-01 00:00+00' etc ...

            regards, tom lane


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] recovery dump on database with different timezone
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [GENERAL] recovery dump on database with different timezone