Copy storage parameters on CREATE TABLE LIKE/INHERITS

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Copy storage parameters on CREATE TABLE LIKE/INHERITS
Date: 2008-07-30 07:45:47
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Here is a patch to copy column storage parameters and reloptions on
CREATE TABLE LIKE, which I proposed at:
[HACKERS] Uncopied parameters on CREATE TABLE LIKE

Column storage parameters (by ALTER COLUMN SET STORAGE) and table
storage parameters (by ALTER TABLE SET (...) ) are copied from template
tables on LIKE or parent tables on INHERITS (1. and 2. at above e-mail).
The patch does not include copying of comments (3.) for now.
It also includes new regression tests and rough documentation.

When template or parent tables have non-default settings,
they are copied into a new table automatically on CREATE TABLE.
If CREATE TABLE statement has own storage parameter definition,
they overwrites inherited settings.

Basically, this patch does nothing if the base tables have only
default settings, but there is an exception -- WITH OIDS. In 8.3,
we inherits WITH OIDS configuration on INHERITS, but not on LIKE.
I'd like to modify the behavior to inherit OIDS configuration
because inheritance would be expected in various contexts.
I did so in the patch, in that a new table will have OIDS if
at least one of its template tables in LIKE has OIDS.

Comments welcome.

ITAGAKI Takahiro
NTT Open Source Software Center

Attachment Content-Type Size
inherits-parameters.patch application/octet-stream 15.2 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2008-07-30 07:49:15 Re: [PATCH] "\ef <function>" in psql
Previous Message Ryan Bradetich 2008-07-30 07:24:38 Re: Type Categories for User-Defined Types