Re: CREATE LIKE INCLUDING COMMENTS and STORAGES - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: CREATE LIKE INCLUDING COMMENTS and STORAGES
Date
Msg-id 20090928111746.927F.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: CREATE LIKE INCLUDING COMMENTS and STORAGES  (Brendan Jurd <direvus@gmail.com>)
Responses Re: CREATE LIKE INCLUDING COMMENTS and STORAGES
List pgsql-hackers
Brendan Jurd <direvus@gmail.com> wrote:

> I am doing an initial review of your patch.

Thank you for reviewing.
I merged your fix and add INCLUDING ALL option to the new patch.
I changed InhRelation.options to be a bitmap of CreateStmtLikeOption.
INCLUDING just adds bits, and EXCLUDING drops bits.

Now this patch adds:
    * CREATE TABLE LIKE ... INCLUDING COMMENTS (for columns and constraints)
    * CREATE TABLE LIKE ... INCLUDING STORAGE
    * CREATE TABLE LIKE ... INCLUDING ALL

> I think I'm failing to understand why this would be an issue.  Why
> would the user be specifying columns in the CREATE TABLE statement
> that already exist in the table they are cloning?

Without inline-STORAGE syntax, we cannot resolve conflictions of
storage parameters unless we can define tables without STORAGE
and then re-add options with ALTER TABLE.

There might be ToDo items:
    * Make INCLUDING COMMENTS also copy comments on indexes.
    * Add syntax to define storage options inline like
      CREATE TABLE tbl (col text STORAGE MAIN).

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TODO item: Allow more complex user/database default GUC settings
Next
From: Robert Haas
Date:
Subject: Re: operator exclusion constraints