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 1iWXRc-00073K-O0 for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Nov 2019 03:11:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iWXRb-0008Ph-Fy for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Nov 2019 03:11:15 +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 1iWXRZ-0008Pa-QS for pgsql-bugs@lists.postgresql.org; Mon, 18 Nov 2019 03:11:15 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iWXRV-0000UM-Bm for pgsql-bugs@lists.postgresql.org; Mon, 18 Nov 2019 03:11:13 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 77E1359F; Sun, 17 Nov 2019 22:11:05 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 17 Nov 2019 22:11:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=9K1DX2tFIIoaOqq1uNen6AGEALk RHJW70vGqkY6VOwQ=; b=Z3F+luvuMERSBi4SCLGIGwGCCiI7XXH5WSzIbsAu7bs /pxOMfAu2CiBPK7y5TbQbehHVnxqrBQcjMZP51cpjPnxmcPCEcLguUlG9rtVtgys rI0erq4DBXS2Is4THDIxugwOe8wfseNfzXb6p4FHQghgBq1kTzJa1wMD9xDt38ZP ETRHe9IvZoNCpr1L2BR2aatKm6gaST+v7mCCsVHGelNddTChGqrsuMHQCCwuDhPC 3ItuzmaEgV6IPr/1zCQ6QRJiBfdXrdSRv7F3fJRshEY8eMySoWqxHidQ9Vd46n3V mn5GKNDnIc4aYMq8TX9wn9lX2geZavHZF468fL56HEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=9K1DX2 tFIIoaOqq1uNen6AGEALkRHJW70vGqkY6VOwQ=; b=BWJu8mspTU58sVYMj1owb9 UDqdpt1GfQANpXF3c7OTTq4xenTLlM/5iVsEhyKL3zgUtYysyjvRoJcWITQXjbgK Se0ieOx8bCrZNTNlff8SQbLg9a3ScSV8EaoIF88Bd2gNmNUQ66hJmUPuGt/jVutM u+CUqYdHZ4WbGvT3hDDNSxCwTq0gDkx3fw5FfMlJMLE4hJYGMy7JCmqBiQe8vyX2 wvuGFcVvRoYxxkXFIFnhkQa+HT1KBV8DoN65d0XzeiBHvr1FYBZvv8aZa5y++aVy K90t4GWFq4BPIGEeLKTneXdtkPrmCNoS2zs06zZYEOnHeqcdTrZCy+M9pVSEv/rw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeggedgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepudduuddruddtvddrudektddrudekheenucfrrghr rghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id A806C306005F; Sun, 17 Nov 2019 22:11:02 -0500 (EST) Date: Mon, 18 Nov 2019 12:10:59 +0900 From: Michael Paquier To: Floris Van Nee Cc: Tom Lane , "pgsql-bugs@lists.postgresql.org" , Ferdi Smit , Stephen Frost Subject: Re: incorrect pg_dump output due to not handling dropped roles correctly Message-ID: <20191118031059.GA1543@paquier.xyz> References: <1573808483712.96817@Optiver.com> <29913.1573835973@sss.pgh.pa.us> <1574024173786.96623@Optiver.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline In-Reply-To: <1574024173786.96623@Optiver.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Nov 17, 2019 at 08:56:13PM +0000, Floris Van Nee wrote: > As for the proper fix, indeed it looks like the 'drop role' needs to > be taught to update pg_init_privs. The dependencies related to the ACL entries exist in pg_shdepend between the role and the revoked objects, and these get removed when issuing DROP OWNED BY. So it seems to me that the cleanup needs to happen when issuing the DROP OWNED BY query, and not DROP ROLE. Looking at the code, it seems to me that we should just patch shdepDropOwned() to handle properly the removal of the role in ACL objects in pg_init_privs for all the objects we are removing a dependency on. I am just diving into a patch.. -- Michael --IJpNTDwzlM2Ie8A6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3SC8MACgkQnvQgOdby QH1o0A/8D28CqckclpyFRoEGVfBbO3Yjbh8p6/s944dOZRwTKSla6XFSLM61z1Jh nKodvk24j/m1IyD2lBZLCDhKGq+HbAdq9qv5A7jhNBfX1xLo5MDuLq/wsfRUpYiC f26Q4rz4e+WEJTUC0g/55IQ5+ucseYSfhZVWvCpR61kpHGC+u+RmNmhj/cYLYWQ6 5nAXu3ltxFGCEQgDOtTX2gx/Uqv0J++whx/Noany+/oALYqkyq1Flhke2+po0LSS 4PW4hNtgM6TWk8lzf7EliaRIspgJlWYU7Brxzo1U2s9pqi/poGCcvbfVW8kMXedx BKU5Uh0XGzm1E9ITnKg65z27U7a87xTWbvFoHv+bJt3Hkn5PfHWNMIFKzwfprKSF WA2fbNcf5gwuVoQzhsQhSoZXs4dVIcoo2A1cuf7lznvnYQbiJR80ek6twuo6Zyol 6lb0dkZjLaURVkPiy/bawrh3aymFtJhPGm6oc4y5u9buef11tAA8gHYZXOLQZSp9 o3ZUK55gTedidwL1FltWHXn5x1FC6uDmR74OuuY84KZ0vUFjuuwAK0NOoADKFwoG SKV4s0gyLWZ1BMK/UkS3bUtZW1Cgx08V/4NnTYrpGQ7S+abSzOU9Y3/5Al+sXEck 1HiYb6owrO9UDB+sqQAdmLaaviG45oxZtS5UTVU3BVZBJqJfsdA= =KS/n -----END PGP SIGNATURE----- --IJpNTDwzlM2Ie8A6--