Re: 'epoch'::timestamp and Daylight Savings
От | Thomas Lockhart |
---|---|
Тема | Re: 'epoch'::timestamp and Daylight Savings |
Дата | |
Msg-id | 3DB6E52F.8090509@fourpalms.org обсуждение исходный текст |
Ответ на | Re: 'epoch'::timestamp and Daylight Savings ("Hosen, John" <John.Hosen@capita.co.uk>) |
Список | pgsql-hackers |
> Create table arnold ( > a int8, > b timestamp default 'epoch'::timestamp, > c timestamp default "timestamp"('epoch'::text) > ); > I think that the best way forward for us (short of re-writing the backend to > use NULL) will be to just alter the default value to the one in column b in > the test table above. Hmm. The "timestamp"() call is forcing TIMESTAMP WITHOUT TIME ZONE, which then gets converted to TIMESTAMP WITH TIME ZONE (adding in your one hour offset), which is the default for the unadorned, unquoted 'timestamp' type. You can use something like cast('epoch'::text as timestamp with time zone) to get what you want, and can use "timestamptz"() if you insist. But that is not recommended for direct use in schema definitions, even if pgsql chooses to use it for dump/reloads at the moment. - Thomas
В списке pgsql-hackers по дате отправления: