On 8/27/14 8:02 AM, Michael Paquier wrote:
> In a couple of code paths we do the following to check permissions on an
> object:
> if (pg_class_aclcheck(relid, userid, ACL_USAGE) != ACLCHECK_OK &&
> pg_class_aclcheck(relid, userid, ACL_UPDATE) != ACLCHECK_OK)
> ereport(ERROR, blah);
>
> Wouldn't it be better to simplify that with a single call of
> pg_class_aclcheck, gathering together the modes that need to be checked?
Yes, it's probably just an oversight.
While looking at this, I wrote a few tests cases for sequence
privileges, because that was not covered at all. That patch is attached.
That led me to discover this issue:
http://www.postgresql.org/message-id/5446B819.1020600@gmx.net
I'll wait for the resolution of that and then commit this.