1

System: Windows 10 Pro 64bit, Version 10.0.17134 Build 17134. with Postgres 10.3 db server.

I backup my postgres db using the following statements:

"C:\PostgreSQL\pg10\bin\pg_dumpall.exe" -U postgres -h localhost -p 5432 --schema-only --clean --file=dumpall_schema_clean_20181101.sql

"C:\PostgreSQL\pg10\bin\pg_dumpall.exe" -U postgres -h localhost -p 5432 --globals-only --clean --file=dumpall_globals_clean_20181101.sql

"C:\PostgreSQL\pg10\bin\pg_dumpall.exe" -U postgres -h localhost -p 5432 --data-only --clean --file=dumpall_data_clean_20181101.sql

When running the data-only statement I get an error message

pg_dump: Dumping the contents of table "allwaysDifferentTableName" failed:

PQgetCopyData() failed. pg_dump: Error message from server: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

pg_dump: The command was: COPY schema.allwaysDifferentTableName (id, ...) TO stdout; pg_dumpall: pg_dump failed on database "DATABASE", exiting

This seems to happen at random times and tables, sometimes the error comes after a few GB have been backed up, sometimes after 6 TB. Also, the table that appears in the error message is different all the time.

The log file for the time the error happend:

2018-11-07 00:52:59 HKT [25088]: [2-1] user=postgres,db=DATABASE,app=pg_dump,client=127.0.0.1 STATEMENT: COPY schema.allwaysDifferentTableName (id, ...) TO stdout;

2018-11-07 00:52:59 HKT [25088]: [3-1] user=postgres,db=DATABASE,app=pg_dump,client=127.0.0.1 FATAL: connection to client lost

2018-11-07 00:52:59 HKT [25088]: [4-1] user=postgres,db=DATABASE,app=pg_dump,client=127.0.0.1 STATEMENT: COPY schema.allwaysDifferentTableName (id, ...) TO stdout;

2018-11-07 00:53:00 HKT [23288]: [1-1] user=postgres,db=postgres,app=pg_dumpall,client=127.0.0.1 LOG: could not receive data from client: An existing connection was forcibly closed by the remote host.

The Postgres server runs on the same physical machine and I am not sure why it has a connection problem. I read, that a virus scanner may cause this problem, so I even turned that off. I also ran VACCUM ANALYZE prior to the backup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.