Re: Add pg_ownerships and pg_privileges system views

2024-12-16 Thread Joel Jacobson
Hi hackers, As noted in previous feedback, relying on pg_shdepend leads to a less-than-ideal behavior: no privileges are displayed for an object until at least one privilege is granted to a role other than the owner, as explained by Alvaro: On Sun, Oct 20, 2024, at 12:14, Alvaro Herrera wrote: >

Re: Add pg_ownerships and pg_privileges system views

2024-10-21 Thread Joel Jacobson
On Mon, Oct 21, 2024, at 11:42, Alvaro Herrera wrote: > ... actually, the "AND pg_shdepend.dbid = ( SELECT pg_database_1.oid > ...)" part of this is useless, because you already had that in the ON > condition of the original join to pg_database. So, apologies for the > noise there. TBH I don't se

Re: Add pg_ownerships and pg_privileges system views

2024-10-21 Thread Alvaro Herrera
On 2024-Oct-20, Alvaro Herrera wrote: > SELECT > pg_shdepend.classid, > pg_shdepend.objid, > pg_shdepend.objsubid, > identify.*, > aclexplode.* > FROM pg_catalog.pg_shdepend > JOIN pg_catalog.pg_database ON pg_data

Re: Add pg_ownerships and pg_privileges system views

2024-10-20 Thread Joel Jacobson
On Sun, Oct 20, 2024, at 23:03, Joel Jacobson wrote: > On Sun, Oct 20, 2024, at 16:52, Joel Jacobson wrote: >> On Sun, Oct 20, 2024, at 12:14, Alvaro Herrera wrote: >>> I think the function calls should be in the FROM clause, and restrict the >>> pg_shdepend rows to only the ones in the current dat

Re: Add pg_ownerships and pg_privileges system views

2024-10-20 Thread Joel Jacobson
On Sun, Oct 20, 2024, at 16:52, Joel Jacobson wrote: > On Sun, Oct 20, 2024, at 12:14, Alvaro Herrera wrote: >> I think the function calls should be in the FROM clause, and restrict the >> pg_shdepend rows to only the ones in the current database: > > Cool. I assume pg_ownerships should be changed

Re: Add pg_ownerships and pg_privileges system views

2024-10-20 Thread Joel Jacobson
On Sun, Oct 20, 2024, at 12:14, Alvaro Herrera wrote: > I think the function calls should be in the FROM clause, and restrict the > pg_shdepend rows to only the ones in the current database: Cool. I assume pg_ownerships should be changed in the same way? New patch attached. > Now, depending on pg

Re: Add pg_ownerships and pg_privileges system views

2024-10-20 Thread Alvaro Herrera
Hello, On 2024-Oct-20, Joel Jacobson wrote: > Here is an attempt to revive this patch from 2021-2022, that has been ready > now > for a while, thanks to pg_get_acl() function that was committed in > 4564f1c and d898665. Nice. I think the function calls should be in the FROM clause, and restric

Add pg_ownerships and pg_privileges system views

2024-10-19 Thread Joel Jacobson
rg/50/5033/ --- Add pg_ownerships and pg_privileges system views. These new views provide a more accessible and user-friendly way to retrieve information about object ownerships and privileges. The view pg_ownerships provides access to information about object ownerships. The view pg_privi