Re: Oddity with extract microseconds?

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Oddity with extract microseconds?
Date: 2005-12-06 15:44:36
Message-ID: 4395B1E4.9070308@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

OK, AndrewSN just pointed out that it's "documented" to work like that...

...still seems bizarre...

Chris

Christopher Kings-Lynne wrote:
> Does anyone else find this odd:
>
> mysql=# select extract(microseconds from timestamp '2005-01-01
> 00:00:00.123');
> date_part
> -----------
> 123000
> (1 row)
>
> mysql=# select extract(microseconds from timestamp '2005-01-01
> 00:00:01.123');
> date_part
> -----------
> 1123000
> (1 row)
>
> No other extracts include other fields. eg, minutes:
>
> mysql=# select extract(minutes from timestamp '2005-01-01 00:10:00');
> date_part
> -----------
> 10
> (1 row)
>
> mysql=# select extract(minutes from timestamp '2005-01-01 10:10:00');
> date_part
> -----------
> 10
>
> So how come microseconds includes the microseconds from the 'seconds'
> field and not just after the '.'? And if it's supposed to include
> 'seconds', then why doesn't it include minutes, hours, etc.?
>
> Chris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mario Weilguni 2005-12-06 16:23:37 Re: Replication on the backend
Previous Message Chris Browne 2005-12-06 15:43:10 Re: Replication on the backend