Re: LOCK TABLE Permissions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: LOCK TABLE Permissions
Date: 2013-07-19 16:33:02
Message-ID: 8307.1374251582@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2013-07-19 16:39:17 Re: Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls
Previous Message Alvaro Herrera 2013-07-19 16:29:33 Re: getting rid of SnapshotNow