Re: How do I get the current time in seconds in the unix epoch?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How do I get the current time in seconds in the unix epoch?
Дата
Msg-id 8289.1002946358@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How do I get the current time in seconds in the unix epoch?  (Bill Studenmund <wrstuden@netbsd.org>)
Список pgsql-hackers
Bill Studenmund <wrstuden@netbsd.org> writes:
> In 7.1 I was able to get this (I thought) with
> date_part(''epoch'', timestamp ''now'') . That doesn't seem to work for me
> in last week's -current.

Indeed: in 7.1 I can do

test71=# select date_part('epoch', timestamp 'now');date_part
------------1002946239
(1 row)

but current sources give

regression=# select date_part('epoch', timestamp 'now');
ERROR:  Timestamp with time zone units 'epoch' not recognized

Thomas, I think you broke something.
        regards, tom lane


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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: optimizer question
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: TOAST and TEXT