On 6/16/20 7:25 PM, amul sul wrote:
> Attached patch proposes $Subject feature which forces the system into
> read-only
> mode where insert write-ahead log will be prohibited until ALTER
> SYSTEM READ
> WRITE executed.
Thanks Amul.
1) ALTER SYSTEM
postgres=# alter system read only;
ALTER SYSTEM
postgres=# alter system reset all;
ALTER SYSTEM
postgres=# create table t1(n int);
ERROR: cannot execute CREATE TABLE in a read-only transaction
Initially i thought after firing 'Alter system reset all' , it will be
back to normal.
can't we have a syntax like - "Alter system set read_only='True' ; "
so that ALTER SYSTEM command syntax should be same for all.
postgres=# \h alter system
Command: ALTER SYSTEM
Description: change a server configuration parameter
Syntax:
ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' |
DEFAULT }
ALTER SYSTEM RESET configuration_parameter
ALTER SYSTEM RESET ALL
How we are going to justify this in help command of ALTER SYSTEM ?
2)When i connected to postgres in a single user mode , i was not able to
set the system in read only
[edb@tushar-ldap-docker bin]$ ./postgres --single -D data postgres
PostgreSQL stand-alone backend 14devel
backend> alter system read only;
ERROR: checkpointer is not running
backend>
--
regards,tushar
EnterpriseDB https://www.enterprisedb.com/
The Enterprise PostgreSQL Company