Skip site navigation (1) Skip section navigation (2)

Re: ERROR: pg_class_aclcheck: relation (OID) not found

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Betsy Barker <betsy(dot)barker(at)supportservicesinc(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: ERROR: pg_class_aclcheck: relation (OID) not found
Date: 2004-07-23 17:37:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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.

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2004-07-23 17:56:22
Subject: Re: String Concatenation
Previous:From: Betsy BarkerDate: 2004-07-23 17:27:05
Subject: ERROR: pg_class_aclcheck: relation (OID) not found with SELECT INTO variable

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group