Re: Problem of installation on Mac

From: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
To: Lizhe(dot)Xu(at)aphis(dot)usda(dot)gov
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem of installation on Mac
Date: 2007-10-18 17:27:18
Message-ID: 47179776.5090306@Sheeky.Biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lizhe(dot)Xu(at)aphis(dot)usda(dot)gov wrote:
> Hi, I am a newbie for pgsql and tried to install it on my MacBookPro
> Intel. I got everything correct until creating the user: postgres and
> initdb, then the error message showed up for running the db. How to fix
> the problem?
>
> LizheXusComputer:/Users/lizhexu pgsql$ /usr/local/pgsql/bin/postgres -D
> /usr/local/pgsql/data >logfile 2>&1 &
> [1] 17837
> LizheXusComputer:/Users/lizhexu pgsql$ su: logfile: Permission denied
>
> [1]+ Exit 1 /usr/local/pgsql/bin/postgres -D
> /usr/local/pgsql/data >logfile 2>&1
> LizheXusComputer:/Users/lizhexu pgsql$ su lizhexu
> Password:
> LizheXusComputer:~ lizhexu$ /usr/local/pgsql/bin/postgres -D
> /usr/local/pgsql/data >logfile 2>&1 &
> [1] 17842
> LizheXusComputer:~ lizhexu$ /usr/local/pgsql/bin/createdb test
> createdb: could not connect to database postgres: 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"?
> [1]+ Exit 2 /usr/local/pgsql/bin/postgres -D
> /usr/local/pgsql/data >logfile 2>&1
>
>
> Thank you very much.
>
>
> L
>
>

I would say the problem is when you are logged in as pgsql the >logfile
part tries to put the log file in the current working directory
(/Users/lizhexu in your example). Your pgsql user doesn't have
permission to write the log file there. When you are logged in as
lizhexu you don't get permission to read the data files. Also it should
be >>logfile changing >logfile to >>/usr/local/pgsql/data/logfile will
most likely fix the problem.

I would suggest looking into contrib/start-scripts (from the source
distro) - look at PostgreSQL.darwin - the comments at the top should get
you started. These steps will have postgres running when you startup
your Mac.

You will need to change PGUSER="postgres" to PGUSER="pgsql", leave the
rest and try running it.

hint - with startup scripts if you don't want to restart you can use -
sudo /Library/StartupItems/PostgreSQL/PostgreSQL start

Also which version are you installing and did you get a binary package
somewhere or are you building from source?

--

Shane Ambler
pgSQL(at)Sheeky(dot)Biz

Get Sheeky @ http://Sheeky.Biz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message brian 2007-10-18 17:33:10 Re: Am I overseen ?
Previous Message Laurent ROCHE 2007-10-18 17:06:00 Resetting SEQUENCEs