SELECT EXTRACT doesn't work with variables? - Mailing list pgsql-general

From Conxita Marín
Subject SELECT EXTRACT doesn't work with variables?
Date
Msg-id 000101c2a695$db935900$0cd8a8c0@dims
Whole thread Raw
Responses Re: SELECT EXTRACT doesn't work with variables?
List pgsql-general
I try to do something like this:

CREATE FUNCTION prova() RETURNS numeric(20,0) AS
'
DECLARE
        aux TIMESTAMP;
        aux2 numeric(20,0);


BEGIN
        aux = ''01.01.2002 00:00:00 CET'';
        aux2 = SELECT EXTRACT(EPOCH FROM TIMESTAMP aux);
        RETURN aux2;
END;
' LANGUAGE 'plpgsql';

I obtain this error:

    NOTICE:  Error occurred while executing PL/pgSQL function prova
    NOTICE:  line 8 at assignment
    ERROR:  parser: parse error at or near "SELECT"

Is this a known bug?
[Conxita Mar{in]



pgsql-general by date:

Previous
From: Conxita Marín
Date:
Subject: SELECT EXTRACT doesn't work with variables?
Next
From: Manfred Koizar
Date:
Subject: Re: converting string value to integer