Re: user-based query white list - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: user-based query white list
Date
Msg-id 493AEB05.2000208@dunslane.net
Whole thread Raw
In response to Re: user-based query white list  (Andrew Chernow <ac@esilo.com>)
List pgsql-hackers

Andrew Chernow wrote:
>
> I don't think view-based security solves my problem.  I need to limit 
> a user to 20 fixed queries, for example.  That means the user cannot 
> execute "SELECT NOW()" or "SELECT 'hello world'".  The user can only 
> execute a pre-defined list of queries.
>

Put your queries in security definer functions and put those in a schema 
that is the only one your user has access to. That should just about do 
the trick, although s/he might still be able to do "select 'foo';"

cheers

andrew


pgsql-hackers by date:

Previous
From: James Mansion
Date:
Subject: Re: Mostly Harmless: Welcoming our C++ friends
Next
From: Bruce Momjian
Date:
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1268)