Re: how long should Archive logs be retained
| От | Laurenz Albe |
|---|---|
| Тема | Re: how long should Archive logs be retained |
| Дата | |
| Msg-id | d615d389a140169a5d338cf540a0c17ed3ec346e.camel@cybertec.at обсуждение исходный текст |
| Ответ на | AW: how long should Archive logs be retained ("Subramanian,Ramachandran" <ramachandran.subramanian@alte-leipziger.de>) |
| Ответы |
AW: how long should Archive logs be retained
|
| Список | pgsql-novice |
On Thu, 2025-11-27 at 15:49 +0000, Subramanian,Ramachandran wrote: > Archive logging is NOT enabled and a transaction keeps filling up the logs one by one > till all the logs are full WITHOUT Any COMMIT. Then what happens? Does Postgres hang > or does Postgres terminate this thread ? Neither. As I said, PostgreSQL will happily remove WAL segments that contain uncommitted transactions. PostgreSQL will never undo any work. If a transaction is rolled back, all the uncommitted data are still there, they are only invisible. Later, the autovacuum daemon (a kind of garbage collection) will remove these data, but that's a separate activity (that is again logged to WAL). > After reading your answers, I understand that Archive logs are needed ONLY if we want > to go back in time to a past point of consistency ( example Current date minus 5 days ) . No, archive logs are needed whenever you you need to go back in time at all. With the WAL in pg_wal, all you can do is recover after a crash, which will recover all committed transactions. > Ofcourse a begining backup is needed on this day as well ( a backup taken on current > day - 5 days ) . Then using the backup and the Logs that were archived on this day , > we can rollforward to a Point in time on this day. 1. Did I understand correctly ? 2. > Is there any other scenareo where Archive logs will be used? I am not sure I can follow. You need a WAL archive whenever you want to undo *anything*. For that, you have to restore a base backup that *finished* before the point in time that you want to recover to. Also, you need all WAL from the start of the base backup until the point in time to which you want to recover. Yours, Laurenz Albe
В списке pgsql-novice по дате отправления: