Re: "Relation x does not exist" error when x does exist

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Gaurav Priyolkar <gaurav_lists(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: "Relation x does not exist" error when x does exist
Date: 2001-10-12 18:14:59
Message-ID: Pine.BSF.4.21.0110121113370.97475-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)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';

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Charles Tassell 2001-10-12 18:23:16 Re: Multiple postgresql installations on one machine.
Previous Message Stephan Szabo 2001-10-12 18:13:19 Re: Another episode of the regular MySql-PostgreSQL war