text -> time cast problem

From: Brent Verner <brent(at)rcfile(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: text -> time cast problem
Date: 2001-12-04 13:27:12
Message-ID: 20011204132712.GA3054@rcfile.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I noticed an incorrect example in doc/src/sgml/func.sgml...

brent=# SELECT EXTRACT(SECOND FROM TIME '17:12:28.5');
date_part
-----------
28
(1 row)

The documentation says this should return 28.5. Digging a bit, I
noticed the following (discrepancy?). Is this desired behavior?

brent=# select "time"('12:00:12.5');
time
-------------
12:00:12.50
(1 row)

brent=# select '12:00:12.5'::time;
time
----------
12:00:12
(1 row)

IMO, one of these needs to be fixed before RC1 is rolled.

On a similar note, it would be neat if there was an sgml tag like
<examplequery>
SELECT EXTRACT(SECOND FROM TIME '17:12:28.5');
</examplequery>
that would dynamically execute the query and insert the result in
the sgml file... This would ensure the docs always agree with current
behavior ;-)

cheers.
brent

--
"Develop your talent, man, and leave the world something. Records are
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing." -- Duane Allman

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-12-04 14:54:51 Re: FW: [CYGWIN] 7.2b3 postmaster doesn't start on Win98
Previous Message Tatsuo Ishii 2001-12-04 13:18:45 dynaloader/sunos4.h