Re: timestamp_part() bug?

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: timestamp_part() bug?
Date: 2002-03-05 03:47:10
Message-ID: 20020305124710Z.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > I see following in the manual:
> >
> > -------------------------------------------------------------------
> > The seconds field, including fractional parts, multiplied by
> > 1000. Note that this includes full seconds.
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > SELECT EXTRACT(MILLISECONDS FROM TIME '17:12:28.5');
> > Result: 28500
> > -------------------------------------------------------------------
> >
> > And I see:
> >
> > test=# select current_timestamp,extract(milliseconds from current_timestamp);
> > timestamptz | date_part
> > -------------------------------+-----------
> > 2002-02-27 14:45:53.945529+09 | 945.529
> > (1 row)
> >
> > Apparently there's an inconsistency among manuals, timestamp(tz)_part
> > and timetz_part. Does anybody know which one is correct?
>
> As far as I know, allowing MILLISECONDS etc. for the first arugument
> of EXTARCT is a PostgreSQL extention and we should decide what to do
> by ourselves.
>
> My proposal is fixing timestamp(tz)_part so that it returns "the
> seconds field, including fractional parts, multiplied by > 1000. Note
> that this includes full seconds" as the manual stats, since this would
> keep the consistency and also have the least impact for existing
> applications.

Fix committed into both current and 7.2-stable.
--
Tatsuo Ishii

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-03-05 04:11:03 Re: Problem in ResultSet#getTimestamp() of 7.2b4
Previous Message Lincoln Yeoh 2002-03-05 03:39:41 Re: numeric/decimal docs bug?