Skip site navigation (1) Skip section navigation (2)

BUG #4650: can't specify table schema in CREATE TABLE AS

From: "Thue Janus Kristensen" <thuejk(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4650: can't specify table schema in CREATE TABLE AS
Date: 2009-02-12 12:52:15
Message-ID: 200902121252.n1CCqFOa091243@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4650
Logged by:          Thue Janus Kristensen
Email address:      thuejk(at)gmail(dot)com
PostgreSQL version: 8.3.5
Operating system:   Linux
Description:        can't specify table schema in CREATE TABLE AS
Details: 

According to
http://www.postgresql.org/docs/8.3/interactive/sql-createtableas.html , the
following should work:

CREATE TABLE test(a INT) AS (SELECT 1);

However:

k3_dev_tjk=> CREATE TABLE test(a INT) AS (SELECT 1);
ERROR:  syntax error at or near "AS"
LINE 1: CREATE TABLE test(a INT) AS (SELECT 1);

It works if I drop the table schema:

k3_dev_tjk=> CREATE TABLE test AS (SELECT 1);
SELECT

Responses

pgsql-bugs by date

Next:From: KonstantinDate: 2009-02-12 13:24:30
Subject: Re: BUG #4648: needless deadlock on tables having foreign-key
Previous:From: Heikki LinnakangasDate: 2009-02-12 11:54:11
Subject: Re: BUG #4648: needless deadlock on tables having foreign-key

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group