@@ -126,6 +126,7 @@ static List *on_commits = NIL;
126126 * a pass determined by subcommand type.
127127 */
128128
129+ #define AT_PASS_UNSET -1/* UNSET will cause ERROR */
129130#define AT_PASS_DROP 0/* DROP (all flavors) */
130131#define AT_PASS_ALTER_TYPE 1/* ALTER COLUMN TYPE */
131132#define AT_PASS_OLD_INDEX 2/* re-add existing indexes */
@@ -2947,7 +2948,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
29472948bool recurse ,bool recursing ,LOCKMODE lockmode )
29482949{
29492950AlteredTableInfo * tab ;
2950- int pass ;
2951+ int pass = AT_PASS_UNSET ;
29512952
29522953/* Find or create work queue entry for this table */
29532954tab = ATGetQueueEntry (wqueue ,rel );
@@ -3160,9 +3161,10 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
31603161default :/* oops */
31613162elog (ERROR ,"unrecognized alter table type: %d" ,
31623163 (int )cmd -> subtype );
3163- pass = 0 ; /* keep compiler quiet */
3164+ pass = AT_PASS_UNSET ; /* keep compiler quiet */
31643165break ;
31653166}
3167+ Assert (pass > AT_PASS_UNSET );
31663168
31673169/* Add the subcommand to the appropriate list for phase 2 */
31683170tab -> subcmds [pass ]= lappend (tab -> subcmds [pass ],cmd );