Re: SQL command Error: "create table ... Like parentTable including defaults" - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: SQL command Error: "create table ... Like parentTable including defaults"
Date
Msg-id 20050527161722.GA31451@winnie.fuhr.org
Whole thread Raw
In response to SQL command Error: "create table ... Like parentTable including defaults"  (Ying Lu <ying_lu@cs.concordia.ca>)
List pgsql-sql
On Fri, May 27, 2005 at 11:48:39AM -0400, Ying Lu wrote:
> 
> create table tableName1 LIKE parentTable   INCLUDING defaults ;
> 
> I was trying to create table "tableName1" with the same structure as 
> "parentTable" without any data. I got a syntax error: 
> 'syntax error at or near "like" ... '

The CREATE TABLE documentation shows that LIKE should be in parentheses:

CREATE TABLE tableName1 (LIKE parentTable INCLUDING DEFAULTS);

http://www.postgresql.org/docs/8.0/interactive/sql-createtable.html

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


pgsql-sql by date:

Previous
From: Bricklen Anderson
Date:
Subject: Re: SQL command Error: "create table ... Like parentTable
Next
From: KÖPFERL Robert
Date:
Subject: Generic Join on Arrays