Re: CREATE FUNCTION - Mailing list pgsql-general

From Stephan Szabo
Subject Re: CREATE FUNCTION
Date
Msg-id 20040808151513.X7480@megazone.bigpanda.com
Whole thread Raw
In response to CREATE FUNCTION  (Jiri Nemec <konference@menea.cz>)
List pgsql-general
On Sun, 8 Aug 2004, Jiri Nemec wrote:

> Hello all, sorry about beginner question, but I'm sure function has
> correct structure, buw PostgreSQL reports error. (This function is
> only on approbation.)
>
> CREATE FUNCTION foo(int2)
> RETURNS TEXT
> AS 'DECLARE ret TEXT;
>    begin
>       SELECT INTO ret CAST(name AS text)
>       FROM shop_goods
>       WHERE id = $1;
>       return ret;
>    end;'
> language 'sql';

I think you meant language 'plpgsql' rather than 'sql' since the above
looks like the former.

pgsql-general by date:

Previous
From: Robert Fitzpatrick
Date:
Subject: tracking down foreign key constraint violation error
Next
From: "gnari"
Date:
Subject: Re: CREATE FUNCTION