On Oct 18, 2011, at 3:31 PM, Aaron Burt wrote:
> select id,
> case has_column_privilege('mytable', 'secure_column', 'SELECT')
> when FALSE then 'NA'
> else secure_column
> end as secure_column
> from mytable where id=12345;
> I get an "ERROR: permission denied for relation mytable" - even though it
> shouldn't be accessing the column if it doesn't have permissions.
> Even if I use a subselect instead of just the column name, it fails.
> But if I use a column that's permitted, no problem.
case when has_column_privilege('mytable', 'secure_column', 'SELECT')
end as secure_column
from mytable where id=12345;
In response to
pdxpug by date
|Next:||From: Aaron Burt||Date: 2011-10-18 23:30:52|
|Subject: Re: CASE eval issue|
|Previous:||From: Aaron Burt||Date: 2011-10-18 22:31:31|
|Subject: CASE eval issue|