X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D535A5286A for ; Fri, 27 May 2005 13:17:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32624-09 for ; Fri, 27 May 2005 16:17:34 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id AC26752820 for ; Fri, 27 May 2005 13:17:32 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j4RGHNHC040974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 27 May 2005 10:17:27 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j4RGHMOq031498; Fri, 27 May 2005 10:17:22 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j4RGHMpv031497; Fri, 27 May 2005 10:17:22 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 27 May 2005 10:17:22 -0600 From: Michael Fuhr To: Ying Lu Cc: pgsql-sql@postgresql.org Subject: Re: SQL command Error: "create table ... Like parentTable including defaults" Message-ID: <20050527161722.GA31451@winnie.fuhr.org> References: <42974157.201@cs.concordia.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42974157.201@cs.concordia.ca> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/232 X-Sequence-Number: 21545 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/