Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iJayV-0001OJ-FI for pgsql-committers@arkaria.postgresql.org; Sun, 13 Oct 2019 10:19:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iJauv-00005S-74 for pgsql-committers@arkaria.postgresql.org; Sun, 13 Oct 2019 10:16:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iJat5-0008VW-PX for pgsql-committers@lists.postgresql.org; Sun, 13 Oct 2019 10:14:09 +0000 Received: from [64.147.123.24] (helo=wout1-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iJasx-0003f0-AU for pgsql-committers@lists.postgresql.org; Sun, 13 Oct 2019 10:14:06 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id DD42D2C3 for ; Sun, 13 Oct 2019 06:13:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 13 Oct 2019 06:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=2UuUpMnVCckkiwYJa8UmkceWSyv Zz5LHsAkRYBj9Oq4=; b=CzQpEaidfGftyuK1HXpoy327AGMykU35eisTIO1BPo8 I8xe4B1BMffYqlitPf+bBlwjr5EdFGGSWyToHWHVUl4GR4B0VlTz1uNU1eygx2Hk HQzECzrAHLWtCAlTzswulya+9T5JRRwEH38hw7XS02NWCI+0okt1M08D2g3lCGRu wMIgP8ndxztdbd57IrrPs66ojiFHLz3s3EfLL8uhuSuWN3vfzGy1dQZCt7mMazU3 ypiswgn3Ne+Boy8K94hrCvOKaBjkBocjEK4thhAhwg//iWBEyBCTphr6DJE6t0PZ onGyM2R1VfK5Mbtp7+DruuycvbYgGnYNsAZEdRMgAgw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=2UuUpM nVCckkiwYJa8UmkceWSyvZz5LHsAkRYBj9Oq4=; b=sd3F1u4+25vupWwojibCEs tbDTNS0E1qi1dPVudVb40bCBeygozAMhcWwQo2SjtWEGWOuv+ydQKJSg/cpoJIJ7 D1v1XUASJoNxtxzwX+ardCgCwQNK+sKceZRtEPidFUQw7v6SNYWB9iFRHb3TK4Sb 0OKcTHLIBJgWpGESMY/quuumYmhGI6SVM5fZEojSkYofvqT3BRkK/VHf55D/MtuI PpIHgZFzwoQ69nVr3Iw8ZTNFsGHtSkJuAKKwoavZdf2rAxiK/4AIc8kOxXN5xrwN XpCYBvihqoSS3PmqDB6zo3DGydjGxZIza7AXVPzv5evtMVcQesC4tXpERswJEKmw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrieelgddvhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvf fukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhi vghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecukfhppeduuddurdduvd ehrdegtddrudeltdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgr qhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (g111125040190.d057.icnet.ne.jp [111.125.40.190]) by mail.messagingengine.com (Postfix) with ESMTPA id D4CDE80059 for ; Sun, 13 Oct 2019 06:13:34 -0400 (EDT) Date: Sun, 13 Oct 2019 19:13:31 +0900 From: Michael Paquier To: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix dependency handling of column drop with partitioned tables Message-ID: <20191013101331.GC1434@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oTHb8nViIGeoXxdp" Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.24 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --oTHb8nViIGeoXxdp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 13, 2019 at 08:54:19AM +0000, Michael Paquier wrote: > Fix dependency handling of column drop with partitioned tables >=20 > 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. >=20 > 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=3Dunconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=3Dunconfined_u:object_r:sepgsql_table_t:s0 tclass=3Ddb_column name=3D"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=3Dunconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=3Dunconfined_u:object_r:sepgsql_table_t:s0 tclass=3Ddb_column name=3D"regtest_schema.regtest_ptable_ones.q" LOG: SELinux: allowed { drop } scontext=3Dunconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=3Dunconfined_u:object_r:sepgsql_table_t:s0 tclass=3Ddb_column name=3D"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 --oTHb8nViIGeoXxdp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl2i+MsACgkQnvQgOdby QH3OFxAAinBBI1B5udFxN3LWgPupj1S2zCPTHnezRfAL3uLGVXdGbb81HcDrbKNv z1rwfek+lkY42hT9jb0e6MMcLcVHeM8tQGzlmDu9Jtb5lDQOM+Dss/QvmFmiB/uT yPCYrvonq80QOq8d3G9quSXbQXkiThzIc/td1GQg1B1Jmizjbu07vPPew8lVGPsi 3V+xpGkEOoQew7YWCt/scRJ8dP85wiuGHzeT9t8SNEdpirVsU2OzpUd38TTW4iFA Labn+JWE2gRUn8IqVZF+mRmpKxWBhbYUka56fFOtkDmdSws2ISZqAOM46DX17K2A zCsIpuRWQNwO69x6f2B2XODZPSaGb4TCTeiCXAaKBpdpA29QO1InmVNr0gGQzhHC 38jbhn5UxoTsUVKnx5YO24W/KbCkOzaAZwhRQHAHamsrlzzFoywoVesCUfRPjtM0 BshhUBOR2d8EnWZfLdJMx3G/tlA9MDuMv1hjJt8O+NK+IvbPubE/U4JXC+kFBNJq 4JOoeaVj/3b2+CGeVs89azcvBtBrp2JmhoNdPnef9VYOSiVXCQM3qdaGFi++hv6d GqmyQxZ2KpqxMms3DupzTQmcensa+moxaW4CvuJ7tG+5+t03j4YZ0N7/Z+UfahwQ EvWIeY5Suyt5XDC37MGnGoBCaWVpHxx5BcUwUFtJOZ5Eb0OeQLk= =Zk0r -----END PGP SIGNATURE----- --oTHb8nViIGeoXxdp--