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

CREATE TABLE ... INHERITS (parent INCLUDING xxx)

From: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: CREATE TABLE ... INHERITS (parent INCLUDING xxx)
Date: 2009-10-30 08:25:49
Message-ID: 20091030172549.3CA6.52131E4D@oss.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
We have two ways to copy table definitions:
  - CREATE TABLE child ( LIKE parent )
  - CREATE TABLE child ( ) INHERITS ( parent )

But "INCLUDING xxx" is supported only in "LIKE" version.
Should we have "INHERITS ( parent INCLUDING xxx )" syntax ?

We can use LIKE and INHERITS at once:
    CREATE TABLE chld ( LIKE parent INCLUDING ALL ) INHERITS (parent)
but will have annoying log messages:
    NOTICE:  merging column "..." with inherited definition

Since partitioning syntax are rewritten into INHERITS and INCLUDING ALL
internally, eliminating such logs will be better. CREATE TABLE LIKE +
ALTER TABLE INHERIT can solve the issue, but direct solutions are welcome.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Responses

pgsql-hackers by date

Next:From: Hitoshi HaradaDate: 2009-10-30 11:44:52
Subject: Re: half OOT, plv8js group created ^^
Previous:From: Peter EisentrautDate: 2009-10-30 08:03:00
Subject: Re: Syntax for partitioning

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