Skip site navigation (1) Skip section navigation (2)

Re: CREATE TABLE LIKE, regarding constraints

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: david(dot)sahagian(at)emc(dot)com
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: CREATE TABLE LIKE, regarding constraints
Date: 2011-12-31 12:42:12
Message-ID: CABUevExTjCDGhskyXid+6pHSoatUO2u0L7zJ-jAJf43WaLMmtg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
On Fri, Dec 30, 2011 at 22:27,  <david(dot)sahagian(at)emc(dot)com> wrote:
> www.postgresql.org/docs/9.0/static/sql-createtable.html
> == == == == ==
> 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.
> . . .
> == == == == ==
>
> 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.

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 result in ?



-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

pgsql-docs by date

Next:From: david.sahagianDate: 2012-01-02 14:32:39
Subject: Re: CREATE TABLE LIKE, regarding constraints
Previous:From: david.sahagianDate: 2011-12-30 21:27:21
Subject: CREATE TABLE LIKE, regarding constraints

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group