pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Ying Lu <ying_lu@cs.concordia.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL command Error: "create table ... Like parentTable including defaults"
Date: Fri, 27 May 2005 10:17:22 -0600
Message-ID: <20050527161722.GA31451@winnie.fuhr.org> (raw)
In-Reply-To: <42974157.201@cs.concordia.ca>
References: <42974157.201@cs.concordia.ca>

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/



view thread (3+ messages)

Message-ID: <20050527161722.GA31451@winnie.fuhr.org>
Permalink:  ../20050527161722.GA31451@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050527161722.GA31451@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, ying_lu@cs.concordia.ca
  Subject: Re: SQL command Error: "create table ... Like parentTable including defaults"
  In-Reply-To: <20050527161722.GA31451@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox