SQL99 CREATE TABLE ... (LIKE parent_table)

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: SQL99 CREATE TABLE ... (LIKE parent_table)
Date: 2003-05-12 13:55:26
Message-ID: 1052747726.95134.9.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rbt(dot)ca>

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

Attachment Content-Type Size
pg-like.diff text/x-patch 19.9 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-05-12 14:59:38 Re: SQL99 CREATE TABLE ... (LIKE parent_table)
Previous Message Tom Lane 2003-05-12 13:40:37 Re: Static snapshot data