Re: Possible to create table name with a variable? Temp - Mailing list pgsql-novice

From Stephan Szabo
Subject Re: Possible to create table name with a variable? Temp
Date
Msg-id 20030822160825.G98413-100000@megazone.bigpanda.com
Whole thread Raw
In response to Possible to create table name with a variable? Temp tables?  (Godshall Michael <Michael_Godshall@gmachs.com>)
List pgsql-novice
On Fri, 22 Aug 2003, Godshall Michael wrote:

You probably need to use EXECUTE.

EXECUTE ''DROP TABLE '' || random_table_name;
...
EXECUTE ''CREATE TABLE '' || random_table_name || ...
or
EXECUTE ''CREATE TEMP TABLE '' || random_table_name || ...

If you want to use the table from another function,
I think you'll probably need to wrap the uses of it
with EXECUTE in those functions as well.  Or you might
be better off in another pl language (maybe pltcl or
plpython) because plpgsql caches the query plans and
gets somewhat confused when tables not used in EXECUTE
are dropped between calls.


pgsql-novice by date:

Previous
From: Godshall Michael
Date:
Subject: Possible to create table name with a variable? Temp tables?
Next
From: Ron Johnson
Date:
Subject: Re: Clusters and pgsql