Tell me more ×
Server Fault is a question and answer site for professional 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 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?

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

1 Answer

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

Your Answer

 
discard

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.