Re: has_column_privilege behavior (was Re: Assert failed in snprintf.c)

From: Joe Conway <mail(at)joeconway(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: has_column_privilege behavior (was Re: Assert failed in snprintf.c)
Date: 2018-10-01 19:00:42
Message-ID: 9c8e52fd-c866-8584-4ac9-dc18ded52434@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/01/2018 02:41 PM, Stephen Frost wrote:
> Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-10-01 19:04:22 Re: executor relation handling
Previous Message Tom Lane 2018-10-01 18:57:54 Re: has_column_privilege behavior (was Re: Assert failed in snprintf.c)