pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Itai Zukerman <zukerman@math-hat.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: SELECT INTO TEMP in Trigger?
Date: Tue, 15 Apr 2003 17:36:18 -0400 (EDT)
Message-ID: <200304152136.h3FLaIb10988@candle.pha.pa.us> (raw)
In-Reply-To: <878yugr89e.fsf@matt.w80.math-hat.com>


See the FAQ on creating temp objects in functions ... use EXECUTE.

---------------------------------------------------------------------------

Itai Zukerman wrote:
> > 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/;
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073




view thread (4+ messages)

Message-ID: <200304152136.h3FLaIb10988@candle.pha.pa.us>
Permalink:  ../200304152136.h3FLaIb10988@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200304152136.h3FLaIb10988@candle.pha.pa.us

 · 

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: pgman@candle.pha.pa.us, zukerman@math-hat.com
  Subject: Re: SELECT INTO TEMP in Trigger?
  In-Reply-To: <200304152136.h3FLaIb10988@candle.pha.pa.us>

* 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