How to use wal_level in Postgres to set the recovery mode to simple for a database like how Microsoft SQL Server does it?

dba.stackexchange https://dba.stackexchange.com/questions/282733

문제

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.

  1. Is wal_level's minimal equivalent to SQL Server's RECOVERY SIMPLE?
  2. How to set wal_level in Postgres command? - so far, Google Search tells me that wal_level is set in a configuration file.
  3. Is it possible to set wal_level to minimal for a database? If yes, how?

Thank you.

도움이 되었습니까?

해결책

PostgreSQL works quite differently. Transaction log files will be removed with all wal_levels (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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top