Re: Hot to restrict access to subset of data

From: Gregory Youngblood <gsyoungblood(at)mac(dot)com>
To: Andrus <noeetasoftspam(at)online(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Hot to restrict access to subset of data
Date: 2005-07-01 15:13:00
Message-ID: CB2AF562-2A4D-4A9C-BC2A-E55C9029FB56@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I believe you can probably use views to accomplish this.

You create a view that is populated based on their username. Then you
remove access to the actual table, and grant access to the view.

When people look at the table, they will only see the data in the
view and will not have access to the other.

Of course, this assumes they do not need to update the data. I've not
played around with rules to make a view allow updates. I believe it
is possible, I've just not done it yet. This also assumes you have
data somewhere that maps user names to document types.

The postgresql docs should provide the syntax and additional details
if you want to try this. I have also found pgAdmin very useful to
create views and other schema related activities as well.

Hope this helps,
Greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message MargaretGillon 2005-07-01 16:04:27 Re: How to know if a TRANSACTION isn't completed
Previous Message Matt Miller 2005-07-01 15:04:55 Re: Sizes