envisity=# create table temp (tempid integer);
CREATE
envisity=# INSERT INTO temp VALUES(1);
CREATE FUNCTION test3() RETURNS INTEGER AS 'DECLARE id INTEGER; BEGIN SELECT INTO id tempid FROM temp LIMIT 1; RETURN
id;END;' LANGUAGE 'plpgsql';
DROP
CREATE
envisity=# select test3();test3
------- 1
(1 row)
envisity=# DROP TABLE temp ;
DROP
envisity=# create table temp (tempid integer);
CREATE
envisity=# INSERT INTO temp VALUES(3);
INSERT 150371 1
envisity=# select test3();
ERROR: Relation 150348 does not exist
envisity=#
Regards,
Aasmund.
On Mon, 26 Nov 2001 17:23:13 -0800, "Josh Berkus" <josh@agliodbs.com> wrote:
> Aasmund,
>
>
> This is incorrect. This happens with views, but not with functions.
>
> -Josh
>
>
> ______AGLIO DATABASE SOLUTIONS___________________________
> Josh Berkus
> Complete information technology josh@agliodbs.com
> and data management solutions (415) 565-7293
> for law firms, small businesses fax 621-2533
> and non-profit organizations. San Francisco
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
Aasmund Midttun Godal
aasmund@godal.com - http://www.godal.com/
+47 40 45 20 46