Ernst Molitor ([EMAIL PROTECTED]) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
create index ... (date_part('year', d)) fails

Long Description
IMHO, creation of an index on a part of a date field should work, 
but it fails due to the definition of "create index ..." in gram.y. 

Maybe I'm wrong, but I feel that for large tables which will have to be analyzed per 
year, an index of this kind could be an advantage. 


Sample Code
-- the table
create table test (d date);

-- partial indices:
create index d_year on test  (date_part('year', d));

--  fails with: ERROR:  parser: parse error at or near "'"

create index d_year on test (extract(year from d));

--  fails with: ERROR:  parser: parse error at or near "("

No file was uploaded with this report


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to