function parse error - Mailing list pgsql-novice

From Harry Stangel
Subject function parse error
Date
Msg-id x-SdnZIrFP_9ABbcRVn-gQ@speakeasy.net
Whole thread Raw
Responses Re: function parse error
List pgsql-novice
When trying to run a trivial function, I get the error:

ERROR:  syntax error at or near "DEFINE"
CONTEXT:  compile of PL/pgSQL function "trivial" near line 1

I'm running postgresql v 7.4.5, language plpgsql is loaded.
Note that other user-defined functions without a DEFINE
block run fine.  The offending function:

CREATE OR REPLACE FUNCTION trivial() RETURNS TEXT AS '
    DEFINE
        x TEXT;
    BEGIN
        x := ''success'';
        RETURN x;
    END;
' LANGUAGE plpgsql;

Any help?



pgsql-novice by date:

Previous
From:
Date:
Subject: Pgsql install
Next
From:
Date:
Subject: DBLink issue