Re: Stored Procedure Newbie - Mailing list pgsql-general

From Tom Lane
Subject Re: Stored Procedure Newbie
Date
Msg-id 15799.994805348@sss.pgh.pa.us
Whole thread Raw
In response to Stored Procedure Newbie  (chaconeric@hotmail.com (Eric Chacon))
List pgsql-general
chaconeric@hotmail.com (Eric Chacon) writes:
> CREATE FUNCTION update_flag_func()
> RETURNS text
> AS 'UPDATE update_flag SET content=current_timestamp;'
> LANGUAGE 'plpgsql';

> What obvious thing am I missing?

plpgsql wants BEGIN and END decoration around the procedure body.
The example would work as-is (I think) if you said LANGUAGE 'sql'.

            regards, tom lane

pgsql-general by date:

Previous
From: "Dr. Evil"
Date:
Subject: Re: Stored Procedure Newbie
Next
From: "Thalis A. Kalfigopoulos"
Date:
Subject: Re: Stored Procedure Newbie