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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix failure of ALTER FOREIGN TABLE SET SCHEMA to move sequences.
Дата
Msg-id E1rpCTd-005ooo-Mi@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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_12_STABLE

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

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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix failure of ALTER FOREIGN TABLE SET SCHEMA to move sequences.
Следующее
От: Nathan Bossart
Дата:
Сообщение: pgsql: Optimize roles_is_member_of() with a Bloom filter.