Re: How to start a database in ReadOnly mode?

Поиск
Список
Период
Сортировка
От Achilleas Mantzios
Тема Re: How to start a database in ReadOnly mode?
Дата
Msg-id 201107071049.53956.achill@matrix.gatewaynet.com
обсуждение исходный текст
Ответ на Re: How to start a database in ReadOnly mode?  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-admin
Hello
Στις Thursday 07 July 2011 10:26:19 ο/η Simon Riggs έγραψε:
> On Thu, Jul 7, 2011 at 8:08 AM, Paul Schluck <pschluck@gmail.com> wrote:
>
> > Is it possible to start a postgres cluster or 1 postgres database in
> > readonly mode? And - if yes - how can this be done?
>
> There is no formal, explicit command to do that. Just avoid doing
> writes, either in the application or by removing privileges.
>

This is how we did it, when there was a special requirement to do so for a special occasion,
make a new user (lets call it "readonly") and have the app authenticating with this user.
Manage his privileges with smth like: (for every table)
CREATE user readonly;
REVOKE ALL ON DATABASE <your database> FROM readonly;
(for each table) GRANT SELECT ON <your table> TO readonly;

For this last one you might need to write a script, producing the sql commands.
> --
> �Simon Riggs������������������ http://www.2ndQuadrant.com/
> �PostgreSQL Development, 24x7 Support, Training & Services
>



--
Achilleas Mantzios

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: How to start a database in ReadOnly mode?
Следующее
От: "francescoboccacci@libero.it"
Дата:
Сообщение: R: Re: adminpack installation problem