Обсуждение: read only connection

Поиск
Список
Период
Сортировка

read only connection

От
Gaetano Mendola
Дата:
Already asked, I try again:

7.4 give the feature to have transaction in
read only mode, is it possible give permission
to an user to perform db connection in read only
mode ?



Regards
Gaetano Mendola


Re: read only connection

От
Bruno Wolff III
Дата:
On Thu, Nov 06, 2003 at 23:59:29 +0100,
  Gaetano Mendola <mendola@bigfoot.com> wrote:
> Already asked, I try again:
>
> 7.4 give the feature to have transaction in
> read only mode, is it possible give permission
> to an user to perform db connection in read only
> mode ?

Not by connection, but if they don't have write access to an object they
won't be able to change it.

Re: read only connection

От
Jeff
Дата:
On Thu, 06 Nov 2003 23:59:29 +0100
Gaetano Mendola <mendola@bigfoot.com> wrote:

> Already asked, I try again:
>
> 7.4 give the feature to have transaction in
> read only mode, is it possible give permission
> to an user to perform db connection in read only
> mode ?
>

create user readonlyuser;
revoke insert on [table] from readonlyuser
revoke update on [table] from readonlyuser
revoke delete on [table] from readonlyuser


you could do it with a group as well.

>
>
> Regards
> Gaetano Mendola
>
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 5: Have you checked our
> extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html


--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

Re: read only connection

От
Gaetano Mendola
Дата:
Jeff wrote:
> On Thu, 06 Nov 2003 23:59:29 +0100
> Gaetano Mendola <mendola@bigfoot.com> wrote:
>
>
>>Already asked, I try again:
>>
>>7.4 give the feature to have transaction in
>>read only mode, is it possible give permission
>>to an user to perform db connection in read only
>>mode ?
>>
>
>
> create user readonlyuser;
> revoke insert on [table] from readonlyuser
> revoke update on [table] from readonlyuser
> revoke delete on [table] from readonlyuser

I know but is not system/tables wide.
Each time that a table is created I shall remember
to revoke the permission, what I was looking for
was an option to insert into pg_hba.conf


Regards
Gaetano Mendola


Re: read only connection

От
Bruno Wolff III
Дата:
On Fri, Nov 07, 2003 at 19:53:42 +0100,
  Gaetano Mendola <mendola@bigfoot.com> wrote:
>
> I know but is not system/tables wide.
> Each time that a table is created I shall remember
> to revoke the permission, what I was looking for
> was an option to insert into pg_hba.conf

When you create a table you have to give permission for other people to
use it at all. So just give select access instead of all access.
You can even give this to a group (or public) so that you can add more
users who should have read only access without having to change the
access rights for each table.