Re: ERROR: pg_class_aclcheck: relation (OID) not found with SELECT INTO variable

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 with SELECT INTO variable
Date: 2004-07-23 18:00:11
Message-ID: 26799.1090605611@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Betsy Barker <betsy(dot)barker(at)supportservicesinc(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message mike g 2004-07-24 03:36:51 Re: ERROR: pg_class_aclcheck: relation (OID) not found
Previous Message Tom Lane 2004-07-23 17:56:22 Re: String Concatenation