Re: How to create a read only user account to access to all pg database?

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: How to create a read only user account to access to all pg database?
Дата
Msg-id 20151125132332.GU3685@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: How to create a read only user account to access to all pg database?  (Shreeyansh Dba <shreeyansh2014@gmail.com>)
Список pgsql-admin
* Shreeyansh Dba (shreeyansh2014@gmail.com) wrote:
> A simple way is Create a user with superuser privileges and read only
> permission.
>
> -Login psql as postgres or other superuser.
> -Create the new superuser role and set it to read only :
>
> CREATE USER backupadmn WITH PASSWORD 'pwd' SUPERUSER ;
> ALTER USER backupadmn set default_transaction_read_only = on;

Uh, that doesn't create a read-only user, it just starts that user's
session out with the transaction being read only *by default*.

Do NOT use this to try and create read-only users.

The user can trivially change that if they have SQL access using begin:

----------------------
=# begin read write;
BEGIN
=*# alter user r1 set default_transaction_read_only = 0;
ALTER ROLE
=*# commit;
COMMIT
=#
----------------------

Thanks!

Stephen

Вложения

В списке pgsql-admin по дате отправления:

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: Question on Hot Standby in PostgreSQL
Следующее
От: "Mailing Liste"
Дата:
Сообщение: Update postgresql-9.1 fails