Re: Column Privileges: NULL instead of permission denied

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Matthew Hawn <matthewh(at)donaanacounty(dot)org>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Column Privileges: NULL instead of permission denied
Date: 2011-09-19 21:13:38
Message-ID: 20110919211338.GL12765@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Matthew Hawn (matthewh(at)donaanacounty(dot)org) wrote:
> I have a table with privileged data that is restricted using column level
> permissions. I would like to have single query that returns data from the
> table. If the user has permission, it should return the data but return
> NULL if the user does not have permission. I do not want to create
> separate queries in my application for different users.

I think you'll have to build the query in the application to either have
the NULL or not have it. If you try to reference it in the query, PG is
going to give you that permission denied error and I don't think there's
an easy way to change that (and I'm not sure that we'd want to...).

Thanks,

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2011-09-19 21:48:52 Re: Getting TOAST errors
Previous Message Matthew Hawn 2011-09-19 20:39:53 Column Privileges: NULL instead of permission denied