Re: create table if not exists xx AS select ...

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: create table if not exists xx AS select ...
Дата
Msg-id CAB7nPqTO+WS1ahWGRij5V8_G2CnL63St_BPHHiqa_Vy91nBX_A@mail.gmail.com
обсуждение исходный текст
Ответ на create table if not exists xx AS select ...  (Daniel Caldeweyher <daniel.caldeweyher@pricefinder.com.au>)
Ответы Re: create table if not exists xx AS select ...  (Daniel Caldeweyher <daniel.caldeweyher@pricefinder.com.au>)
Список pgsql-general
On Mon, Mar 23, 2015 at 10:28 AM, Daniel Caldeweyher
<daniel.caldeweyher@pricefinder.com.au> wrote:
> I am not entirely sure if this is a bug (fails on 9.3 and 9.4) or working as
> intended:
> [...]
> create table test2 as
> select * from test where 1=0;

This works as intended, CREATE TABLE AS does not support IF NOT EXISTS
in 9.4 and 9.3:
http://www.postgresql.org/docs/9.3/static/sql-createtableas.html
http://www.postgresql.org/docs/9.4/static/sql-createtableas.html
But it does in 9.5 and onwards:
http://www.postgresql.org/docs/devel/static/sql-createtableas.html
Regards,
--
Michael


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

Предыдущее
От: Daniel Caldeweyher
Дата:
Сообщение: create table if not exists xx AS select ...
Следующее
От: Daniel Caldeweyher
Дата:
Сообщение: Re: create table if not exists xx AS select ...