From the iDocs:
epoch
For date and timestamp values, the number of seconds since
1970-01-01 00:00:00-00 (Result may be negative.); for interval values,
the total number of seconds in the interval
SELECT EXTRACT(EPOCH FROM TIMESTAMP '2001-02-16 20:38:40');
Result: 982352320
But if I seem to get milliseconds too in my queries:
$ psql sessions -c "SELECT EXTRACT(EPOCH FROM current_timestamp) as now"
now
------------------
1029298563.74248
(1 row)
Are the Docs out of date? How can I get EXTRACT to only return seconds?
Jc