Re: plpgsql: PERFORM SELECT id INTO TEMP TABLE ..

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Janning Vygen <vygen(at)gmx(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql: PERFORM SELECT id INTO TEMP TABLE ..
Date: 2002-07-05 16:46:24
Message-ID: 200207051646.g65GkOx20022@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff MacDonald 2002-07-05 16:48:38 Re: I am being interviewed by OReilly
Previous Message Marc G. Fournier 2002-07-05 16:43:26 Re: Should next release by 8.0 (Was: Re: [GENERAL] I am