EPCOH: extract returns millisecs too? - Mailing list pgsql-general

From Jean-Christian Imbeault
Subject EPCOH: extract returns millisecs too?
Date
Msg-id 3D5B2C77.9020300@mega-bucks.co.jp
Whole thread Raw
Responses Re: EPCOH: extract returns millisecs too?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
 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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem with Now()?
Next
From: Tom Lane
Date:
Subject: Re: EPCOH: extract returns millisecs too?