Re: Can't "EXTRACT" from a field? - Mailing list pgsql-hackers

From Brent Verner
Subject Re: Can't "EXTRACT" from a field?
Date
Msg-id 20011122122215.A34897@rcfile.org
Whole thread Raw
In response to Re: Can't "EXTRACT" from a field?  ("Marc G. Fournier" <scrappy@hub.org>)
Responses Re: Can't "EXTRACT" from a field?
List pgsql-hackers
On 22 Nov 2001 at 11:18 (-0500), Marc G. Fournier wrote:
| 
| ya, I hadn't clued in until fighting with it some more that if the fieldis
| already a timestamp, yyou don't have to put it in as 'EXTRACT(WEEK FROM
| TIMESTAMP tid) :(

Ok, scratch my previous email WRT the sgml docs being wrong...

Something is strange, tho.

brent=# select extract( week from timestamp ('2001-02-06 20:38:40'::timestamp)>
ERROR:  parser: parse error at or near "'"
brent=# select extract( week from "timestamp" ('2001-02-06 20:38:40'::timestam>date_part 
-----------        6
(1 row)

brent=# select extract( week from timestamp ('2001-02-06 20:38:40') );
ERROR:  parser: parse error at or near "'"
brent=# select extract( week from timestamp '2001-02-06 20:38:40'::timestamp );date_part 
-----------        6
(1 row)

brent=# select extract( week from timestamp '2001-02-06 20:38:40' );date_part 
-----------        6
(1 row)

Notice: timestamp( type )         => fail "timestamp"( type )       => OK timestamp type            => OK timestamp
column_of_type => fail     [1] Marc's original observation.
 


can't help any more... 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: Tom Lane
Date:
Subject: Re: Implicit coercions need to be reined in
Next
From: Peter Eisentraut
Date:
Subject: Re: Diff/Patch integration -> SQL cvs clone