BUG #16700: Child table dependency loss after moving out of and back into the inheritance tree

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #16700: Child table dependency loss after moving out of and back into the inheritance tree
Дата
Msg-id 16700-39027e4b536105de@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #16700: Child table dependency loss after moving out of and back into the inheritance tree  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16700
Logged by:          Daniel Vérité
Email address:      daniel@manitou-mail.org
PostgreSQL version: 9.6.18
Operating system:   Linux
Description:

Hi,

When dropping a column in a parent table, the change is propagated to child
tables.
But when a child has been moved out of the hierarchy and then back into
it,
this propagation appears to no longer work for that child table.

Below is a reproducer I've tried with both the current devel version and 9.6
(9.6 is the version I'm having the issue with in production). The result is
the same.


DROP TABLE  IF EXISTS parent_tbl CASCADE;

CREATE TABLE parent_tbl(f1 int, f2 int, f3 int);

CREATE TABLE child1_tbl() INHERITS(parent_tbl);
CREATE TABLE child2_tbl() INHERITS(parent_tbl);
CREATE TABLE child3_tbl() INHERITS(parent_tbl);

ALTER TABLE child2_tbl NO INHERIT parent_tbl;
ALTER TABLE child2_tbl INHERIT parent_tbl;

ALTER TABLE parent_tbl DROP COLUMN f2;

\d child*_tbl

             Table "public.child1_tbl"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 f1     | integer |           |          | 
 f3     | integer |           |          | 
Inherits: parent_tbl

             Table "public.child2_tbl"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 f1     | integer |           |          | 
 f2     | integer |           |          | 
 f3     | integer |           |          | 
Inherits: parent_tbl

             Table "public.child3_tbl"
 Column |  Type   | Collation | Nullable | Default 
--------+---------+-----------+----------+---------
 f1     | integer |           |          | 
 f3     | integer |           |          | 
Inherits: parent_tbl

It's surprising that dropping the parent_tbl.f2 column does not cascade into
child2_tbl, even though child2_tbl is a member of the hierarchy.
Is it a bug?


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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: BUG #16643: PG13 - Logical replication - initial startup never finishes and gets stuck in startup loop
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #16643: PG13 - Logical replication - initial startup never finishes and gets stuck in startup loop