6

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?

asked Apr 4, 2012 at 23:20
2
  • 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). Commented Apr 5, 2012 at 15:26
  • Is this really better suited for Stack Overflow? Commented May 7, 2012 at 0:43

3 Answers 3

5

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.

answered Apr 4, 2012 at 23:35
1

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.

answered Apr 5, 2012 at 5:06
-1

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

answered May 6, 2012 at 13:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.