Re: How do I get the current time in seconds in the unix epoch? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How do I get the current time in seconds in the unix epoch?
Date
Msg-id 8289.1002946358@sss.pgh.pa.us
Whole thread Raw
In response to How do I get the current time in seconds in the unix epoch?  (Bill Studenmund <wrstuden@netbsd.org>)
List 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 by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: optimizer question
Next
From: Bruce Momjian
Date:
Subject: Re: TOAST and TEXT