Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRI7Z-001Bnm-IL for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Aug 2023 20:07:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qRI7W-007cQn-LA for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Aug 2023 20:06:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRI7W-007cQf-Da for pgsql-bugs@lists.postgresql.org; Wed, 02 Aug 2023 20:06:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qRI7T-000Bjk-Lu for pgsql-bugs@lists.postgresql.org; Wed, 02 Aug 2023 20:06:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 372K6lSj3317368; Wed, 2 Aug 2023 16:06:47 -0400 From: Tom Lane To: "Euler Taveira" cc: "Kong Man" , "pgsql-bugs@lists.postgresql.org" Subject: Re: pg_restore 14 skips ACL COLUMN when --schema is used In-reply-to: <90659bbc-e0cb-407d-b42b-5931346735ad@app.fastmail.com> References: <2427882.1690590240@sss.pgh.pa.us> <90659bbc-e0cb-407d-b42b-5931346735ad@app.fastmail.com> Comments: In-reply-to "Euler Taveira" message dated "Wed, 02 Aug 2023 16:30:02 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3317366.1691006807.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Aug 2023 16:06:47 -0400 Message-ID: <3317367.1691006807@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Euler Taveira" writes: > You didn't provide a test case as requested but I investigated this issu= e > according to your description. The following commands is sufficient to p= roduce > the analysis below. Thanks for looking into it! The ingredient I missed while studying this earlier is that the table must have *both* table-level and column-level ACLs to provoke the issue. > It means that an ACL for columns has 2 dependencies (nDeps =3D 2) the fu= nction > _tocEntryRequired() returns 0 (see code below). D'oh. I think this code was correct when written, but we added an extra dependency from column ACL to table ACL later because restoring them in the wrong order causes problems. > The discussion [1] in the commit 0d4e6ed3085 does not explain if the 'if= ' logic > covers all cases. It certainly doesn't for the OP case. The only (hackis= h) > suggestion I have ATM is to detect ACL for columns and returns 1. Yeah, ignoring dependencies on ACLs in this logic seems like the best way forward. Do you want to write a patch? regards, tom lane