mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
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
This commit is contained in:
@ -18017,8 +18017,11 @@ AlterTableNamespaceInternal(Relation rel, Oid oldNspOid, Oid nspOid,
|
||||
|
||||
/* Fix the table's row type too, if it has one */
|
||||
if (OidIsValid(rel->rd_rel->reltype))
|
||||
AlterTypeNamespaceInternal(rel->rd_rel->reltype,
|
||||
nspOid, false, false, objsMoved);
|
||||
AlterTypeNamespaceInternal(rel->rd_rel->reltype, nspOid,
|
||||
false, /* isImplicitArray */
|
||||
false, /* ignoreDependent */
|
||||
false, /* errorOnTableType */
|
||||
objsMoved);
|
||||
|
||||
/* Fix other dependent stuff */
|
||||
AlterIndexNamespaces(classRel, rel, oldNspOid, nspOid, objsMoved);
|
||||
|
Reference in New Issue
Block a user