Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 410fede

Browse files
committed
Fix two bugs in change_owner_recurse_to_sequences: it was grabbing an
overly strong lock on pg_depend, and it wasn't closing the rel when done. The latter bug was masked by the ResourceOwner code, which is something that should be changed.
1 parent 6d3f74d commit 410fede

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/commands/tablecmds.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.150 2005/03/24 00:03:22 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.151 2005/03/25 18:04:34 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -5374,7 +5374,7 @@ change_owner_recurse_to_sequences(Oid relationOid, int32 newOwnerSysId)
53745374
* SERIAL sequences are those having an internal dependency on one
53755375
* of the table's columns (we don't care *which* column, exactly).
53765376
*/
5377-
depRel = heap_openr(DependRelationName, RowExclusiveLock);
5377+
depRel = heap_openr(DependRelationName, AccessShareLock);
53785378

53795379
ScanKeyInit(&key[0],
53805380
Anum_pg_depend_refclassid,
@@ -5420,6 +5420,8 @@ change_owner_recurse_to_sequences(Oid relationOid, int32 newOwnerSysId)
54205420
}
54215421

54225422
systable_endscan(scan);
5423+
5424+
relation_close(depRel, AccessShareLock);
54235425
}
54245426

54255427
/*

0 commit comments

Comments
 (0)