Re: "Relation x does not exist" error when x does exist - Mailing list pgsql-general

From Stephan Szabo
Subject Re: "Relation x does not exist" error when x does exist
Date
Msg-id Pine.BSF.4.21.0110121113370.97475-100000@megazone23.bigpanda.com
Whole thread Raw
In response to "Relation x does not exist" error when x does exist  (Gaurav Priyolkar <gaurav_lists@yahoo.com>)
List pgsql-general
plpgsql functions that want to do drops and
creates will need to use EXECUTE to run
statements for those tables.

On Thu, 11 Oct 2001, Gaurav Priyolkar wrote:

> Hi all,
>
> I have a function as follows:
>
> <code>
> [gaurav@linuxserver gaurav]$ cat foo
>
> DROP FUNCTION foo();
> CREATE FUNCTION foo() RETURNS INTEGER AS '
>
> BEGIN
>
>         DROP TABLE foo_1;
>         CREATE TABLE foo_1 AS SELECT x FROM foo;
>
>         DROP TABLE foo_2;
>         CREATE TABLE foo_2 AS SELECT x FROM foo_1;
>
>         RETURN 1;
>
> END;
> ' LANGUAGE 'plpgsql';


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Contents of greatbridge.com?
Next
From: Charles Tassell
Date:
Subject: Re: COMMIT after an ERROR?