Suppose i have a view defined like this
create or replace view clients as
select
id, name,
case app_user_type() -- hide column content for everyone except the administrator
when 'administrator' then address
else null
end as address
from data.clients
The purpose is to hide the contents of the address
column in some cases (current_user <> 'administrator'
).
The problem is that the "address" column becomes readonly.
Is there a way to have the same effect (hide the column value) while retaing the updatable property?
Best Answer
I went with something like this
The only downside is that for
employee
roleselect *
will fail, but for my use case, specifying the columns is ok