Re: Oddity with extract microseconds? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Oddity with extract microseconds?
Date
Msg-id 200512061709.jB6H9JD16121@candle.pha.pa.us
Whole thread Raw
In response to Re: Oddity with extract microseconds?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Oddity with extract microseconds?
List pgsql-hackers
Tom Lane wrote:
> Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> > OK, AndrewSN just pointed out that it's "documented" to work like that...
> > ...still seems bizarre...
> 
> It seems reasonably consistent to me.  extract() doesn't consider
> seconds and fractional seconds to be distinct fields: it's all one
> value.  The milliseconds and microseconds options just shift the
> decimal place for you.

I think this illustrates the issue:
test=> SELECT date_part('microseconds', '00:00:01.33'::time); date_part-----------   1330000(1 row)test=> SELECT
date_part('microseconds','00:03:01.33'::time); date_part-----------   1330000(1 row)
 

Why aren't 'minutes' considered too?  Because they aren't 'seconds'. 
Well, seconds aren't microseconds either.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Oddity with extract microseconds?
Next
From: Tom Lane
Date:
Subject: Re: Oddity with extract microseconds?