diff options
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/execMain.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 569d0ba7ade..422f737e82d 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -2532,11 +2532,13 @@ OpenIntoRel(QueryDesc *queryDesc) } /* - * Find namespace to create in, check its permissions + * Find namespace to create in, check its permissions, lock it against + * concurrent drop, and mark into->rel as RELPERSISTENCE_TEMP if the + * selected namespace is temporary. */ intoName = into->rel->relname; - namespaceId = RangeVarGetAndCheckCreationNamespace(into->rel); - RangeVarAdjustRelationPersistence(into->rel, namespaceId); + namespaceId = RangeVarGetAndCheckCreationNamespace(into->rel, NoLock, + NULL); /* * Security check: disallow creating temp tables from security-restricted |