Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 4ECB5C24695 for ; Fri, 30 Dec 2011 17:28:03 -0400 (AST) Received: from mexforward.lss.emc.com ([128.222.32.20]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rgjzd-0004pD-Qo for pgsql-docs@postgresql.org; Fri, 30 Dec 2011 21:28:03 +0000 Received: from hop04-l1d11-si01.isus.emc.com (HOP04-L1D11-SI01.isus.emc.com [10.254.111.54]) by mexforward.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id pBULRh3v011904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 30 Dec 2011 16:27:46 -0500 Received: from mailhub.lss.emc.com (mailhubhoprd04.lss.emc.com [10.254.222.226]) by hop04-l1d11-si01.isus.emc.com (RSA Interceptor) for ; Fri, 30 Dec 2011 16:27:30 -0500 Received: from mxhub10.corp.emc.com (mxhub10.corp.emc.com [10.254.92.105]) by mailhub.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id pBULRRBu014574 for ; Fri, 30 Dec 2011 16:27:27 -0500 Received: from mx22a.corp.emc.com ([169.254.1.77]) by mxhub10.corp.emc.com ([10.254.92.105]) with mapi; Fri, 30 Dec 2011 16:27:26 -0500 From: To: Date: Fri, 30 Dec 2011 16:27:21 -0500 Subject: CREATE TABLE LIKE, regarding constraints Thread-Topic: CREATE TABLE LIKE, regarding constraints Thread-Index: AczHOdC8DHouN8jIRDuhn4XzKUN22A== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: AocT BMfE BV5E BqMC CaDb CpAS C0i4 GI22 Gh0M Gtdh G49R IU3e J07G KD2Y LPxR LTzN; 1; cABnAHMAcQBsAC0AZABvAGMAcwBAAHAAbwBzAHQAZwByAGUAcwBxAGwALgBvAHIAZwA=; Sosha1_v1; 7; {206B867F-C5E9-4E44-BABE-3E00E1D85065}; ZABhAHYAaQBkAC4AcwBhAGgAYQBnAGkAYQBuAEAAZQBtAGMALgBjAG8AbQA=; Fri, 30 Dec 2011 21:27:21 GMT; QwBSAEUAQQBUAEUAIABUAEEAQgBMAEUAIABMAEkASwBFACwAIAByAGUAZwBhAHIAZABpAG4AZwAgAGMAbwBuAHMAdAByAGEAaQBuAHQAcwA= x-cr-puzzleid: {206B867F-C5E9-4E44-BABE-3E00E1D85065} acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-EMM-MHVC: 1 X-Pg-Spam-Score: -5.5 (-----) X-Archive-Number: 201112/43 X-Sequence-Number: 7150 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 specified= ; 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 CONSTRAINT blah_pkey PRIMARY KEY (id), CONSTRAINT blah_host_id_key UNIQUE (host_id) in the def of the new table. Also, why is there no discussion of what "EXCLUDING CONSTRAINTS" will resul= t in ? Thanks, -dvs-