Forum OpenACS Q&A: PostgreSQL installation problem

Posted by Pavel Boghita on
everything went ok (at least apparently) until I wanted to test the
installation. Anyone has any idea of what's going on?

postgres@linux:~ > /usr/local/pgsql/bin/postmaster -
D /usr/local/pgsql/data
FATAL: StreamServerPort: bind() failed: Address already in use
        Is another postmaster already running on that port?
        If not, remove socket node (/tmp/.s.PGSQL.5432) and retry.
/usr/local/pgsql/bin/postmaster: cannot create UNIX stream port
postgres@linux:~ > /tmp/.s.PGSQL.5432
bash: /tmp/.s.PGSQL.5432: Permission denied
postgres@linux:~ > su - root
linux:~ # /tmp/.s.PGSQL.5432
bash: /tmp/.s.PGSQL.5432: Permission denied
linux:~ # createdb mydb
/usr/local/pgsql/bin/psql: error in loading shared libraries: cannot open shared object file: No such file or
createdb: database creation failed

This shows what I tried to do in the end but to no avail

Posted by Roberto Mello on
What distribution are you running? If you can install PG off of packages (RPMs, DEBs) it'll be easier on you.

Was the postmaster already running when you tried starting it? If not, remove the /tmp/.s.PGSQL.5432 file before trying to start it. You may have killed the postmaster in a previous attempt and that left the socket lying around on /tmp. (BTW, it's a REALLY bad idea to kill -9 tho postmaster. Tom Lane described it as "shooting yourself in the foot"). You should use pg_ctl to start and stop the postmaster.

As for the libraries, psql and other applications need to be able to find the PG libraries. If you put the libraries somewhere where they already know where to look for (e.g. /usr/lib) then no problem. If you want to leave them in /usr/local/pgsql/lib, then you'll have to add that directory to /etc/ and run "ldconfig".

I think I described this in the "Simple PostgreSQL installation guide", (part of the OpenACS docs).

Posted by Pavel Boghita on
thanks for your reply, I thing there are a few things I may have to do again and if everything fails reinstall the whole lot.
I am running Suse 7.0 and I think the problem may come from a possible early installation of PostgreSQL from the SUSE distribution. So I may have to uninstall that.