]> granicus.if.org Git - postgresql/commitdiff
Handle AT_ReAddComment in test_ddl_deparse, and add a catch-all default.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 20 Jul 2015 07:19:22 +0000 (10:19 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 20 Jul 2015 07:27:01 +0000 (10:27 +0300)
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 e42375fc. Backpatch to 9.5,
like that patch.

src/include/nodes/parsenodes.h
src/test/modules/test_ddl_deparse/test_ddl_deparse.c

index a567c50da7279c960b4c4ca503b1b81854427cc8..cd7b19eac5a1771a0b621f0f91e330e1e43fc076 100644 (file)
@@ -1474,7 +1474,6 @@ typedef enum AlterTableType
        AT_AddConstraint,                       /* add constraint */
        AT_AddConstraintRecurse,        /* internal to commands/tablecmds.c */
        AT_ReAddConstraint,                     /* internal to commands/tablecmds.c */
-       AT_ReAddComment,                        /* internal to commands/tablecmds.c */
        AT_AlterConstraint,                     /* alter constraint */
        AT_ValidateConstraint,          /* validate constraint */
        AT_ValidateConstraintRecurse,           /* internal to commands/tablecmds.c */
@@ -1483,6 +1482,7 @@ typedef enum AlterTableType
        AT_AddIndexConstraint,          /* add constraint using existing index */
        AT_DropConstraint,                      /* drop constraint */
        AT_DropConstraintRecurse,       /* internal to commands/tablecmds.c */
+       AT_ReAddComment,                        /* internal to commands/tablecmds.c */
        AT_AlterColumnType,                     /* alter column type */
        AT_AlterColumnGenericOptions,           /* alter column OPTIONS (...) */
        AT_ChangeOwner,                         /* change owner */
index 44a5cb0277e13b1fab700373d71efcfde8bd6ce4..a216e422e9f0d23342515427e6b8183809ff45ae 100644 (file)
@@ -151,6 +151,9 @@ get_altertable_subcmdtypes(PG_FUNCTION_ARGS)
                        case AT_DropConstraintRecurse:
                                strtype = "DROP CONSTRAINT (and recurse)";
                                break;
+                       case AT_ReAddComment:
+                               strtype = "(re) ADD COMMENT";
+                               break;
                        case AT_AlterColumnType:
                                strtype = "ALTER COLUMN SET TYPE";
                                break;
@@ -253,6 +256,8 @@ get_altertable_subcmdtypes(PG_FUNCTION_ARGS)
                        case AT_GenericOptions:
                                strtype = "SET OPTIONS";
                                break;
+                       default:
+                               strtype = "unrecognized";
                }
 
                astate =