Re: pgsql: Fix dependency handling of column drop with partitioned tables

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix dependency handling of column drop with partitioned tables
Date: 2019-10-13 10:13:31
Message-ID: 20191013101331.GC1434@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Sun, Oct 13, 2019 at 08:54:19AM +0000, Michael Paquier wrote:
> Fix dependency handling of column drop with partitioned tables
>
> When dropping a column on a partitioned table which has one or more
> partitioned indexes, the operation was failing as dependencies with
> partitioned indexes using the column dropped were not getting removed in
> a way consistent with the columns involved across all the relations part
> of an inheritance tree.
>
> This commit refactors the code executing column drop so as all the
> columns from an inheritance tree to remove are gathered first, and
> dropped all at the end. This way, we let the dependency machinery sort
> out by itself the deletion of all the columns with the partitioned
> indexes across a partition tree.

rhinoceros is unhappy with this one in the sepgsql tests as this has
moved a cascading drop notice when droping a column:
ALTER TABLE regtest_table DROP COLUMN y;
LOG: SELinux: allowed { drop }
scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column
name="regtest_schema.regtest_table.y"
ALTER TABLE regtest_ptable DROP COLUMN q CASCADE;
+NOTICE: drop cascades to view regtest_pview
LOG: SELinux: allowed { drop }
scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column
name="regtest_schema.regtest_ptable_ones.q"
LOG: SELinux: allowed { drop }
scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0
tcontext=unconfined_u:object_r:sepgsql_table_t:s0 tclass=db_column
name="regtest_schema.regtest_ptable_tens.q"
-NOTICE: drop cascades to view regtest_pview

It seems to me that it would be fine to just update the output to
the newly-expected behavior. Any opinions?
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-10-13 16:56:53 pgsql: Revert "Hack pg_ctl to report postmaster's exit status."
Previous Message Michael Paquier 2019-10-13 08:54:19 pgsql: Fix dependency handling of column drop with partitioned tables