Re: Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP

Поиск
Список
Период
Сортировка
От Colin Wetherbee
Тема Re: Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP
Дата
Msg-id 47D9A9F8.8090909@denterprises.org
обсуждение исходный текст
Ответ на Re: Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP  (Colin Wetherbee <cww@denterprises.org>)
Ответы Re: Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Colin Wetherbee wrote:
> Tom Lane wrote:
>> Colin Wetherbee <cww@denterprises.org> writes:
>>> Adrian Klaver wrote:
>>>> Try CREATE TEMP TABLE foo ON COMMIT DROP AS (SELECT 1 AS a, 2 AS b) ;
>>
>>> I don't know what version the OP is using, but that doesn't work on 8.1:
>>
>> Seems to be there in 8.2 and up.
>
> In 8.2:
>
> cww=# BEGIN;
> BEGIN
> cww=# CREATE TEMP TABLE foo ON COMMIT DROP AS (SELECT 1 AS a, 2 AS b);
> SELECT
> cww=# COMMIT;
> COMMIT
> cww=# \d foo
> Did not find any relation named "foo".

FWIW, the output of \h CREATE TABLE in both 8.1 and 8.2 suggest that
this should be possible.

Colin

В списке pgsql-general по дате отправления:

Предыдущее
От: Colin Wetherbee
Дата:
Сообщение: Re: Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is there a way to elegantly do a : CREATE TEMP TABLE X AS SELECT .... ON COMMIT DROP