Re: Some coverage for DROP OWNED BY with pg_default_acl - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Some coverage for DROP OWNED BY with pg_default_acl
Date
Msg-id 20210119204903.GA5891@alvherre.pgsql
Whole thread Raw
In response to Some coverage for DROP OWNED BY with pg_default_acl  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Some coverage for DROP OWNED BY with pg_default_acl
List 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 by date:

Previous
From: Robert Haas
Date:
Subject: Re: [Patch] ALTER SYSTEM READ ONLY
Next
From: Tom Lane
Date:
Subject: Re: [PATCH 1/1] Fix detection of pwritev support for OSX.