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 1sPTT7-004noa-Dg for pgsql-committers@arkaria.postgresql.org; Thu, 04 Jul 2024 20:54:17 +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 1sPTT5-002wru-BP for pgsql-committers@arkaria.postgresql.org; Thu, 04 Jul 2024 20:54:16 +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 1sPTT4-002wrm-Kf for pgsql-committers@lists.postgresql.org; Thu, 04 Jul 2024 20:54:15 +0000 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPTT2-000QOo-Je for pgsql-committers@lists.postgresql.org; Thu, 04 Jul 2024 20:54:14 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 402B611401F0; Thu, 4 Jul 2024 16:54:11 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute6.internal (MEProxy); Thu, 04 Jul 2024 16:54:11 -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=1720126451; x=1720212851; bh=Uisgey7HgY XAKfoSZtyyE7of/+oJvf5Bqs3fkw6ObWk=; b=dsMJZCOZMDnCi04TtDC+HB9xIs lsNm73Rf8ustKf2l0V7T34y/2zrFI6GHK4/33j+pO0qnohk+sv+22/A337Thb7Em 4qF/21qgGxAJ2f2+2L+/Bhq2ZZkoP5xtSNhs5B/14CvmrUxOAT97XrfDzv2uV++h 48KVPPbeNUvJ+N7w6pV02XXGVv+oFlJY3hoxVFggNFemfD2/XlyBxv0srZuV+kST dkfSMZnJ8UgiaGsQqHPSY+aU6THT3PHRZlYE7f7o//0T9RniP9oG40Fuhl0RbvGk sg17GlsKgSzHcKsGzxLRKRurW15BQI9pX9PxMi+vc3uV0s8HkeDQa7YfCiDA== 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=1720126451; x=1720212851; bh=Uisgey7HgYXAKfoSZtyyE7of/+oJ vf5Bqs3fkw6ObWk=; b=cs4CaNa4lf4Lm2Dn46ALakKnnZtwqVFTdrFQ2ktVyUCK jv9u8Sgf8af+ryokJhBqXZtPxlDuehTXTqnu5iu4wUp2W4LVCC/g1jWnwfOmBQs9 PQuxG1O3gR1pAtk6loaDK0jGK+1r1olNfb8yQocCfUhZmMYTwwHlyBg+lZppOnuL OjyyVKWc/zrmwoB+HidAg6Jirs+OSB2CtqY49RRE1x8JsmwAJz8UbIJqrdI0o6Gk HEUtnSJcC61yeNJVZ57a0H//2xJOU8T5vLGMTQMzbOltesBwapVfjonNoF4Pgwtp QxgoO+0I+xA5AObiY8dWbFRVl7WX81rjiUmnPHkhXw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudelgdduhedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlvdefmdenucfjughrpefofgggkfgjfhffhffvvefutgesthdtredt reertdenucfhrhhomhepfdflohgvlhculfgrtghosghsohhnfdcuoehjohgvlhestghomh hpihhlvghrrdhorhhgqeenucggtffrrghtthgvrhhnpefhfedugeffvddtteeluefhffek ledtudekhfekkeeileelfffhfedtffejgfejfeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjohgvlhestghomhhpihhlvghrrdhorhhg X-ME-Proxy: Feedback-ID: ic6394509:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E28DD31A0065; Thu, 4 Jul 2024 16:54:10 -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: <3408967.1720107891@sss.pgh.pa.us> References: <3408967.1720107891@sss.pgh.pa.us> Date: Thu, 04 Jul 2024 22:53:49 +0200 From: "Joel Jacobson" To: "Tom Lane" , "Michael Paquier" Cc: pgsql-committers@lists.postgresql.org 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 Thu, Jul 4, 2024, at 17:44, Tom Lane wrote: > Michael Paquier writes: >> Add pg_get_acl() to get the ACL for a database object >> This function returns the ACL for a database object, specified by >> catalog OID and object OID. > > Uh, why is it defined like that rather than allowing a subobject? > This definition is unable to fetch column-specific ACLs. Good point, that's surely an important missing feature, that I hadn't thought about up until now. Probably because all object classes, except columns, don't have subobjects. I wonder if it would be motivated to provide overloads for this function, and perhaps even for pg_get_object_address and pg_identify_object_as_address? That is, two param versions (class OID and object OID), and three param versions that in addition also take subobject ID. Why I think this could be motivated, is since during discussion, some even wanted reg* overloads, to avoid having to pass the class OID. As a middle ground, maybe users would appreciate if they at least didn't have pass in the extra 0, since it's meaningless anyway, most of the times (for all classes except columns)? Anyway, that's just an idea. We still need support for subobject, so I had a look on how to implement it. Unfortunately, the AlterObjectOwner_internal function in alter.c, which pg_get_acl in objectaddress.c is based upon, doesn't deal with subobjects. I found some code in aclchk.c on line 4452-4468 that seems useful, but not sure. Maybe there is some other existing code that is better as an inspiration? I guess we need to handle the RelationRelationId separately, and handle all other classes using the current code in pg_get_acl()? Regards, Joel