Re: SELECT INTO TEMP in Trigger?

From: Itai Zukerman <zukerman(at)math-hat(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT INTO TEMP in Trigger?
Date: 2003-04-11 22:15:09
Message-ID: 878yugr89e.fsf@matt.w80.math-hat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> This seems to not be possible is plpgsql:
>
> SELECT DISTINCT A.x INTO TEMP X FROM A,B WHERE A.x=B.x;
>
> Is there some way to create a temporary table in plpgsql?

Just to clarify, this sort-of works HOWEVER:

SELECT count(*) FROM X;
DROP X;

The first time through the plpgsql the SELECT is fine. Further times
it complains:

ERROR: pg_class_aclcheck: relation 8845807 not found

I guess it doesn't like dealing with a different X. Should I use
FOR-IN-EXECUTE? That seems ugly...

--
Itai Zukerman <http://www.math-hat.com/~zukerman/>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Itai Zukerman 2003-04-11 22:18:59 Re: count(*), EXISTS, indexes
Previous Message Dan Langille 2003-04-11 22:15:07 Re: SELECT INTO TEMP in Trigger?