How to use wal_level in Postgres to set the recovery mode to simple for a database like how Microsoft SQL Server does it?
-
13-03-2021 - |
Frage
In Microsoft SQL Server, ALTER DATABASE CURRENT SET RECOVERY SIMPLE WITH NO_WAIT;
will set the recovery mode for a database to simple, so the transaction log file space can be re-used.
In Postgres, wal_level
is available for that purpose.
- Is
wal_level
'sminimal
equivalent to SQL Server'sRECOVERY SIMPLE
? - How to set
wal_level
in Postgres command? - so far, Google Search tells me thatwal_level
is set in a configuration file. - Is it possible to set
wal_level
tominimal
for a database? If yes, how?
Thank you.
Lösung
PostgreSQL works quite differently. Transaction log files will be removed with all wal_level
s (as soon as the file is full and archived and a checkpoint has completed).
If you want to live without WAL archives, and all you need is crash recovery, you can set wal_level
to minimal
.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit dba.stackexchange