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

2024-07-04 Thread Michael Paquier
On Tue, Jul 02, 2024 at 12:38:07PM +0200, Joel Jacobson wrote: > Rebased version. > Uses ACL acronym added in commit 00d819d46a6f5b7e9d2e02948a1c80d11c4ce260: > doc: Add ACL acronym for "Access Control List" Forgot to push the send button for this one yesterday, done now.. While looking at th

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

2024-07-02 Thread Joel Jacobson
On Tue, Jun 25, 2024, at 09:13, Joel Jacobson wrote: > Attachments: > * v8-0001-Add-pg_get_acl.patch Rebased version. Uses ACL acronym added in commit 00d819d46a6f5b7e9d2e02948a1c80d11c4ce260: doc: Add ACL acronym for "Access Control List" /Joel v9-0001-Add-pg_get_acl.patch Description: Bina

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

2024-06-25 Thread Joel Jacobson
On Tue, Jun 25, 2024, at 08:42, Michael Paquier wrote: > On Tue, Jun 25, 2024 at 08:06:41AM +0200, Joel Jacobson wrote: >> Not sure if I see how to implement it for pg_get_acl() though. >> >> I've had a look at how pg_describe_object() works for this case: >> >> SELECT pg_describe_object(0,'t'::r

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

2024-06-24 Thread Michael Paquier
On Tue, Jun 25, 2024 at 08:06:41AM +0200, Joel Jacobson wrote: > Not sure if I see how to implement it for pg_get_acl() though. > > I've had a look at how pg_describe_object() works for this case: > > SELECT pg_describe_object(0,'t'::regclass::oid,0); > ERROR: unsupported object class: 0 > > I

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

2024-06-24 Thread Joel Jacobson
On Tue, Jun 25, 2024, at 03:57, Michael Paquier wrote: > On Tue, Jun 25, 2024 at 01:21:14AM +0200, Joel Jacobson wrote: >> Good idea, I've started a separate thread for this: >> >> https://postgr.es/m/9253b872-dbb1-42a6-a79e-b1e96effc857%40app.fastmail.com >> >> This patch now assumes ACL will be

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

2024-06-24 Thread Michael Paquier
On Tue, Jun 25, 2024 at 01:21:14AM +0200, Joel Jacobson wrote: > Good idea, I've started a separate thread for this: > > https://postgr.es/m/9253b872-dbb1-42a6-a79e-b1e96effc857%40app.fastmail.com > > This patch now assumes ACL will be supported. Thanks for doing that! That helps in making revi

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

2024-06-24 Thread Joel Jacobson
On Mon, Jun 24, 2024, at 01:46, Michael Paquier wrote: > Rather unrelated to this patch, still this patch makes the situation > more complicated in the docs, but wouldn't it be better to add ACL as > a term in acronyms.sql, and reuse it here? It would be a doc-only > patch that applies on top of t

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

2024-06-23 Thread Michael Paquier
On Sun, Jun 23, 2024 at 08:48:46AM +0200, Joel Jacobson wrote: > On Sat, Jun 22, 2024, at 11:44, Joel Jacobson wrote: >> * v5-0001-Add-pg_get_acl.patch >> * v2-0002-Add-pg_get_acl-overloads.patch > > Rename files to ensure cfbot applies them in order; both need to > have same version prefix. +

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

2024-06-22 Thread Joel Jacobson
On Sat, Jun 22, 2024, at 11:44, Joel Jacobson wrote: > * v5-0001-Add-pg_get_acl.patch > * v2-0002-Add-pg_get_acl-overloads.patch Rename files to ensure cfbot applies them in order; both need to have same version prefix. v6-0001-Add-pg_get_acl.patch Description: Binary data v6-0002-Add-pg_get

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

2024-06-22 Thread Joel Jacobson
On Sat, Jun 22, 2024, at 02:54, Joel Jacobson wrote: > Attachments: > * v4-0001-Add-pg_get_acl.patch > * 0002-Add-pg_get_acl-overloads.patch Rebase and reduced diff for src/test/regress/sql/privileges.sql between patches. /Joel v5-0001-Add-pg_get_acl.patch Description: Binary data v2-0002-Add-

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

2024-06-21 Thread Joel Jacobson
On Fri, Jun 21, 2024, at 05:25, Michael Paquier wrote: > Interesting idea. > > I am not really convinced that the regproc and regclass overloads are > really necessary, considering the fact that one of the goals > mentioned, as far as I understand, is to be able to get an idea of the > ACLs associa

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

