pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Itai Zukerman <zukerman@math-hat.com>
To: pgsql-sql@postgresql.org
Subject: Re: SELECT INTO TEMP in Trigger?
Date: Fri, 11 Apr 2003 18:15:09 -0400
Message-ID: <878yugr89e.fsf@matt.w80.math-hat.com> (raw)
In-Reply-To: <87brzcr8pf.fsf_-_@matt.w80.math-hat.com>
References: <874r54sr8q.fsf@matt.w80.math-hat.com>
	<87smsora9b.fsf@matt.w80.math-hat.com>
	<87brzcr8pf.fsf_-_@matt.w80.math-hat.com>

> 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/;




view thread (4+ messages)  latest in thread

Message-ID: <878yugr89e.fsf@matt.w80.math-hat.com>
Permalink:  ../878yugr89e.fsf@matt.w80.math-hat.com/
Also on:    postgresql.org/message-id/878yugr89e.fsf@matt.w80.math-hat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: zukerman@math-hat.com
  Subject: Re: SELECT INTO TEMP in Trigger?
  In-Reply-To: <878yugr89e.fsf@matt.w80.math-hat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox