Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65eb2d0

Browse files
committed
Acquire locks on views in AcquirePlannerLocks, too.
Commit47bb9db taught AcquireExecutorLocks to re-acquire lockson views using data from their RTE_SUBQUERY replacements, butit now seems like we should make AcquirePlannerLocks do the same.In this way, if a view has been redefined, we will notice thata bit earlier while checking validity of a cached plan and therebyavoid some wasted work.Report and patch by Amit Langote.Discussion:https://postgr.es/m/CA+HiwqH0xZOQ+GQAdKeckY1R4NOeHdzhtfxkAMJLSchpapNk5w@mail.gmail.com
1 parent84adc8e commit65eb2d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/backend/utils/cache/plancache.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,6 +1846,14 @@ ScanQueryForLocks(Query *parsetree, bool acquire)
18461846
break;
18471847

18481848
caseRTE_SUBQUERY:
1849+
/* If this was a view, must lock/unlock the view */
1850+
if (OidIsValid(rte->relid))
1851+
{
1852+
if (acquire)
1853+
LockRelationOid(rte->relid,rte->rellockmode);
1854+
else
1855+
UnlockRelationOid(rte->relid,rte->rellockmode);
1856+
}
18491857
/* Recurse into subquery-in-FROM */
18501858
ScanQueryForLocks(rte->subquery,acquire);
18511859
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp