Re: User permissions - Mailing list pgsql-general

From Stephan Szabo
Subject Re: User permissions
Date
Msg-id 20020312085435.P64813-100000@megazone23.bigpanda.com
Whole thread Raw
In response to User permissions  ("Lars Preben S. Arnesen" <l.p.arnesen@usit.uio.no>)
Responses Re: User permissions
List pgsql-general
On 12 Mar 2002, Lars Preben S. Arnesen wrote:

> I'm writing a web application to access a Postgres database. I want
> the application to use a user with limited permissions - it should
> only be able to execute predefined functions in the database.
>
> I have been searching for the Postgres-way of doing this, but I din't
> find any solution.
>
> I have designed functions with pl/pgsql which do alter, insert, select
> and delete in the database, but I don't want the database user to be
> able to perform these actions without using the predefined functions.
>
> How can I do this?

Well, I'm not sure you can using only pl/pgsql, but if you don't grant
access to any of the tables, I know that in C you can have functions run
queries as a different user.  However I'm not sure how well that'll
work for things that you want to return result sets (you could make
temp tables that the user has access to for that I guess)



pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: cannot initdb
Next
From: "Lance Ellinghaus"
Date:
Subject: Exclusive Row access???