I mean how to safely copy xlog files when postgresql is running? Any reply will be appreciated.
PostgreSQL – How to Safely Copy xlog Files
postgresqlpostgresql-9.3
Related Question
- Postgresql – Why doesn’t postgresql COPY command work with files in mapped drives
- Postgresql – How to copy a PostgreSQL database at a filesystem level between servers
- Postgresql – PG_DUMP on Replica DB server Error
- PostgreSQL 9.6 – Fixing pg_xlog Explodes During Set Tablespace
- Postgresql – How to safely replace the old table with its cleaned copy
Best Answer
The best (and recommended) way to do it is to configure the database server to copy them via the archive_command configuration variable. See also the chapter Setting up WAL Archiving.
If you are hell bent on copying them manually then another way might be to look at the contents of the archive_status subdirectory. When you see a file in this directory with the suffix .ready it means that the corresponding WAL file is completed and should be safe to copy. However I don't think this would happen unless WAL archiving was turned on in the first place - if it is not turned on then postgres will just delete the WAL files soon after they are written (which will not give you much chance to copy them!)