Re: plpgsql: PERFORM SELECT id INTO TEMP TABLE .. - Mailing list pgsql-general

From Bruce Momjian
Subject Re: plpgsql: PERFORM SELECT id INTO TEMP TABLE ..
Date
Msg-id 200207051646.g65GkOx20022@candle.pha.pa.us
Whole thread Raw
In response to plpgsql: PERFORM SELECT id INTO TEMP TABLE ..  (Janning Vygen <vygen@gmx.de>)
List pgsql-general
Janning Vygen wrote:
> Hi,
>
> i am trying to create a temorary table inside a plpgsql function.
>
> i tried something like this:
> PERFORM SELECT name into temp table Names FROM person;
>
> is it just not possible to create a temporary table inside plpgsql ??
> Or did i just made a syntax error and have to keep my eyes open??
>
> before trying and trying for hours, it would be a great help to know
> if its possible. Its not documented, but docs say that you can
> perform any query within a perform statement.
>

I think the INTO conflicts with the INTO used in plpgsql variables.  Use
CREATE TEMP TABLE AS SELECT ... in plpgsql.  That should work.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: two primairy key in one table ?
Next
From: Stephan Szabo
Date:
Subject: Re: two primairy key in one table ?