0

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!

6
  • 3
    Use screen. You might be a victim of some network problems. Also, please note that psql is a client to PostgreSQL, not just another abbreviation for it.
    – dezso
    Sep 22, 2016 at 8:13
  • I'm importing the data to the server on the same machine, but the data file exists on a network drive.
    – 3bdalla
    Sep 22, 2016 at 8:45
  • 3
    What does the server log file say? It will usually have more detailed information than the client log file does. You should also check the system's log files, to see if you are getting out-of-memory problems.
    – jjanes
    Sep 22, 2016 at 19:36
  • Check my update.
    – 3bdalla
    Sep 25, 2016 at 10:24
  • Are you operating over a SSH connection?
    – pietrop
    Sep 28, 2016 at 15:35

2 Answers 2

0

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/

1
  • This env variable is not set on my machine. Check my update on the question.
    – 3bdalla
    Sep 25, 2016 at 10:24
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.