Re: pgsql: Add pg_get_acl() to get the ACL for a database object

2024-07-09 Thread Michael Paquier
On Mon, Jul 08, 2024 at 11:55:28AM +0200, Joel Jacobson wrote: > Thanks, nice simplifications. > I agree the tests you removed are not that interesting. > > Looks good to me. On second review, I have spotted a use-after-free for the case of an attribute ACL in both v1 and v2, as we would finish b

Re: pgsql: Add pg_get_acl() to get the ACL for a database object

2024-07-08 Thread Michael Paquier
On Mon, Jul 08, 2024 at 11:55:28AM +0200, Joel Jacobson wrote: > 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 ve

Re: pgsql: Add pg_get_acl() to get the ACL for a database object

2024-07-08 Thread Joel Jacobson
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 e

Re: pgsql: Add pg_get_acl() to get the ACL for a database object

2024-07-08 Thread Michael Paquier
On Fri, Jul 05, 2024 at 10:40:39AM +0200, Joel Jacobson wrote: > OK, I made an attempt to implement this, based on adapting code from > recordExtObjInitPriv() in aclchk.c, which retrieves ACL based on ATTNUM. > > There are now two different code paths for columns and non-columns. > > It sounds li

Re: pgsql: Add pg_get_acl() to get the ACL for a database object

2024-07-05 Thread Joel Jacobson
On Fri, Jul 5, 2024, at 01:18, Michael Paquier wrote: > I would still stick to only one function, with arguments coming from > scanning pg_[sh]depend. > >> 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 >> a

Re: pgsql: Add pg_get_acl() to get the ACL for a database object

2024-07-04 Thread Michael Paquier
(Moving to -hackers) On Thu, Jul 04, 2024 at 10:53:49PM +0200, Joel Jacobson wrote: > On Thu, Jul 4, 2024, at 17:44, Tom Lane wrote: >> Uh, why is it defined like that rather than allowing a subobject? >> This definition is unable to fetch column-specific ACLs. Yes, I was wondering about that as