Re: [GENERAL] Making subscribers read only in Postgres 10 logical replication

Поиск
Список
Период
Сортировка
От Feike Steenbergen
Тема Re: [GENERAL] Making subscribers read only in Postgres 10 logical replication
Дата
Msg-id CAK_s-G0_n6KTzZLWJ+RjUvR4t8ktqG6hDeEtWnq1u7k1v8T7eg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Making subscribers read only in Postgres 10 logical replication  (rverghese <riyav@hotmail.com>)
Список pgsql-general
On 11 October 2017 at 20:38, rverghese <riyav@hotmail.com> wrote:
> I guess there is nothing at the database level.

Although not safe (as the user can reset this parameter), you could set
default_transaction_read_only for the application user.


postgres=# ALTER USER jdoe IN DATABASE postgres SET default_transaction_read_only TO true;
ALTER ROLE
postgres=# \c postgres jdoe
You are now connected to database "postgres" as user "jdoe".
postgres=> CREATE TABLE t1(i int);
ERROR:  cannot execute CREATE TABLE in a read-only transaction

regards,

Feike

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [GENERAL] wal_retrieve_retry_interval
Следующее
От: Allan Kamau
Дата:
Сообщение: [GENERAL] Preventing psql from attempting to access ~/.pgpass file.