Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I wrote a web app, using java + spring+ PostgreSQL, which I have up and running.

I have a tester for my system and I want him to be able to connect to my database directly to check the result of interaction with application. As always, the web is littered with articles on how to connect, but one simple thing they don't mention is whether a client should install some app to connect to the database? I get the bit about making correct settings for the database, but if a mere mortal enters the following in their windows console:

psql -h <host> -p <port> -u <database>

they will get 'psql' is not recognized as an internal or external command, operable program or batch file. I understand I don't get that error because I operate via shell and my home path is set to psql.exe, but again the client doesn't need to install PostgreSQL to access remote a PostgreSQL database. It just doesn't click in my head.

How can a client connect to database via command prompt without installing anything?

share|improve this question
2  
Please post your pg_hba.conf to ensure that the server is accessible. Also, psql.exe needs to be on the PATH. This can be obtained from postgresql.org and downloaded from the "advanced" binaries download (no installer). –  swasheck Apr 5 '12 at 15:26
    
Is this really better suited for Stack Overflow? –  jcolebrand May 7 '12 at 0:43
add comment

3 Answers 3

I suppose the simplest way is to let the tester use ssh to login to your server. Then the tester's execution environment is whatever your server exposes through the shell. (I presume that would include psql.)

As far as I know, all modern Unix derivatives install ssh by default. That would include Linux, Solaris, OS/X (Apple), and BSD. I believe that Windows does not ship with ssh, but Cygwin and PuTTY are commonly used to remedy that problem.

share|improve this answer
add comment

Though not as system-agnostic as shell access, if the tester happens to use a system in the Debian/Ubuntu family, the postgresql-client package should install what they need. I don't know what pre-packaged options might be available to install stand-alone psql on other platforms.

share|improve this answer
add comment

You need to check that psql is in their $PATH - or provide the full path to psql when executing it.

share|improve this answer
add comment

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.