Lists: | pgsql-hackers |
---|
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 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
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
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: CREATE TABLE ... INHERITS (parent INCLUDING xxx) |
Date: | 2009-10-30 14:02:11 |
Message-ID: | 7581.1256911331@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> Should we have "INHERITS ( parent INCLUDING xxx )" syntax ?
No. That would imply that the user has some control over what is
inherited and what isn't, which would be a complete mess.
regards, tom lane
From: | Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: CREATE TABLE ... INHERITS (parent INCLUDING xxx) |
Date: | 2009-11-02 07:55:59 |
Message-ID: | 20091102165559.C6C7.52131E4D@oss.ntt.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
> > Should we have "INHERITS ( parent INCLUDING xxx )" syntax ?
>
> No. That would imply that the user has some control over what is
> inherited and what isn't, which would be a complete mess.
Hmmm, but users can already control using LIKE INCLUDING clause what is
inherited and what isn't. Also, we don't inherit anything from INHERITS
clause in default. We have nothing to lose even if we support INHERITS
+ INCLUDING, no? And there are certain merits; we can avoid unexpected
log messages and don't have to repeat the parent name in DDL.
Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center