mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-07 19:47:50 +08:00
Add comments for AlteredTableInfo->rel
The prior commit which introduced it was pretty squalid in terms of code documentation, so add some comments.
This commit is contained in:
parent
cd03c6e94b
commit
cc121d5596
@ -157,8 +157,16 @@ typedef struct AlteredTableInfo
|
|||||||
Oid relid; /* Relation to work on */
|
Oid relid; /* Relation to work on */
|
||||||
char relkind; /* Its relkind */
|
char relkind; /* Its relkind */
|
||||||
TupleDesc oldDesc; /* Pre-modification tuple descriptor */
|
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;
|
Relation rel;
|
||||||
|
|
||||||
/* Information saved by Phase 1 for Phase 2: */
|
/* Information saved by Phase 1 for Phase 2: */
|
||||||
List *subcmds[AT_NUM_PASSES]; /* Lists of AlterTableCmd */
|
List *subcmds[AT_NUM_PASSES]; /* Lists of AlterTableCmd */
|
||||||
/* Information saved by Phases 1/2 for Phase 3: */
|
/* Information saved by Phases 1/2 for Phase 3: */
|
||||||
@ -4577,7 +4585,9 @@ ATRewriteCatalogs(List **wqueue, LOCKMODE lockmode,
|
|||||||
continue;
|
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);
|
tab->rel = relation_open(tab->relid, NoLock);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user