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

Copy column storage parameters on CREATE TABLE LIKE/INHERITS

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: HACKERS <pgsql-hackers(at)postgresql(dot)org>
Subject: Copy column storage parameters on CREATE TABLE LIKE/INHERITS
Date: 2008-08-12 08:46:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Here is an updated version of the "Copy storage parameters" patch.

This patch copies only column storage parameters and does not copy
reloptions as a result of the discussion, in which reloptions should
not be copied because LIKE and INHERITS are not table definitions,
but column definitions.

Copying reloptions (or copying just table's definition) might be useful
in some cases, but it should be done by another independent patch.

Inheriting column storage parameters is useful if we duplicate an
existing table. CREATE TABLE AS is useful to avoid WALs in that time:

  CREATE TABLE (LIKE target) WITH (<same as the target table>)
    AS SELECT * FROM target;

However, we cannot execute ALTER COLUMN SET STORAGE after creating the
new table and before inserting, because there are no time to execute
commands between them. So we need some methods to set column storage
parameters at creating a table.

ITAGAKI Takahiro
NTT Open Source Software Center

Attachment: inherits-column-params.patch
Description: application/octet-stream (7.5 KB)


pgsql-hackers by date

Next:From: Gregory StarkDate: 2008-08-12 09:10:51
Subject: psql bug -- using old variables and database connection
Previous:From: Markus WannerDate: 2008-08-12 08:14:32
Subject: Re: WIP: New Page API

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