SQL99 CREATE TABLE ... (LIKE parent_table) - Mailing list pgsql-patches

From Rod Taylor
Subject SQL99 CREATE TABLE ... (LIKE parent_table)
Date
Msg-id 1052747726.95134.9.camel@jester
Whole thread Raw
Responses Re: SQL99 CREATE TABLE ... (LIKE parent_table)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Quick patch to add the subject.  Restructures all inheritance to consist
of a few flags to indicate which structures we want to inherit
(structure only, constraints other than NOT NULL -- check constraints
only at this time, and defaults).

It's slightly better than CREATE TABLE AS due to NOT NULL being carried
over.  Would there be any objections to adding the SQL 2k3 addition
INCLUDING DEFAULTS.

Okay, how about extending SQL 2k3 and adding INCLUDING CHECK CONSTRAINTS
to allow inheritance of the check constraint structures?
MergeAttributes does all of the work, we simply need to turn it on in
the parser (gram.y).  Yes, I wish to add an option to allow check
constraints to be carried over despite the below note from Sect. 11.3:

NOTE 234   <column constraint>s, except for NOT NULL, are not included
in NCi; <column constraint definition>s are effectively transformed to
<table constraint definition>s and are thereby also excluded.

--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Static snapshot data
Next
From: Tom Lane
Date:
Subject: Re: SQL99 CREATE TABLE ... (LIKE parent_table)