mirror of
https://github.com/postgres/postgres.git
synced 2025-06-04 00:02:37 -04:00
If we're gonna use ExecRelationIsTargetRelation here, might as well
simplify a bit further.
This commit is contained in:
parent
310578efee
commit
bc421c35b1
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.148 2007/07/27 19:09:04 neilc Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.149 2007/07/31 16:36:07 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -816,15 +816,14 @@ ExecOpenScanRelation(EState *estate, Index scanrelid)
|
|||||||
LOCKMODE lockmode;
|
LOCKMODE lockmode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determine the lock type we need. First, scan to see if target
|
* Determine the lock type we need. First, scan to see if target relation
|
||||||
* relation is a result relation.
|
* is a result relation. If not, check if it's a FOR UPDATE/FOR SHARE
|
||||||
|
* relation. In either of those cases, we got the lock already.
|
||||||
*/
|
*/
|
||||||
lockmode = AccessShareLock;
|
lockmode = AccessShareLock;
|
||||||
if (ExecRelationIsTargetRelation(estate, scanrelid))
|
if (ExecRelationIsTargetRelation(estate, scanrelid))
|
||||||
lockmode = NoLock;
|
lockmode = NoLock;
|
||||||
|
else
|
||||||
/* If not, check if it's a FOR UPDATE/FOR SHARE relation */
|
|
||||||
if (lockmode == AccessShareLock)
|
|
||||||
{
|
{
|
||||||
ListCell *l;
|
ListCell *l;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user