2024-06-20 Thread Isaac Morland
On Thu, 20 Jun 2024 at 23:44, Tom Lane wrote: > Michael Paquier writes: > > On Thu, Jun 20, 2024 at 08:32:57AM +0200, Joel Jacobson wrote: > >> I've added overloaded versions for regclass and regproc so far: > >> > >> \df pg_get_acl > >> List of functions > >> Schema |Name| Result data

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

2024-06-20 Thread Isaac Morland
On Thu, 20 Jun 2024 at 02:33, Joel Jacobson wrote: > On Wed, Jun 19, 2024, at 16:23, Isaac Morland wrote: > > I have no idea how often this would be useful, but I wonder if it could > > work to have overloaded single-parameter versions for each of > > regprocedure (pg_proc.proacl), regclass (pg_c

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

2024-06-20 Thread Tom Lane
Michael Paquier writes: > On Thu, Jun 20, 2024 at 08:32:57AM +0200, Joel Jacobson wrote: >> I've added overloaded versions for regclass and regproc so far: >> >> \df pg_get_acl >> List of functions >> Schema |Name| Result data type | Argument data types | Type >> +---

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

2024-06-20 Thread Michael Paquier
On Thu, Jun 20, 2024 at 08:32:57AM +0200, Joel Jacobson wrote: > I've added overloaded versions for regclass and regproc so far: > > \df pg_get_acl > List of functions >Schema |Name| Result data type | Argument data types | Type > +

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

2024-06-19 Thread Joel Jacobson
On Wed, Jun 19, 2024, at 16:23, Isaac Morland wrote: > I have no idea how often this would be useful, but I wonder if it could > work to have overloaded single-parameter versions for each of > regprocedure (pg_proc.proacl), regclass (pg_class.relacl), …. To call, > just cast the OID to the appro

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

2024-06-19 Thread Isaac Morland
On Wed, 19 Jun 2024 at 07:35, Joel Jacobson wrote: > Hello hackers, > > Currently, obtaining the Access Control List (ACL) for a database object > requires querying specific pg_catalog tables directly, where the user > needs to know the name of the ACL column for the object. > I have no idea how

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

2024-06-19 Thread Joel Jacobson
On Wed, Jun 19, 2024, at 15:51, Ranier Vilela wrote: > Regarding the patch, could it be written in the following style? Thanks for nice improvement. New version attached. Best, Joel v2-0001-Add-pg_get_acl.patch Description: Binary data

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

2024-06-19 Thread Ranier Vilela
Em qua., 19 de jun. de 2024 às 10:28, Ranier Vilela escreveu: > Em qua., 19 de jun. de 2024 às 10:26, Joel Jacobson > escreveu: > >> Hi Ranier, >> >> Thanks for looking at this. >> >> I've double-checked the patch I sent, and it works fine. >> >> I think I know the cause of your problem: >> >> S

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

2024-06-19 Thread Ranier Vilela
Em qua., 19 de jun. de 2024 às 10:26, Joel Jacobson escreveu: > Hi Ranier, > > Thanks for looking at this. > > I've double-checked the patch I sent, and it works fine. > > I think I know the cause of your problem: > > Since this is a catalog change, you need to run `make clean`, to ensure > the c

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

2024-06-19 Thread Joel Jacobson
Hi Ranier, Thanks for looking at this. I've double-checked the patch I sent, and it works fine. I think I know the cause of your problem: Since this is a catalog change, you need to run `make clean`, to ensure the catalog is rebuilt, followed by the usual `make && make install`. You also need

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

2024-06-19 Thread Ranier Vilela
Em qua., 19 de jun. de 2024 às 08:35, Joel Jacobson escreveu: > Hello hackers, > > Currently, obtaining the Access Control List (ACL) for a database object > requires querying specific pg_catalog tables directly, where the user > needs to know the name of the ACL column for the object. > > Consid

Add pg_get_acl() function get the ACL for a database object

2024-06-19 Thread Joel Jacobson
Hello hackers, Currently, obtaining the Access Control List (ACL) for a database object requires querying specific pg_catalog tables directly, where the user needs to know the name of the ACL column for the object. Consider: ``` CREATE USER test_user; CREATE USER test_owner; CREATE SCHEMA test_s