Skip to content

Commit 507ed03

Browse files
committed
Repair AlterTableOwner --- was failing for relations with indexes.
1 parent 2fabb99 commit 507ed03

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_class tuple_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
static void

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy