I used Fink to install postgresql on os x. when i try to start psql, i get:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
I have never installed postgresql before so I am not really sure where to look. Have any suggestions?
That means the PostgreSQL daemon is not running. You'll want to find where the daemon is installed. By default, it should be installed in /usr/local/pgsql. If it's there, inspect to see if there is a /usr/local/pgsql/data directory. If there is not run the following:
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
then, if successful, run
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start
And that should get you on the right track.
It seems to me, you're trying to run PostgresSQL under your current user-account. I don't know the fink-properties for PostgreSQL, but the associated daemons are supposed to run under a dedicated user-account (lets say postgres for example).
First identify the data-directory, in which PostgresSQL stores it's data and configuration files exist. Your error messages seems to say this may be "/Library/PostgreSQL/8.4/data". This directory should belong already to the postgres-user and have rwx-privileges for him. I guess Fink has already created it, so check out the install-logs.
Look inside this directory (you may need to su/sudo because you may not have sufficient privileges to do so with your console user). If there are some files, eg. postgresql.conf, a bunch of pg_* and some other files, all belonging to postgres, the data directory seems to be allright, otherwise invoke the following (replace the binary-path, postgres-user and the data path with your system-values, see man initdb for more options):
It's important to sudo as the postgres user here, because the user-account the postgres deamons runs as will have to have the sufficients access-rights.
Also, you will have to start the deamon with the the sudo (this should later be handled by a lauchctl-entry, or something similar), so:
You can always re-create the data-directory, but be sure to make a backup and do not overwrite it when postgres is still running.
You can check that Postgresql is running and listening with:
lsof -i |grep LISTEN
It sounds as though you don't have the server started, and possibly haven't run initdb
If you have more trouble, though, the easiest (and recommended by postgresql) way to install postgresql on Mac OS X is via the GUI installer provided by EnterpriseDB. It even handles installing multiple versions quite nicely.