Forbid DROP SCHEMA on temporary namespaces
authorMichael Paquier <michael@paquier.xyz>
Fri, 27 Dec 2019 08:59:39 +0000 (17:59 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 27 Dec 2019 08:59:39 +0000 (17:59 +0900)
commit898e0c650097a724177ade1af552901385eaf6c1
treee07eb30931d0957554853cce3a0a39f961f7298f
parent5c0a132cf1410fb9dea577e6b84b8560bb0f7e03
Forbid DROP SCHEMA on temporary namespaces

This operation was possible for the owner of the schema or a superuser.
Down to 9.4, doing this operation would cause inconsistencies in a
session whose temporary schema was dropped, particularly if trying to
create new temporary objects after the drop.  A more annoying
consequence is a crash of autovacuum on an assertion failure when
logging information about an orphaned temp table dropped.  Note that
because of 246a6c8 (present in v11~), which has made the removal of
orphaned temporary tables more aggressive, the failure could be
triggered more easily, but it is possible to reproduce down to 9.4.

Reported-by: Mahendra Singh, Prabhat Sahu
Author: Michael Paquier
Reviewed-by: Kyotaro Horiguchi, Mahendra Singh
Discussion: http://postgr.es/m/CAKYtNAr9Zq=1-ww4etHo-VCC-k120YxZy5OS01VkaLPaDbv2tg@mail.gmail.com
Backpatch-through: 9.4
src/backend/commands/dropcmds.c