Re: Controlling write access to a table - Mailing list pgsql-general

From Craig Ringer
Subject Re: Controlling write access to a table
Date
Msg-id 4858D748.2090309@postnewspapers.com.au
Whole thread Raw
In response to Controlling write access to a table  ("Dave Coventry" <dgcoventry@gmail.com>)
List pgsql-general
Dave Coventry wrote:
> Hi.
>
> I have a database with all of the particulars of our students and I am
> adding a table that will contain all of the courses and the grades
> attained by the students.

[snip]

> The marks (or grades) of the students are a different matter and we
> want to restrict changes to this data to a very few people.
>
> I'm presuming that this is not a unique problem, but I have been
> unable to find anything helpful on google.

If your different classes of users log in with different usernames and
passwords to the database, then you can do this rather simply with roles
and table priveleges. See the GRANT and REVOKE statements.

http://www.postgresql.org/docs/current/static/sql-grant.html
http://www.postgresql.org/docs/current/static/sql-revoke.html

and ROLE management:

http://www.postgresql.org/docs/current/static/sql-createrole.html

If your users all log in with the same username and password via some
kind of web app, persistence layer, or whatever, then you will have to
write the access control yourself at the application level.

--
Craig Ringer

pgsql-general by date:

Previous
From: David
Date:
Subject: Re: Controlling write access to a table
Next
From: "Albe Laurenz"
Date:
Subject: Re: problem with to_ascii() function in version 8.3.3