This is for PostgreSQL 16 on Windows.
I turned on archive_mode with archive_command = 'copy "%p" "C:\PostgreSQL\16\data\pg_wal\archive_status\%f"' and archive_timeout at 3600
Executed select pg_switch_wal(); a few times (Oracle's ALTER SYSTEM SWITCH LOGFILE??)
Now, I have 16 MB files generated in pg_wal folder. I also have files in pg_wal\archive_status folder. Some of the files are similar in pg_wal and pg_wal\archive_status. Some of the files in pg_wal\archive_status, for example, 00000001000000000000007A with 16MB size and 00000001000000000000007A.done with 0 KB in size.
I'm trying to make sense of it all. Coming from Oracle, I understand the archive logs and redo logs. I figured the files in pg_wal are redologs and files in pg_wal\archive_status is archived logs? And when I execute select pg_switch_wal();, I'm switching redo logs and the old logs are archived?
My question now is
- what's 00000001000000000000007A vs 00000001000000000000007A.done in pg_wal\archive_status folder?
- Also, when I do run pg_basebackup, will it automatically delete all the archived logs that had been backed up?
Thank you