On Fri, 23 Oct 2009, Mary Anderson wrote:
> Honest, I am not really a newbie, but I don't see any postgresql
> function to do this in the documentation. I want to do something like
>
> CREATE TABLE mydate(fu DATE);
> INSERT INTO mydate VALUES ('2000-01-01');
> SELECT EXTRACT(YEAR FROM DATE fu) FROM mydate;
I think you'd just want something like:
SELECT EXTRACT(YEAR FROM fu) FROM mydate;
DATE '2000-01-01' is a syntax for providing a date literal, not treating
an expression as a date.