Re: ERROR: pg_class_aclcheck: relation (OID) not found with SELECT INTO variable - Mailing list pgsql-novice

From Tom Lane
Subject Re: ERROR: pg_class_aclcheck: relation (OID) not found with SELECT INTO variable
Date
Msg-id 26799.1090605611@sss.pgh.pa.us
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
Betsy Barker <betsy.barker@supportservicesinc.com> writes:
> 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.

The recommended workaround is to use FOR ... IN EXECUTE to collect the
results of your EXECUTE'd select into a record variable.  It may seem a
little weird to use a FOR loop that you always intend to execute exactly
once, but until someone figures out a reasonable implementation of INTO
in EXECUTE, it's the only way.

            regards, tom lane

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: String Concatenation
Next
From: mike g
Date:
Subject: Re: ERROR: pg_class_aclcheck: relation (OID) not found