After using DROP COLUMN column_name
on parent table some columns in the child tables are not deleted.
How to reassign columns with this behaviour for correct cascade deleting in future?
How to reproduce:
There are two tables: parent
and child
. Child is inherited from the parent and has same columns.
Add new column test
in child. Add new column test
in parent. After that test
in child becomes inherited from parent.
Try to drop test
from parent - expecting cascade deleting test
from child. But it stays.
CREATE TABLE parent (a INT);
CREATE TABLE child () INHERITS (parent);
ALTER TABLE child ADD COLUMN test_inherit VARCHAR;
ALTER TABLE parent ADD COLUMN test_inherit VARCHAR;
ALTER TABLE parent DROP COLUMN test_inherit;