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 1sQl6f-00BSN7-Qi for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jul 2024 09:56:26 +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 1sQl6e-004O6h-E3 for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jul 2024 09:56:24 +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 1sQl6A-004L8s-SQ for pgsql-hackers@lists.postgresql.org; Mon, 08 Jul 2024 09:55:55 +0000 Received: from fhigh4-smtp.messagingengine.com ([103.168.172.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQl67-0010RM-TJ for pgsql-hackers@lists.postgresql.org; Mon, 08 Jul 2024 09:55:53 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 38CD01140452; Mon, 8 Jul 2024 05:55:50 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute6.internal (MEProxy); Mon, 08 Jul 2024 05:55:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=compiler.org; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1720432550; x=1720518950; bh=lPovsGw0Gh 4D/PVDncMfYGzDWfRS5uKZCEYedXxXPgU=; b=NjRQoeLPEpF1riFdqw5Vba1Pan kOqpMs5byF+xZJX5twKhjOp5wvNMKK11IKQvX9josQ5tLzqnJPC3YVbMxQ5EaoTb uOHA5eudkJqs1mWDCUdLUkoWf7kgvnxLCV+o5Ykyez0IRgbCCcavgDyPXeHtC791 6PrbrfXzmc5wTvJOSRwrwW7ggua4aLn6+f0dVRsL5ZayHbq9Qjq0h0vCVa497foR CUHwfI9HwaMUZ5aZLSYcRc+p1+MNnbTv57OwhA60JqPJ7VbukUAqPHup/7FuwALM sjie1WsKHU3gv5ZEiMgo4dERZBB3+RgnakKCZ48xVnoYWYJQzoM9uQMcyU5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1720432550; x=1720518950; bh=lPovsGw0Gh4D/PVDncMfYGzDWfRS 5uKZCEYedXxXPgU=; b=ekq4ozTgcDPEEQKOQ8D9Ll1wrpFnNHrTK+WmxJhDGh9l Fj4N5iReStmAgWZqd86UA3cSE4Q/mOsZ/jXoENUnapYVDgnGmw6Bl3Wf6Oftuqmj nzcdNMBzXiz2wKPJlZNta98pBTJmwcoKJ4dhNqPN1MLjvrrYrgYTe4sgjfFCPEua uCFE7ffbphQxp5UNzhkTJ3rPKylXZUEBpFj18jxc/rdnAAS1fZkSIuBYZPNVmmzt m/IUrgzbq357A6RVw8lsSg2t6y6YzBkSHoFhR84B9lCsRu5OB7pZuHb8tjpCyTG5 OrKERmqWCHnkoCzL4GGS8s+c+dqvhdPsYzFN341LVQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdejgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdflohgv lhculfgrtghosghsohhnfdcuoehjohgvlhestghomhhpihhlvghrrdhorhhgqeenucggtf frrghtthgvrhhnpefhfedugeffvddtteeluefhffekledtudekhfekkeeileelfffhfedt ffejgfejfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehjohgvlhestghomhhpihhlvghrrdhorhhg X-ME-Proxy: Feedback-ID: ic6394509:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id C86B431A0067; Mon, 8 Jul 2024 05:55:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-566-g3812ddbbc-fm-20240627.001-g3812ddbb MIME-Version: 1.0 Message-Id: In-Reply-To: References: <3408967.1720107891@sss.pgh.pa.us> Date: Mon, 08 Jul 2024 11:55:28 +0200 From: "Joel Jacobson" To: "Michael Paquier" Cc: "Tom Lane" , "Postgres hackers" Subject: Re: pgsql: Add pg_get_acl() to get the ACL for a database object Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 8, 2024, at 10:34, Michael Paquier wrote: > Thanks for the patch. I have been looking at it for a few hours, > eyeing a bit on the ObjectProperty parts a bit if we were to extend it > for sub-object IDs, and did not like the complexity this introduces, > so I'd be OK to live with the extra handling in pg_get_acl() itself. > > + /* ignore dropped columns */ > + if (atttup->attisdropped) > + { > + ReleaseSysCache(tup); > + PG_RETURN_NULL(); > + } > > Hmm. This is an important bit and did not consider it first. That > makes the use of ObjectProperty less flexible because we want to look > at the data in the pg_attribute tuple to be able to return NULL in > this case. > > I've tweaked a bit what you are proposing, simplifying the code and > removing the first batch of queries in the tests as these were less > interesting. How does that look? Thanks, nice simplifications. I agree the tests you removed are not that interesting. Looks good to me. Patch didn't apply to HEAD nor on top of any of the previous commits either, but I couldn't figure out why based on the .rej files, strange. I copy/pasted the parts from the patch to test it. Let me know if you need a rebased version of it, in case you will need to do the same, to save some work. Also noted the below in your last commit: a6417078c414 has introduced as project policy that new features committed during the development cycle should use new OIDs in the [8000,9999] range. 4564f1cebd43 did not respect that rule, so let's renumber pg_get_acl() to use an OID in the correct range. Thanks for the info! Will make sure to use the `src/include/catalog/renumber_oids.pl` tool for future patches. Regards, Joel