function parse error

From: "Harry Stangel" <hstangel(at)speakeasy(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: function parse error
Date: 2004-11-05 15:33:51
Message-ID: x-SdnZIrFP_9ABbcRVn-gQ@speakeasy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-11-05 15:33:53 Re: Question on locking
Previous Message Kjetil Haaland 2004-11-05 14:01:44 result from where clause