pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Repair ALTER EXTENSION ... SET SCHEMA.
Date: Thu, 09 May 2024 16:19:56 +0000
Message-ID: <E1s56Ut-000B8E-Jn@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9effc4608e1f6d19546a0e0f64320f4b0dd10c3c

Modified Files
--------------
src/backend/commands/alter.c                       | 14 ++---
src/backend/commands/extension.c                   |  2 +-
src/backend/commands/tablecmds.c                   |  7 ++-
src/backend/commands/typecmds.c                    | 69 +++++++++++++++++-----
src/include/commands/typecmds.h                    |  4 +-
src/test/modules/test_extensions/Makefile          |  2 +
.../test_extensions/expected/test_extensions.out   | 38 ++++++++++++
src/test/modules/test_extensions/meson.build       |  2 +
.../test_extensions/sql/test_extensions.sql        | 10 ++++
.../test_extensions/test_ext_set_schema--1.0.sql   | 17 ++++++
.../test_extensions/test_ext_set_schema.control    |  3 +
11 files changed, 141 insertions(+), 27 deletions(-)



Message-ID: <E1s56Ut-000B8E-Jn@gemulon.postgresql.org>
Permalink:  ../E1s56Ut-000B8E-Jn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1s56Ut-000B8E-Jn@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Repair ALTER EXTENSION ... SET SCHEMA.
  In-Reply-To: <E1s56Ut-000B8E-Jn@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox