create table if not exists xx AS select ...

From: Daniel Caldeweyher <daniel(dot)caldeweyher(at)pricefinder(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: create table if not exists xx AS select ...
Date: 2015-03-23 01:28:31
Message-ID: CAN3G7dYkzRtWT_u2NO4B4LC6WUBtRQ-nPxtrR0PcLLWr+uqJcw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

I am not entirely sure if this is a bug (fails on 9.3 and 9.4) or working
as intended:

create table if not exists test (
foo boolean
);

create table if not exists test2 as
select * from test where 1=0;
/*
ERROR: syntax error at or near "as"
LINE 1: create table if not exists test2 as
*/

create table test2 as
select * from test where 1=0;

Thanks

Daniel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2015-03-23 01:41:42 Re: create table if not exists xx AS select ...
Previous Message Haribabu Kommi 2015-03-22 23:59:34 Re: Unicode license compatibility with PostgreSQL license