Search Postgresql Archives

Re: Making subscribers read only in Postgres 10 logical replication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11 October 2017 at 20:38, rverghese <riyav@xxxxxxxxxxx> 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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux