aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/extension.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-05-09 12:19:43 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-05-09 12:19:52 -0400
commit9effc4608e1f6d19546a0e0f64320f4b0dd10c3c (patch)
treeb0c4d38060d95ee3b4a7cd12368b531520e9d433 /src/backend/commands/extension.c
parentd82ab9fc31aa62d94c26d7df98e65c6ceaadb01f (diff)
downloadpostgresql-9effc4608e1f6d19546a0e0f64320f4b0dd10c3c.tar.gz
postgresql-9effc4608e1f6d19546a0e0f64320f4b0dd10c3c.zip
Repair ALTER EXTENSION ... SET SCHEMA.
It turns out that we broke this in commit e5bc9454e, because the code was assuming that no dependent types would appear among the extension's direct dependencies, and now they do. This isn't terribly hard to fix: just skip dependent types, expecting that we will recurse to them when we process the parent object (which should also be among the direct dependencies). But a little bit of refactoring is needed so that we can avoid duplicating logic about what is a dependent type. Although there is some testing of ALTER EXTENSION SET SCHEMA, it failed to cover interesting cases, so add more tests. Discussion: https://postgr.es/m/930191.1715205151@sss.pgh.pa.us
Diffstat (limited to 'src/backend/commands/extension.c')
-rw-r--r--src/backend/commands/extension.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index 77d8c9e1862..1643c8c69a0 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -2940,7 +2940,7 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o
/*
* If not all the objects had the same old namespace (ignoring any
- * that are not in namespaces), complain.
+ * that are not in namespaces or are dependent types), complain.
*/
if (dep_oldNspOid != InvalidOid && dep_oldNspOid != oldNspOid)
ereport(ERROR,