Skip to content

Commit bc421c3

Browse files
committed
If we're gonna use ExecRelationIsTargetRelation here, might as well
simplify a bit further.
1 parent 310578e commit bc421c3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/backend/executor/execUtils.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.148 2007/07/27 19:09:04 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.149 2007/07/31 16:36:07 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -816,15 +816,14 @@ ExecOpenScanRelation(EState *estate, Index scanrelid)
816816
LOCKMODE lockmode;
817817

818818
/*
819-
* Determine the lock type we need. First, scan to see if target
820-
* relation is a result relation.
819+
* Determine the lock type we need. First, scan to see if target relation
820+
* is a result relation. If not, check if it's a FOR UPDATE/FOR SHARE
821+
* relation. In either of those cases, we got the lock already.
821822
*/
822823
lockmode = AccessShareLock;
823824
if (ExecRelationIsTargetRelation(estate, scanrelid))
824825
lockmode = NoLock;
825-
826-
/* If not, check if it's a FOR UPDATE/FOR SHARE relation */
827-
if (lockmode == AccessShareLock)
826+
else
828827
{
829828
ListCell *l;
830829

0 commit comments

Comments
 (0)