Re: Creating a db on my newly installed postresql on OS X - Mailing list pgsql-novice

From Tom Lane
Subject Re: Creating a db on my newly installed postresql on OS X
Date
Msg-id 14353.1271448493@sss.pgh.pa.us
Whole thread Raw
In response to Re: Creating a db on my newly installed postresql on OS X  (Søren Krogh Neigaard <soeren@neigaard.com>)
Responses Re: Creating a db on my newly installed postresql on OS X  (Michael Wood <esiotrot@gmail.com>)
List pgsql-novice
=?iso-8859-1?Q?S=F8ren_Krogh_Neigaard?= <soeren@neigaard.com> writes:
> When I issue the command "psql postgres", I get this message:
> 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"?

Oh, well in that case you seem to not have a server running ... what was
it you saw in ps exactly?

> I found a tutorial that told me to do the following:

> sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
> sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb
> sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'
> sudo su postgres
> /opt/local/lib/postgresql84/bin/createuser -s -P -l #MYUSER#

That seems to be missing the step of starting the postmaster.

> But still I get the same error when ever I try and run psql. But how
> does postgresql know where to find my database files?

The postmaster should be started by a step along the lines of

    sudo su postgres -c '.../postmaster -D /opt/.../defaultdb &'

However, if you're going to use the Macports startup script, it very
probably has got a database location hard-wired into it --- you need to
look at that script and see what it's using, rather than assuming that
that tutorial matches the script.  Also, look to see where the script
is sending the postmaster's stderr, and have a look into that logfile
to see if the postmaster is reporting any useful error messages.

            regards, tom lane

pgsql-novice by date:

Previous
From: Søren Krogh Neigaard
Date:
Subject: Re: Creating a db on my newly installed postresql on OS X
Next
From: Bob McConnell
Date:
Subject: Re: Converting a table from SQL Server