Re: has_column_privilege behavior (was Re: Assert failed in snprintf.c)
Joe Conway <mail@joeconway.com>
From: Joe Conway <mail@joeconway.com>
To: Stephen Frost <sfrost@snowman.net>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jaime Casanova <jaime.casanova@2ndquadrant.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-10-01T19:00:42Z
Lists: pgsql-hackers
On 10/01/2018 02:41 PM, Stephen Frost wrote: > Tom Lane (tgl@sss.pgh.pa.us) wrote: >> But it's not quite clear to me what we want the behavior for bad column >> name to be. A case could be made for either of: >> >> * If either the table OID is bad, or the OID is OK but there's no such >> column, return null. >> >> * Return null for bad OID, but if it's OK, continue to throw error >> for bad column name. >> >> The second case seems weirdly inconsistent, but it might actually >> be the most useful definition. Not detecting a misspelled column >> name is likely to draw complaints. Seems you could make the same argument for not detecting a misspelled table name for this and has_table_privilege... > My inclination would be to make the function return NULL in any case > where we can't find what the user is asking for (and to not throw an > error in general). +1 Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development
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