Re: [HACKERS] replace GrantObjectType with ObjectType

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] replace GrantObjectType with ObjectType
Date: 2018-01-16 21:18:29
Message-ID: 70b4f5a3-c28a-ca2e-e719-246f1e43806b@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/28/17 14:22, Stephen Frost wrote:
> Yes, documenting it, at least, is necessary if we're going to go with
> this approach, though I wonder if that will end up making it difficult
> to remove it later if someone gets around to reworking the GRANT system
> to directly deal with this ambiguity without needing a special-case in
> the object address system for it. I guess one question coming out of
> this is- do you see another use for this OBJECT_RELATION object type..?
> If it's really only this one special case in GRANT that needs it then I
> think that makes it much less appealing to have.

So I was looking into how we can do it without OBJECT_RELATION. For the
first patch, that was obviously easy, because that's what my initial
proposal did. We just treat OBJECT_TABLE within the context of
GRANT/REVOKE as "might also be another kind of relation".

The second class replaced ACL_KIND_CLASS with OBJECT_RELATION in the
context of aclcheck_error(), so that was harder to unwind. But I wrote
some additional code that resolves the actual relkind and gives a more
precise error message, e.g., about "view" or "index" instead of just
"relation". So overall this is a net win, I think.

Attached is an updated patch set. It's a bit messy because I first want
to get confirmation on the approach we are choosing, and then I can
smash them together in the right way. 0001 and 0002 are the original
patches, and then 0003, 0004, 0005 undo the OBJECT_RELATION addition and
replace them with new facilities.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v4-0001-Replace-GrantObjectType-with-ObjectType.patch text/plain 52.4 KB
v4-0002-Replace-AclObjectKind-with-ObjectType.patch text/plain 119.5 KB
v4-0003-Don-t-use-OBJECT_RELATION-with-aclcheck_error.patch text/plain 51.1 KB
v4-0004-Use-OBJECT_TABLE-instead-of-OBJECT_RELATION-for-A.patch text/plain 11.2 KB
v4-0005-Get-more-precise-return-values-from-get_object_ty.patch text/plain 6.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-01-16 21:30:46 Re: WIP Patch: Precalculate stable functions, infrastructure v1
Previous Message Robert Haas 2018-01-16 20:32:35 Re: TOAST table created for partitioned tables