Re: Stored Procedure Newbie

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: chaconeric(at)hotmail(dot)com (Eric Chacon)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Stored Procedure Newbie
Date: 2001-07-10 22:49:08
Message-ID: 15799.994805348@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

chaconeric(at)hotmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chad R. Larson 2001-07-10 22:50:13 Re: NULL values
Previous Message Dr. Evil 2001-07-10 22:26:09 Re: Stored Procedure Newbie