Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc121d5

Browse files
committed
Add comments for AlteredTableInfo->rel
The prior commit which introduced it was pretty squalid in terms ofcode documentation, so add some comments.
1 parentcd03c6e commitcc121d5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,16 @@ typedef struct AlteredTableInfo
157157
Oidrelid;/* Relation to work on */
158158
charrelkind;/* Its relkind */
159159
TupleDescoldDesc;/* Pre-modification tuple descriptor */
160-
/* Transiently set during Phase 2, normally set to NULL */
160+
161+
/*
162+
* Transiently set during Phase 2, normally set to NULL.
163+
*
164+
* ATRewriteCatalogs sets this when it starts, and closes when ATExecCmd
165+
* returns control. This can be exploited by ATExecCmd subroutines to
166+
* close/reopen across transaction boundaries.
167+
*/
161168
Relationrel;
169+
162170
/* Information saved by Phase 1 for Phase 2: */
163171
List *subcmds[AT_NUM_PASSES]; /* Lists of AlterTableCmd */
164172
/* Information saved by Phases 1/2 for Phase 3: */
@@ -4577,7 +4585,9 @@ ATRewriteCatalogs(List **wqueue, LOCKMODE lockmode,
45774585
continue;
45784586

45794587
/*
4580-
* Appropriate lock was obtained by phase 1, needn't get it again
4588+
* Open the relation and store it in tab. This allows subroutines
4589+
* close and reopen, if necessary. Appropriate lock was obtained
4590+
* by phase 1, needn't get it again.
45814591
*/
45824592
tab->rel = relation_open(tab->relid, NoLock);
45834593

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp