AnswerBun.com

PostgreSQL exits the shell when importing large data

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!

Database Administrators Asked by 3bdalla on December 26, 2020

2 Answers

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!

Related Questions

Backup Functions in PgAdmin 4 Version 1.6

1  Asked on November 19, 2021 by m-karthika

 

Can not connect to SQL Server from Ubuntu sqlcmd client

1  Asked on November 17, 2021 by carlosrpevertsz

       

Insufficient privilege

1  Asked on November 16, 2021 by vishwanath-gowda-k

     

How do I find the next saturday in MySQL

5  Asked on November 14, 2021 by who-cares

         

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.