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

Commit507ed03

Browse files
committed
Repair AlterTableOwner --- was failing for relations with indexes.
1 parent2fabb99 commit507ed03

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.16 2002/05/21 22:05:54 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.17 2002/06/17 14:31:32 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2747,7 +2747,8 @@ AlterTableOwner(Oid relationOid, int32 newOwnerSysId)
27472747
Form_pg_classtuple_class;
27482748

27492749
/* Get exclusive lock till end of transaction on the target table */
2750-
target_rel=heap_open(relationOid,AccessExclusiveLock);
2750+
/* Use relation_open here so that we work on indexes... */
2751+
target_rel=relation_open(relationOid,AccessExclusiveLock);
27512752

27522753
/* Get its pg_class tuple, too */
27532754
class_rel=heap_openr(RelationRelationName,RowExclusiveLock);
@@ -2807,7 +2808,7 @@ AlterTableOwner(Oid relationOid, int32 newOwnerSysId)
28072808

28082809
heap_freetuple(tuple);
28092810
heap_close(class_rel,RowExclusiveLock);
2810-
heap_close(target_rel,NoLock);
2811+
relation_close(target_rel,NoLock);
28112812
}
28122813

28132814
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp