hi.
--this ALTER COLUMN DROP EXPRESSION work as expected
DROP TABLE IF EXISTS parent cascade;
CREATE TABLE parent (a int, d INT GENERATED ALWAYS AS (11) STORED);
CREATE TABLE child () INHERITS (parent);
ALTER TABLE parent ALTER COLUMN d DROP EXPRESSION;
----- the below (ALTER COLUMN DROP EXPRESSION) should also work.
-----
DROP TABLE IF EXISTS parent cascade;
CREATE TABLE parent (a int, d INT GENERATED ALWAYS AS (11) STORED);
CREATE TABLE child () INHERITS (parent);
CREATE TABLE grandchild () INHERITS (child);
ALTER TABLE parent ALTER COLUMN d DROP EXPRESSION;
but currently it will generated error:
ERROR: 0A000: ALTER TABLE / DROP EXPRESSION must be applied to child tables too
LOCATION: ATPrepDropExpression, tablecmds.c:8734
The attached patch fixes this potential issue.