text -> time cast problem - Mailing list pgsql-hackers

From Brent Verner
Subject text -> time cast problem
Date
Msg-id 20011204132712.GA3054@rcfile.org
Whole thread Raw
Responses Re: text -> time cast problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: dynaloader/sunos4.h
Next
From: Tom Lane
Date:
Subject: Re: FW: [CYGWIN] 7.2b3 postmaster doesn't start on Win98