As a developer, I often ssh right into my local database, just to test my application before pushing my code.
However, I find that every time I want to access Postgres, I have to type in
postgres@ubuntu:~$ /usr/local/pgsql/bin/psql test
whereas on my work machine, all I have to do is type
postgres@ubuntu:~$ psql --dbname=test --username=user
I tried creating a symlink, which was successful, but whenever I try connecting to it through this shortcut, I get the following error message:
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
How do I get this to work? In case it makes any difference, I'm using a self-compiled version of the 9.1.x series.
EDIT: I now know that this isn't really symlinking, but I'm not sure what it's called, or I'm sure I would have found it on Google already. Basically, I want it to run from the shell by typing in
psql [OPTIONS] like
rvm [OPTIONS] or
I know there's a package named
postgresql-client-common & a bunch of other Postgres packages through
apt-get, but I would prefer not using the
apt-get version so I can update Postgres on the fly.