Re: [Patch] ALTER SYSTEM READ ONLY
Amul Sul <sulamul@gmail.com>
On Wed, Jun 17, 2020 at 8:15 PM Robert Haas <robertmhaas@gmail.com> wrote: > > On Wed, Jun 17, 2020 at 9:51 AM tushar <tushar.ahuja@enterprisedb.com> wrote: > > 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' ; " > > No, this needs to be separate from the GUC-modification syntax, I > think. It's a different kind of state change. It doesn't, and can't, > just edit postgresql.auto.conf. > > > 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> > > Hmm, that's an interesting finding. I wonder what happens if you make > the system read only, shut it down, and then restart it in single-user > mode. Given what you see here, I bet you can't put it back into a > read-write state from single user mode either, which seems like a > problem. Either single-user mode should allow changing between R/O and > R/W, or alternatively single-user mode should ignore ALTER SYSTEM READ > ONLY and always allow writes anyway. > Ok, will try to enable changing between R/O and R/W in the next version. Thanks Tushar for the testing. Regards, Amul
Commits
-
Initialize variable to placate compiler.
- a030a0c5ccb1 15.0 landed
-
StartupXLOG: Don't repeatedly disable/enable local xlog insertion.
- 18e0913a4203 15.0 landed
-
StartupXLOG: Call CleanupAfterArchiveRecovery after XLogReportParameters.
- a75dbf7f9ee6 15.0 landed
-
Postpone some end-of-recovery operations related to allowing WAL.
- 811051c2e7af 15.0 landed
-
Refactor some end-of-recovery code out of StartupXLOG().
- 6df1543abfed 15.0 landed
-
Re-enable contrib/bloom's TAP tests.
- 7d1aa6bf1c27 15.0 cited
-
Remove unnecessary call to ReadCheckpointRecord().
- 1d919de5eb3f 15.0 cited
-
Allow for error or refusal while absorbing a ProcSignalBarrier.
- a3ed4d1efe9f 14.0 landed
-
Add comment to explain an unused function parameter
- 101f903e51f5 14.0 cited
-
Extend the ProcSignal mechanism to support barriers.
- 16a4e4aecd47 13.0 cited
-
At promotion, don't leave behind a partial segment on the old timeline.
- 7cbee7c0a1db 9.5.0 cited