Re: ERROR: pg_class_aclcheck: relation (OID) not found - Mailing list pgsql-novice

From Stephan Szabo
Subject Re: ERROR: pg_class_aclcheck: relation (OID) not found
Date
Msg-id 20040723103422.S48325@megazone.bigpanda.com
Whole thread Raw
In response to ERROR: pg_class_aclcheck: relation (OID) not found with SELECT INTO variable  (Betsy Barker <betsy.barker@supportservicesinc.com>)
List pgsql-novice
On Fri, 23 Jul 2004, Betsy Barker wrote:

> Hi,

> I'm building a function that utilizes a temporary table and I am doing a
> SELECT INTO variable from the table. I've read several posts about the
> EXECUTE, however I'm stuck because my error happens during the SELECT
> INTO a variable, and apparently the EXECUTE SELECT INTO has not been
> implemented in version 7.3.4. Here was my original statement, with the
> associated error:
>
>         --EXECUTE ''SELECT sum(numberemployees) INTO totemployees FROM wages'';
>         --ERROR:  EXECUTE of SELECT ... INTO is not implemented yet

As a note, you can "hack" around this by using FOR IN EXECUTE and do the
assignment in the body of the loop.

> So, I've switched tactics and now I get another error. This error occurs
> the second time I do the SELECT INTO variable FROM TEMP TABLE. (Note,
> the first time I have 1 employee it works, but the second time I have 1
> employee, and use the _rate variable, I get the error)

The normal workaround for using temp tables inside plpgsql is to use
execute on all the queries that affect it.  This of course gets you back
to the problem above.

pgsql-novice by date:

Previous
From: "bcscomputers"
Date:
Subject:
Next
From: Tom Lane
Date:
Subject: Re: String Concatenation