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

Re: Copy storage parameters on CREATE TABLE LIKE/INHERITS

From: daveg <daveg(at)sonic(dot)net>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Copy storage parameters on CREATE TABLE LIKE/INHERITS
Date: 2008-07-30 20:38:52
Message-ID: 20080730203852.GC29152@sonic.net (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Jul 30, 2008 at 04:45:47PM +0900, ITAGAKI Takahiro wrote:
> 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
>   http://archives.postgresql.org/message-id/20080724145954.E572.52131E4D@oss.ntt.co.jp
> 
> 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.

I'd like to have the ability to copy these parameters, but not to have it
be automatic. Some of my clients applications commonly use CREATE TABLE
LIKE to get empty work tables to populate and update before adding the
data to the main table (which may have non-default settings). The automatic
behaviour may be undesirable for this use.

-dg

-- 
David Gould       daveg(at)sonic(dot)net      510 536 1443    510 282 0869
If simplicity worked, the world would be overrun with insects.

In response to

Responses

pgsql-hackers by date

Next:From: Gregory StarkDate: 2008-07-30 21:19:36
Subject: Re: Should creating a new base type require superuser status?
Previous:From: David E. WheelerDate: 2008-07-30 20:11:46
Subject: Re: Type Categories for User-Defined Types

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