Re: Oddity with extract microseconds?

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Oddity with extract microseconds?
Date: 2005-12-07 03:03:13
Message-ID: 439650F1.4050901@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> mysql> SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:01.00123');
> +-------------------------------------------------------+
> | EXTRACT(MICROSECOND FROM '2003-01-02 10:30:01.00123') |
> +-------------------------------------------------------+
> | 1230 |
> +-------------------------------------------------------+
> 1 row in set (0.00 sec)
>
> Does contrary behavior from MySQL count as evidence that PostgreSQL's
> behavior is correct? :-)

No...I happen to think that their way is more consistent though. Pity
it's not in the spec.

At least PostgreSQL is consistent with seconds/microseconds:

mysql=# select extract(seconds from timestamp '2005-01-01 00:00:01.01');
date_part
-----------
1.01
(1 row)

Chris

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-07 03:19:44 Re: row is too big: size 8916, maximum size 8136
Previous Message Michael Fuhr 2005-12-07 02:53:37 Re: Oddity with extract microseconds?