TransWikia.com

PostgreSQL exits the shell when importing large data

Database Administrators Asked by 3bdalla on December 26, 2020

I’m having this totally weird scenario: We have an archiving server based on PostgreSQL inside a Scientific Linux virtual server. I want to migrate the data (20+ GB) to a physical Scientific Linux machine, so I used

copy (select * from table) to '/path/to/file 

This ran successfully, and the data is in the output file.

On the physical machine I try to import the data using

copy table from '/path/to/file'

When I try this command on a terminal emulator, it exits after a few minutes. Also, tried it on the terminal itself after login but after a few minutes it exits, too. In both cases there is no data imported.

Could it be that the server is somehow overloaded? Can we overcome this and import the entire file?

Edit: I increased the RAM to 3 GB, the crash took a bit longer to come.

Edit 2: There is a log file under /var/lib/pgsql/data/pg_log, this log file has these lines as the last few lines of it:

Context: COPY sample, line 77324116
Statement: COPY sample from STDIN
ERROR: Unexpected EOF on client connection
Context: COPY sample, line 77324116
Statement: COPY sample from STDIN
Log: Could not send data to client: Broken pipe
Statement: COPY sample from STDIN
ERROR: Unexpected EOF on client connection

Any help is really appreciated!

2 Answers

A firewall between you and the terminal, or the terminal and the server, may be dropping the connections since it "sees" no traffic, and considers the connection abandoned.

Answered by Gerard H. Pille on December 26, 2020

Is your physical machine using autologout?

$ echo $TMOUT

When there exists a value above zero, you should unset that environment variable.

$ unset TMOUT

http://www.cyberciti.biz/faq/unset-tmout-under-unix-appleosx-bash-ksh-tcsh-shell/

Answered by maletin on December 26, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP