Re: [GENERAL] recovery dump on database with different timezone - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] recovery dump on database with different timezone
Date
Msg-id CAKFQuwZ5e-_F6Bt_F3vy+WVe21vXpb8yuS2n6N9bEopo+S4vGw@mail.gmail.com
Whole thread Raw
In response to [GENERAL] recovery dump on database with different timezone  (Edmundo Robles <edmundo@sw-argos.com>)
List pgsql-general
On Mon, Jan 23, 2017 at 4:45 PM, Edmundo Robles <edmundo@sw-argos.com> wrote:
* This is  the message: COPY failed for table "stlm_201012ad": ERROR:  new row for relation "stlm_201012ad" violates check constraint "time_stamp_201012ad"
DETAIL:  Failing row contains (..., 2011-01-01 00:00:03.925+00, .., 0).

* this the  constraint:  "time_stamp_201012ad" CHECK (time_stamp >= '2010-12-01'::date AND time_stamp < '2011-01-01'::date)
​​

​I'm not that fluent experimenting with dump/restore mechanics (hence the uncertainty below) but...​

​Your record only passes the check constraint if the system is in a timezone West of UTC.  Because then at least 1 hour is subtracted from the supplied timestamp before converting it into date for comparison.

If you set the target database timezone to be the proper designation for "localtime" the restoration might work.

Your claim that the source system was setup for UTC is suspect...

David J.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] recovery dump on database with different timezone
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] recovery dump on database with different timezone