Re: has_column_privilege behavior (was Re: Assert failed in snprintf.c)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: Jaime Casanova <jaime.casanova@2ndquadrant.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-10-01T23:31:31Z
Lists: pgsql-hackers
Attachments
- fix-has-foo-privilege-functions-1.patch (text/x-diff) patch
Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Having said that, I'm fine with having it return NULL if the given
>> attname matches an attisdropped column.
> Ok, that's really all I was asking about.
Ah, we were just talking past each other then :-(. That behavior existed
already, it wasn't something my draft patch introduced, so I was confused
what you were talking about.
>> ... What I was on about is what
>> happens when you write
>> has_column_privilege('sometab'::regclass, 'somecol', 'SELECT');
>> and sometab exists but somecol doesn't.
> Yeah, having that throw an error seems reasonable to me.
OK, so here's a patch that I think does the right things.
I noticed that has_foreign_data_wrapper_privilege() and some other
recently-added members of the has_foo_privilege family had not gotten
the word about not failing on bogus OIDs, so I also fixed those.
regards, tom lane
Commits
-
Fix corner-case failures in has_foo_privilege() family of functions.
- fd81fae67fa0 9.4.20 landed
- dad4df0fc8a1 9.5.15 landed
- 01c7a87df98c 9.3.25 landed
- 7eed72333731 10.6 landed
- 6d73983be61a 9.6.11 landed
- 419cc8add5fb 11.0 landed
- 3d0f68dd3061 12.0 landed