Re: Possible to create table name with a variable? Temp

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Possible to create table name with a variable? Temp
Дата
Msg-id 20030822160825.G98413-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Possible to create table name with a variable? Temp tables?  (Godshall Michael <Michael_Godshall@gmachs.com>)
Список 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 по дате отправления:

Предыдущее
От: Godshall Michael
Дата:
Сообщение: Possible to create table name with a variable? Temp tables?
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Clusters and pgsql