Re: Limit on number of users in postgresql?

From: Ron Peterson <ron(dot)peterson(at)yellowbank(dot)com>
To: Bill Moran <wmoran(at)collaborativefusion(dot)com>
Cc: Furface <furface(at)omnicode(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Limit on number of users in postgresql?
Date: 2007-01-28 23:39:07
Message-ID: 20070128233907.GA26983@yellowbank.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 28, 2007 at 01:21:09PM -0500, Bill Moran wrote:

> The only thing that's missing is row-level granularity. There's at least
> one project out there supporting that, and you can also simulate it with
> clever usage of stored procedures and the ability to run them with the
> permissions of the definer instead of the executer.

You can also use rules to protect rows. E.g.

CREATE RULE atable__lock_user_insert
AS ON INSERT TO atable
WHERE
CURRENT_USER != 'mysuper'
AND
new.username != CURRENT_USER
DO INSTEAD nothing;

CREATE RULE atable__lock_user_update
AS ON UPDATE TO atable
WHERE
CURRENT_USER != 'mysuper'
AND
old.username != CURRENT_USER
DO INSTEAD nothing;

CREATE RULE atable__lock_user_delete
AS ON DELETE TO atable
WHERE
CURRENT_USER != 'mysuper'
AND
old.username != CURRENT_USER
DO INSTEAD nothing;

--
Ron Peterson
https://www.yellowbank.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Harpreet Dhaliwal 2007-01-29 00:45:21 Re: PostgreSQL data loss
Previous Message Tom Lane 2007-01-28 23:33:16 Re: MULE_INTERNAL translation to win1250