16

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 192.168.0.161 -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?

1
  • Can you connect from other machines? Also, try to use a client with the same version as the server 8.3. Commented Nov 11, 2011 at 13:42

3 Answers 3

26

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.

0
2

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.

0

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

1
  • 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. Commented Oct 25, 2013 at 1:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.