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

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
Message-ID: (view raw, whole thread or download thread mbox)
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: inherits-parameters.patch
Description: application/octet-stream (15.2 KB)


pgsql-hackers by date

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

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