aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-03-25 18:04:47 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-03-25 18:04:47 +0000
commit42a00ef3b8b6294aaf637feed7b0cea628f8da65 (patch)
tree6dd7b78b4f6932e8fb0349b4d3fdd1f31e369bc2 /src/backend/commands/tablecmds.c
parentae7c18d1aed9bab11d62fb6344877f1b7d52ffa8 (diff)
downloadpostgresql-42a00ef3b8b6294aaf637feed7b0cea628f8da65.tar.gz
postgresql-42a00ef3b8b6294aaf637feed7b0cea628f8da65.zip
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.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 5d80b748503..2ab6a114c2a 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.142.4.2 2005/02/09 23:27:24 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.142.4.3 2005/03/25 18:04:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -5356,7 +5356,7 @@ change_owner_recurse_to_sequences(Oid relationOid, int32 newOwnerSysId)
* SERIAL sequences are those having an internal dependency on one
* of the table's columns (we don't care *which* column, exactly).
*/
- depRel = heap_openr(DependRelationName, RowExclusiveLock);
+ depRel = heap_openr(DependRelationName, AccessShareLock);
ScanKeyInit(&key[0],
Anum_pg_depend_refclassid,
@@ -5402,6 +5402,8 @@ change_owner_recurse_to_sequences(Oid relationOid, int32 newOwnerSysId)
}
systable_endscan(scan);
+
+ relation_close(depRel, AccessShareLock);
}
/*