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)
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