Oid relid; /* Relation to work on */
char relkind; /* Its relkind */
TupleDesc oldDesc; /* Pre-modification tuple descriptor */
- /* Transiently set during Phase 2, normally set to NULL */
+
+ /*
+ * Transiently set during Phase 2, normally set to NULL.
+ *
+ * ATRewriteCatalogs sets this when it starts, and closes when ATExecCmd
+ * returns control. This can be exploited by ATExecCmd subroutines to
+ * close/reopen across transaction boundaries.
+ */
Relation rel;
+
/* Information saved by Phase 1 for Phase 2: */
List *subcmds[AT_NUM_PASSES]; /* Lists of AlterTableCmd */
/* Information saved by Phases 1/2 for Phase 3: */
continue;
/*
- * Appropriate lock was obtained by phase 1, needn't get it again
+ * Open the relation and store it in tab. This allows subroutines
+ * close and reopen, if necessary. Appropriate lock was obtained
+ * by phase 1, needn't get it again.
*/
tab->rel = relation_open(tab->relid, NoLock);