From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix dependency handling of column drop with partitioned tables
Date: Sun, 13 Oct 2019 19:13:31 +0900
Message-ID: <20191013101331.GC1434@paquier.xyz> (raw)
In-Reply-To: <E1iJZdr-0005DB-GE@gemulon.postgresql.org>
References: <E1iJZdr-0005DB-GE@gemulon.postgresql.org>
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
Attachments:
[application/pgp-signature] signature.asc (832B, ../20191013101331.GC1434@paquier.xyz/2-signature.asc)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix dependency handling of column drop with partitioned tables
In-Reply-To: <20191013101331.GC1434@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox