Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

as the title points out, I'm getting this error when trying to connect to a PostgreSql database from command line, using PostgreSQL.

The client machine is an Ubuntu 11.10 x86_64 and the PostgreSQL libraries are from Version 9.1

Server is PostgreSql 8.3.

This is the command that I executed:

psql -U postgres -d my_database -h -p 5432 -c "select * from xxyy"

I get the same results when I use sudo or su postgres.

The sad thing is that I can connect without problems using pgAdmin.

Any hint?

share|improve this question
Can you connect from other machines? Also, try to use a client with the same version as the server 8.3. –  Khaled Nov 11 '11 at 13:42

3 Answers 3

Try to look in /var/log/postgresql/postgresql-[your_version]-main.log on the server for signs of what's failing.

You might also try to launch that psql command locally, from the server, to see whether the problem is really with your client.

share|improve this answer

I had the same issue earlier.

Upon checking the log, I saw that postgres was complaining about diskspace. A df -h showed that the device had 0MB free space available. After freeing up some space, it worked.

share|improve this answer
Same issue here, thank you. –  wurde Jul 24 at 15:38

I got the same error. In my case it was a full file system. You may have other file system problems...

share|improve this answer
Welcome to Server Fault! If you have a NEW question, please ask it by clicking the Ask Question button. If you have sufficient reputation, you may upvote the question. Alternatively, "star" it as a favorite and you will be notified of any new answers. –  Scott Pack Oct 25 '13 at 1:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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