X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0732DDA529 for ; Fri, 7 Oct 2005 11:48:32 -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 49504-02 for ; Fri, 7 Oct 2005 14:48:27 +0000 (GMT) Received: from dfrobd01.vailsys.com (chrobd01.vailsys.com [63.210.102.138]) by svr1.postgresql.org (Postfix) with ESMTP id E4FFDD8833 for ; Fri, 7 Oct 2005 11:48:29 -0300 (ADT) Received: from dfsfbd06.vail (dfsfbd06.vail [192.168.129.190]) by dfrobd01.vailsys.com (Postfix) with ESMTP id E6D24FF38; Fri, 7 Oct 2005 09:48:33 -0500 (CDT) Received: from [192.168.129.86] (dfwddurham.vail [192.168.129.86]) by dfsfbd06.vail (Postfix) with ESMTP id BA61A579C; Fri, 7 Oct 2005 09:48:28 -0500 (CDT) Message-ID: <43468AAC.5010509@vailsys.com> Date: Fri, 07 Oct 2005 09:48:12 -0500 From: David Durham User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alvaro Herrera Cc: pgsql-admin@postgresql.org Subject: Re: create table like syntax References: <4344942A.3040506@vailsys.com> <20051006033636.GA12593@surnet.cl> In-Reply-To: <20051006033636.GA12593@surnet.cl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/91 X-Sequence-Number: 19163 Alvaro Herrera wrote: > On Wed, Oct 05, 2005 at 10:04:10PM -0500, David Durham wrote: > >>is there a syntax that would look something like: >> >> create table newTable like oldTable without indexes || records || >>constraints with indexes || records || constraints >> >>built into postgres? > > > What do you want to do with it? If I understand what you want to do, it > is supported as long as you use ; in place of your ||. Well, I should say that the with and without should probably be mutually exclusive. I don't know, haven't thought about it that much, but I find myself creating a lot of the same table over and over from time to time as I try to analyze some data. Would be nice to say, hey, create a copy of this table with indexes and possibly records and constraints. Or just a bare copy or something like that, but have a lot of different options for this kind of thing. - Dave