(moved to -hackers) https://www.postgresql.org/message-id/flat/54d30e66-dbd6-5485-aaf6-a291ed55919d%40oss.nttdata.com
On Thu, Apr 15, 2021 at 11:24:07PM +0900, Fujii Masao wrote: > On 2021/04/15 11:54, Michael Paquier wrote: > > 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. +1 to your patch -- Justin
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;