Skip to content

Commit b83ba2e

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 1ad47e8 commit b83ba2e

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/backend/commands/dropcmds.c

-16
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "nodes/makefuncs.h"
2727
#include "parser/parse_type.h"
2828
#include "utils/builtins.h"
29-
#include "utils/lsyscache.h"
3029
#include "utils/syscache.h"
3130

3231

@@ -117,21 +116,6 @@ RemoveObjects(DropStmt *stmt)
117116
ReleaseSysCache(tup);
118117
}
119118

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

0 commit comments

Comments
 (0)