Re: Trigger to convert UNIX time to timestamp without time zone.

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Trigger to convert UNIX time to timestamp without time zone.
Дата
Msg-id 20140606133928.GD25470@crankycanuck.ca
обсуждение исходный текст
Ответ на Trigger to convert UNIX time to timestamp without time zone.  (Alberto Olivares <alberto.olivares@snowflakesoftware.com>)
Ответы Re: Trigger to convert UNIX time to timestamp without time zone.
Список pgsql-general
On Fri, Jun 06, 2014 at 02:19:50PM +0100, Alberto Olivares wrote:
> How can I create a trigger to transform the time from UNIX to timestamp
> without time zone every time a new record is inserted into my database?

This is in the manual, section 9.8: to_timestamp(double precision)

It's always a little confusing when you go to look it up, because it's
not with the date and time functions, because it's actually a
formatting issue.  (There's a cross reference, but if you don't know
this is just a formatting issue you won't know to follow the
reference.)  You probably don't need a trigger, just put that in your
query.

Are you sure you want this without time zone?  In my experience,
almost every time people think they want "without time zone" they
actually don't.

A


--
Andrew Sullivan
ajs@crankycanuck.ca


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

Предыдущее
От: Stefan Froehlich
Дата:
Сообщение: Re: interpret bytea output as text / double encode()
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: PostgreSQL 9.2.4 + CentOS 6.5 64 bit - segfault error in initdb