Re: now() vs 'epoch'::timestamp

Поиск
Список
Период
Сортировка
От James Cloos
Тема Re: now() vs 'epoch'::timestamp
Дата
Msg-id m3d23nfulg.fsf@carbon.jhcloos.org
обсуждение исходный текст
Ответ на Re: now() vs 'epoch'::timestamp  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-general
>>>>> "SF" == Stephen Frost <sfrost@snowman.net> writes:

>> (now()::timestamp without time zone - 'epoch'::timestamp without time zone)::reltime::integer
>> (Incidently, is there a better way in 9.4?)

SF> Uh, select extract('epoch' from now()); ?

Thanks.  Back when I first needed it (years ago), that long line was the
only recomendation I could find.

SF> The only thing I'd say about this is that you *really* want to use
SF> timestamptz in PG for storing timestamps.

I normally do, but this table hasn't changed in years.  Maybe 7.4 or so
was current when it started.

Thanks!

-JimC
--
James Cloos <cloos@jhcloos.com>         OpenPGP: 0x997A9F17ED7DAEA6

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

Предыдущее
От: TonyS
Дата:
Сообщение: Re: Would like to know how analyze works technically
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: now() vs 'epoch'::timestamp