Re: clone_schema function

From: Igor Neyman <ineyman(at)perceptron(dot)com>
To: Melvin Davidson <melvin6925(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: clone_schema function
Date: 2015-09-10 13:09:42
Message-ID: A76B25F2823E954C9E45E32FA49D70ECCD515332@mail.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: Melvin Davidson [mailto:melvin6925(at)gmail(dot)com]
Sent: Wednesday, September 09, 2015 4:48 PM
To: Igor Neyman <ineyman(at)perceptron(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] clone_schema function

Thanks Igor,
hmm, apparently the "INCLUDING CONSTRAINTS' option of "CREATE TABLE' has a glitch and only includes the primary key.
I also noticed that INCLUDING ALL generates an error, so I'll have to report that also.
I'll go eat some crow and work on a fix to add all constraints in the meantime.

It’s not a bug.
According to docs:
“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.”
So, FK constraints are not supposed to be copied.

Regards,
Igor Neyman

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2015-09-10 15:52:10 Re: clone_schema function
Previous Message Melvin Davidson 2015-09-10 12:58:39 Re: Bugs with like_option in CREATE TABLE