Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX2un-0007p1-Se for pgsql-docs@arkaria.postgresql.org; Thu, 15 Apr 2021 14:24:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lX2um-0007MR-Er for pgsql-docs@arkaria.postgresql.org; Thu, 15 Apr 2021 14:24:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX2um-0007MJ-9K for pgsql-docs@lists.postgresql.org; Thu, 15 Apr 2021 14:24:16 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX2uj-0002Ns-O8 for pgsql-docs@lists.postgresql.org; Thu, 15 Apr 2021 14:24:15 +0000 Received: from hnk.local (p2043043-ipbf1801funabasi.chiba.ocn.ne.jp [221.185.194.43]) by oss.nttdata.com (Postfix) with ESMTPSA id 68030623C6; Thu, 15 Apr 2021 23:24:09 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: INCLUDING COMPRESSION To: Michael Paquier Cc: pgsql-docs@lists.postgresql.org References: <54d30e66-dbd6-5485-aaf6-a291ed55919d@oss.nttdata.com> From: Fujii Masao Message-ID: <9d2e08ce-8ae1-7d7b-b6c2-c8e608254342@oss.nttdata.com> Date: Thu, 15 Apr 2021 23:24:07 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------A1107562827DF24B0C68E277" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------A1107562827DF24B0C68E277 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 2021/04/15 11:54, Michael Paquier wrote: > On Wed, Apr 14, 2021 at 11:46:58PM +0900, Fujii Masao wrote: >> The syntax for like_option in CREATE TABLE docs seems to forget to mention >> INCLUDING COMPRESSION option. I think the following fix is necessary. >> Patch attached. >> >> -{ INCLUDING | EXCLUDING } { COMMENTS | CONSTRAINTS | DEFAULTS | GENERATED | IDENTITY | INDEXES | STATISTICS | STORAGE | ALL } >> +{ INCLUDING | EXCLUDING } { COMMENTS | COMPRESSION | CONSTRAINTS | DEFAULTS | GENERATED | IDENTITY | INDEXES | STATISTICS | STORAGE | ALL } > > Indeed. Thanks! Pushed. > May I ask at the same time why gram.y (TableLikeOption) and > parsenodes.h (CREATE_TABLE_LIKE_COMPRESSION) don't classify this new > option in alphabetical order with the rest? Ordering them makes > easier a review of them. I'm not sure why. But +1 to make them in alphabetical order. Patch attached. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION --------------A1107562827DF24B0C68E277 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="including_compression_order.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="including_compression_order.patch" diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 73494002ad..b4ab4014c8 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -3760,6 +3760,7 @@ TableLikeOptionList: TableLikeOption: COMMENTS { $$ = CREATE_TABLE_LIKE_COMMENTS; } + | COMPRESSION { $$ = CREATE_TABLE_LIKE_COMPRESSION; } | CONSTRAINTS { $$ = CREATE_TABLE_LIKE_CONSTRAINTS; } | DEFAULTS { $$ = CREATE_TABLE_LIKE_DEFAULTS; } | IDENTITY_P { $$ = CREATE_TABLE_LIKE_IDENTITY; } @@ -3767,7 +3768,6 @@ TableLikeOption: | INDEXES { $$ = CREATE_TABLE_LIKE_INDEXES; } | STATISTICS { $$ = CREATE_TABLE_LIKE_STATISTICS; } | STORAGE { $$ = CREATE_TABLE_LIKE_STORAGE; } - | COMPRESSION { $$ = CREATE_TABLE_LIKE_COMPRESSION; } | ALL { $$ = CREATE_TABLE_LIKE_ALL; } ; diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 7a44bccdd3..615dfa26aa 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -690,14 +690,14 @@ typedef struct TableLikeClause typedef enum TableLikeOption { CREATE_TABLE_LIKE_COMMENTS = 1 << 0, - CREATE_TABLE_LIKE_CONSTRAINTS = 1 << 1, - CREATE_TABLE_LIKE_DEFAULTS = 1 << 2, - CREATE_TABLE_LIKE_GENERATED = 1 << 3, - CREATE_TABLE_LIKE_IDENTITY = 1 << 4, - CREATE_TABLE_LIKE_INDEXES = 1 << 5, - CREATE_TABLE_LIKE_STATISTICS = 1 << 6, - CREATE_TABLE_LIKE_STORAGE = 1 << 7, - CREATE_TABLE_LIKE_COMPRESSION = 1 << 8, + CREATE_TABLE_LIKE_COMPRESSION = 1 << 1, + CREATE_TABLE_LIKE_CONSTRAINTS = 1 << 2, + CREATE_TABLE_LIKE_DEFAULTS = 1 << 3, + CREATE_TABLE_LIKE_GENERATED = 1 << 4, + CREATE_TABLE_LIKE_IDENTITY = 1 << 5, + CREATE_TABLE_LIKE_INDEXES = 1 << 6, + CREATE_TABLE_LIKE_STATISTICS = 1 << 7, + CREATE_TABLE_LIKE_STORAGE = 1 << 8, CREATE_TABLE_LIKE_ALL = PG_INT32_MAX } TableLikeOption; --------------A1107562827DF24B0C68E277--