Skip to content

Commit 0c046f8

Browse files
committed
Revert "Forbid DROP SCHEMA on temporary namespaces"
This reverts commit a052f6c, following complains from Robert Haas and Tom Lane. Backpatch down to 9.4, like the previous commit. Discussion: https://postgr.es/m/CA+TgmobL4npEX5=E5h=5Jm_9mZun3MT39Kq2suJFVeamc9skSQ@mail.gmail.com Backpatch-through: 9.4
1 parent 8de3b68 commit 0c046f8

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/backend/commands/dropcmds.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "nodes/makefuncs.h"
2828
#include "parser/parse_type.h"
2929
#include "utils/builtins.h"
30-
#include "utils/lsyscache.h"
3130
#include "utils/syscache.h"
3231

3332

@@ -110,21 +109,6 @@ RemoveObjects(DropStmt *stmt)
110109
ReleaseSysCache(tup);
111110
}
112111

113-
/*
114-
* Prevent the drop of a temporary schema, be it owned by the current
115-
* session or another backend as this would mess up with the callback
116-
* registered to clean up temporary objects at the end of a session.
117-
* Note also that the creation of any follow-up temporary object would
118-
* result in inconsistencies within the session whose temporary schema
119-
* has been dropped.
120-
*/
121-
if (stmt->removeType == OBJECT_SCHEMA &&
122-
isAnyTempNamespace(address.objectId))
123-
ereport(ERROR,
124-
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
125-
errmsg("cannot drop temporary schema \"%s\"",
126-
get_namespace_name(address.objectId))));
127-
128112
/* Check permissions. */
129113
namespaceId = get_object_namespace(&address);
130114
if (!OidIsValid(namespaceId) ||

0 commit comments

Comments
 (0)