Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id DB0561A6B83A for ; Sat, 31 Dec 2011 08:42:30 -0400 (AST) Received: from mail-gx0-f174.google.com ([209.85.161.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RgyGX-0005lr-PT for pgsql-docs@postgresql.org; Sat, 31 Dec 2011 12:42:30 +0000 Received: by ggdk6 with SMTP id k6so9084745ggd.19 for ; Sat, 31 Dec 2011 04:42:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.128.138 with SMTP id f10mr56944898yhi.2.1325335333022; Sat, 31 Dec 2011 04:42:13 -0800 (PST) Received: by 10.100.4.17 with HTTP; Sat, 31 Dec 2011 04:42:12 -0800 (PST) In-Reply-To: References: Date: Sat, 31 Dec 2011 13:42:12 +0100 Message-ID: Subject: Re: CREATE TABLE LIKE, regarding constraints From: Magnus Hagander To: david.sahagian@emc.com Cc: pgsql-docs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201112/44 X-Sequence-Number: 7151 On Fri, Dec 30, 2011 at 22:27, wrote: > www.postgresql.org/docs/9.0/static/sql-createtable.html > =3D=3D =3D=3D =3D=3D =3D=3D =3D=3D > LIKE parent_table [ like_option ... ] > . . . > Not-null constraints are always copied to the new table. > CHECK constraints will only be copied if INCLUDING CONSTRAINTS is specifi= ed; other types of constraints will never be copied. > . . . > =3D=3D =3D=3D =3D=3D =3D=3D =3D=3D > > But I do see PK and UNIQUE constraints > =A0CONSTRAINT blah_pkey PRIMARY KEY (id), > =A0CONSTRAINT blah_host_id_key UNIQUE (host_id) > in the def of the new table. Can you provide the commands you ran to make that happen? It doesn't happen for me in a trivial test. > Also, why is there no discussion of what "EXCLUDING CONSTRAINTS" will res= ult in ? --=20 =A0Magnus Hagander =A0Me: http://www.hagander.net/ =A0Work: http://www.redpill-linpro.com/