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: Fix failure of ALTER FOREIGN TABLE SET SCHEMA to move sequences.
Date: Tue, 26 Mar 2024 19:28:54 +0000
Message-ID: <E1rpCTd-005oof-L9@gemulon.postgresql.org> (raw)

Fix failure of ALTER FOREIGN TABLE SET SCHEMA to move sequences.

Ordinary ALTER TABLE SET SCHEMA will also move any owned sequences
into the new schema.  We failed to do likewise for foreign tables,
because AlterTableNamespaceInternal believed that only certain
relkinds could have indexes, owned sequences, or constraints.
We could simply add foreign tables to that relkind list, but it
seems likely that the same oversight could be made again in
future.  Instead let's remove the relkind filter altogether.
These functions shouldn't cost much when there are no objects
that they need to process, and surely this isn't an especially
performance-critical case anyway.

Per bug #18407 from Vidushi Gupta.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/18407-4fd07373d252c6a0@postgresql.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b48eda4e54810aa1d8dd2af7c6763fd414d8e0a1

Modified Files
--------------
src/backend/commands/tablecmds.c           | 15 +++++----------
src/test/regress/expected/foreign_data.out | 29 +++++++++++++++++------------
src/test/regress/sql/foreign_data.sql      |  2 ++
3 files changed, 24 insertions(+), 22 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1rpCTd-005oof-L9@gemulon.postgresql.org>
Permalink:  ../E1rpCTd-005oof-L9@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rpCTd-005oof-L9@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: Fix failure of ALTER FOREIGN TABLE SET SCHEMA to move sequences.
  In-Reply-To: <E1rpCTd-005oof-L9@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