Re: LOCK TABLE Permissions - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: LOCK TABLE Permissions
Date
Msg-id 20150511133246.GW30322@tamriel.snowman.net
Whole thread Raw
In response to Re: LOCK TABLE Permissions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: LOCK TABLE Permissions  (Michael Paquier <michael.paquier@gmail.com>)
Re: LOCK TABLE Permissions  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
All,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> >     if (lockmode == AccessShareLock)
> >         aclresult = pg_class_aclcheck(reloid, GetUserId(),
> >                                       ACL_SELECT);
> > +   else if (lockmode == RowExclusiveLock)
> > +       aclresult = pg_class_aclcheck(reloid, GetUserId(),
> > +                        ACL_INSERT | ACL_UPDATE | ACL_DELETE | ACL_TRUNCATE);
> >     else
> >         aclresult = pg_class_aclcheck(reloid, GetUserId(),
> >                                       ACL_UPDATE | ACL_DELETE | ACL_TRUNCATE);
>
> Perhaps it would be better to refactor with a local variable for the
> aclmask and just one instance of the pg_class_aclcheck call.  Also, I'm
> pretty sure that the documentation work needed is more extensive
> than the actual patch ;-).  Otherwise, I don't see a problem with this.

Now for a blast from the past...  This came up again on IRC recently and
reminded me that I ran into the same issue a couple years back.  Updated
patch includes the refactoring suggested and includes documentation.

Not going to be back-patched, as discussed with Robert.

Barring objections, I'll push this later today.

    Thanks!

        Stephen

Attachment

pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: EvalPlanQual behaves oddly for FDW queries involving system columns
Next
From: Noah Misch
Date:
Subject: Re: multixacts woes