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?