Re: Some coverage for DROP OWNED BY with pg_default_acl

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Some coverage for DROP OWNED BY with pg_default_acl
Дата
Msg-id 20210119204903.GA5891@alvherre.pgsql
обсуждение исходный текст
Ответ на Some coverage for DROP OWNED BY with pg_default_acl  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Some coverage for DROP OWNED BY with pg_default_acl  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 2021-Jan-19, Michael Paquier wrote:

> And while reviewing the thing, I have spotted that there is a specific
> path for pg_default_acl in RemoveRoleFromObjectACL() that has zero
> coverage.  This can be triggered with DROP OWNED BY, and it is
> actually safe to run as long as this is done in a separate transaction
> to avoid any interactions with parallel regression sessions.
> privileges.sql already has similar tests, so I'd like to add some
> coverage as per the attached (the duplicated role name is wanted).

Heh, interesting case.  Added coverage is good, so +1.
Since the role regress_priv_user2 is "private" to the privileges.sql
script, there's no danger of a concurrent test getting the added lines
in trouble AFAICS.

> +SELECT count(*) FROM pg_shdepend
> +  WHERE deptype = 'a' AND
> +        refobjid = 'regress_priv_user2'::regrole AND
> +    classid = 'pg_default_acl'::regclass;
> + count 
> +-------
> +     5
> +(1 row)

Shrug.  Seems sufficient.

-- 
Álvaro Herrera       Valdivia, Chile



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [Patch] ALTER SYSTEM READ ONLY
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH 1/1] Fix detection of pwritev support for OSX.