Re: Restoring default privileges on objects

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: Restoring default privileges on objects
Дата
Msg-id 1166048641.281962.1693308151542@office.mailbox.org
обсуждение исходный текст
Ответ на Restoring default privileges on objects  (Stuart McGraw <smcgraw@mtneva.com>)
Ответы Re: Restoring default privileges on objects
Список pgsql-general
> On 29/08/2023 03:23 CEST Stuart McGraw <smcgraw@mtneva.com> wrote:
>
> If I've done a GRANT or REVOKE on some of the tables, how do I restore
> the default privileges so that the “Access privileges” appears empty
> again?  I re-granted what I think are the default privileges but the
> "Access privileges" column for that table contains "user1=arwdDxt/user1"
> rather than being blank.  This is Postgresql-14.

Yes, "user1=arwdDxt/user1" matches the default privileges if user1 is the table
owner.  Function acldefault('r', 'user1'::regrole) [1] gives you the default
privileges for tables.

You could set pg_class.relacl to NULL to restore the default privileges, but
messing with pg_catalog is at your own risk.  Besides that I don't know of any
way to restore the default privileges other than revoking all privileges before
granting whatever acldefault gives you.  Changing the table owner will then
also change the grantee and grantor in pg_class.relacl to the new owner.

[1] https://www.postgresql.org/docs/14/functions-info.html#FUNCTIONS-ACLITEM-FN-TABLE

--
Erik



В списке pgsql-general по дате отправления:

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: PL/Perl function signatures
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Restoring default privileges on objects