Re: Creating a db on my newly installed postresql on OS X

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Søren Krogh Neigaard <soeren(at)neigaard(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Creating a db on my newly installed postresql on OS X
Date: 2010-04-16 20:08:13
Message-ID: 14353.1271448493@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

=?iso-8859-1?Q?S=F8ren_Krogh_Neigaard?= <soeren(at)neigaard(dot)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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bob McConnell 2010-04-17 19:21:54 Re: Converting a table from SQL Server
Previous Message Søren Krogh Neigaard 2010-04-16 18:21:12 Re: Creating a db on my newly installed postresql on OS X