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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Creating a db on my newly installed postresql on OS X
Дата
Msg-id 14353.1271448493@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Creating a db on my newly installed postresql on OS X  (Søren Krogh Neigaard <soeren@neigaard.com>)
Ответы Re: Creating a db on my newly installed postresql on OS X  (Michael Wood <esiotrot@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Søren Krogh Neigaard
Дата:
Сообщение: Re: Creating a db on my newly installed postresql on OS X
Следующее
От: Bob McConnell
Дата:
Сообщение: Re: Converting a table from SQL Server