Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 13f2db2

Browse files
committed
Handle AT_ReAddComment in test_ddl_deparse, and add a catch-all default.
In the passing, also move AT_ReAddComment to more logical position in the enum, after all the Constraint-related subcommands. This fixes a compiler warning, added by commit e42375f. Backpatch to 9.5, like that patch.
1 parent 9aa6634 commit 13f2db2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/include/nodes/parsenodes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,6 @@ typedef enum AlterTableType
14741474
AT_AddConstraint, /* add constraint */
14751475
AT_AddConstraintRecurse, /* internal to commands/tablecmds.c */
14761476
AT_ReAddConstraint, /* internal to commands/tablecmds.c */
1477-
AT_ReAddComment, /* internal to commands/tablecmds.c */
14781477
AT_AlterConstraint, /* alter constraint */
14791478
AT_ValidateConstraint, /* validate constraint */
14801479
AT_ValidateConstraintRecurse, /* internal to commands/tablecmds.c */
@@ -1483,6 +1482,7 @@ typedef enum AlterTableType
14831482
AT_AddIndexConstraint, /* add constraint using existing index */
14841483
AT_DropConstraint, /* drop constraint */
14851484
AT_DropConstraintRecurse, /* internal to commands/tablecmds.c */
1485+
AT_ReAddComment, /* internal to commands/tablecmds.c */
14861486
AT_AlterColumnType, /* alter column type */
14871487
AT_AlterColumnGenericOptions, /* alter column OPTIONS (...) */
14881488
AT_ChangeOwner, /* change owner */

src/test/modules/test_ddl_deparse/test_ddl_deparse.c

+5
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ get_altertable_subcmdtypes(PG_FUNCTION_ARGS)
151151
case AT_DropConstraintRecurse:
152152
strtype = "DROP CONSTRAINT (and recurse)";
153153
break;
154+
case AT_ReAddComment:
155+
strtype = "(re) ADD COMMENT";
156+
break;
154157
case AT_AlterColumnType:
155158
strtype = "ALTER COLUMN SET TYPE";
156159
break;
@@ -253,6 +256,8 @@ get_altertable_subcmdtypes(PG_FUNCTION_ARGS)
253256
case AT_GenericOptions:
254257
strtype = "SET OPTIONS";
255258
break;
259+
default:
260+
strtype = "unrecognized";
256261
}
257262

258263
astate =

0 commit comments

Comments
 (0)