> For the complete documentation index, see [llms.txt](https://dev-notes.vinguyen.blog/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev-notes.vinguyen.blog/notes/deployment-and-operation/database/postgresql/clean-up-pg-walfile.md).

# Clean up pg walfile

```
SELECT pg_walfile_name(pg_current_wal_lsn())
```

```
pg_archivecleanup  /var/lib/postgresql/archive 000000010000000C00000021
```
