Re: how to list privileges on the database object itself via SQL?

From: richard coleman <rcoleman(dot)ascentgl(at)gmail(dot)com>
To: Holger Jakobs <holger(at)jakobs(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: how to list privileges on the database object itself via SQL?
Date: 2023-04-26 18:00:19
Message-ID: CAGA3vBt8HeWN+7jpAHv8sMBHSR1Hv3eADW+hTGtwZ3=bwTzjZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Holger,

Thanks, I managed to get the code to work across versions myself.

Unfortunately that doesn't rectify the situation which is that the only
place I've seen so far to get access to that information is in an array of
values in the datacl column in the pg_catalog.pg_database table by database.

rik.

On Wed, Apr 26, 2023 at 1:55 PM Holger Jakobs <holger(at)jakobs(dot)com> wrote:

> Am 26.04.23 um 19:53 schrieb richard coleman:
>
> Erik,
>
> Thanks for that. I'll have to look into the aclexplode() function some
> more.
>
> When I try running your SQL on a pg11 database I get:
>
> ERROR: role "role" does not exist
> LINE 3: WHERE grantee = 'role'::regrole AND privilege_type I...
> ^
> SQL state: 42704
> Character: 151
>
> rik.
>
> If you want to use the SQL statements used by psql on older versions of
> PostgreSQL, you should use the old version of psql.
>
>
>>
>> --
> Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2023-04-26 18:05:01 Re: how to list privileges on the database object itself via SQL?
Previous Message richard coleman 2023-04-26 17:57:22 Re: how to list privileges on the database object itself via SQL?