Re: Can't "EXTRACT" from a field?

From: Brent Verner <brent(at)rcfile(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Can't "EXTRACT" from a field?
Date: 2001-11-22 17:22:15
Message-ID: 20011122122215.A34897@rcfile.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-11-22 17:50:09 Re: Can't "EXTRACT" from a field?
Previous Message Peter Eisentraut 2001-11-22 17:21:30 Re: Diff/Patch integration -> SQL cvs clone