Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
8984c8bb
Commit
8984c8bb
authored
Jan 23, 2008
by
Alvaro Herrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve lock level choices in pg_shdepend.c. Noticed by Tom Lane.
parent
6a7a63d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
src/backend/catalog/pg_shdepend.c
src/backend/catalog/pg_shdepend.c
+15
-5
No files found.
src/backend/catalog/pg_shdepend.c
View file @
8984c8bb
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.2
2 2008/01/01 19:45:48 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.2
3 2008/01/23 15:36:38 alvherre
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1110,7 +1110,12 @@ shdepDropOwned(List *roleids, DropBehavior behavior)
...
@@ -1110,7 +1110,12 @@ shdepDropOwned(List *roleids, DropBehavior behavior)
deleteobjs
=
new_object_addresses
();
deleteobjs
=
new_object_addresses
();
sdepRel
=
heap_open
(
SharedDependRelationId
,
AccessExclusiveLock
);
/*
* We don't need this strong a lock here, but we'll call routines that
* acquire RowExclusiveLock. Better get that right now to avoid potential
* deadlock failures.
*/
sdepRel
=
heap_open
(
SharedDependRelationId
,
RowExclusiveLock
);
/*
/*
* For each role, find the dependent objects and drop them using the
* For each role, find the dependent objects and drop them using the
...
@@ -1224,7 +1229,7 @@ shdepDropOwned(List *roleids, DropBehavior behavior)
...
@@ -1224,7 +1229,7 @@ shdepDropOwned(List *roleids, DropBehavior behavior)
/* the dependency mechanism does the actual work */
/* the dependency mechanism does the actual work */
performMultipleDeletions
(
deleteobjs
,
behavior
);
performMultipleDeletions
(
deleteobjs
,
behavior
);
heap_close
(
sdepRel
,
Access
ExclusiveLock
);
heap_close
(
sdepRel
,
Row
ExclusiveLock
);
free_object_addresses
(
deleteobjs
);
free_object_addresses
(
deleteobjs
);
}
}
...
@@ -1241,7 +1246,12 @@ shdepReassignOwned(List *roleids, Oid newrole)
...
@@ -1241,7 +1246,12 @@ shdepReassignOwned(List *roleids, Oid newrole)
Relation
sdepRel
;
Relation
sdepRel
;
ListCell
*
cell
;
ListCell
*
cell
;
sdepRel
=
heap_open
(
SharedDependRelationId
,
AccessShareLock
);
/*
* We don't need this strong a lock here, but we'll call routines that
* acquire RowExclusiveLock. Better get that right now to avoid potential
* deadlock problems.
*/
sdepRel
=
heap_open
(
SharedDependRelationId
,
RowExclusiveLock
);
foreach
(
cell
,
roleids
)
foreach
(
cell
,
roleids
)
{
{
...
@@ -1343,5 +1353,5 @@ shdepReassignOwned(List *roleids, Oid newrole)
...
@@ -1343,5 +1353,5 @@ shdepReassignOwned(List *roleids, Oid newrole)
systable_endscan
(
scan
);
systable_endscan
(
scan
);
}
}
heap_close
(
sdepRel
,
AccessShar
eLock
);
heap_close
(
sdepRel
,
RowExclusiv
eLock
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment