Discussion:
[ADMIN] Starting postgres server on mac os x 10.6.8
(too old to reply)
Andrew Barinov
2012-02-05 04:50:34 UTC
Permalink
Hello,

I'm having trouble restarting the postgres server on my mac. The error I am
getting when I try to run PG is:

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"?

Here's the command that I tried:

sudo su postgres

bash-3.2$ /Library/PostgreSQL/9.1/bin/pg_ctl -D
/Library/PostgreSQL/9.1/data restart
pg_ctl: PID file "/Library/PostgreSQL/9.1/data/postmaster.pid" does not
exist
Is server running?
starting server anyway
server starting

then I checked the server status:

bash-3.2$ /Library/PostgreSQL/9.1/bin/pg_ctl -D
/Library/PostgreSQL/9.1/data status
pg_ctl: no server running

I verified that the pg_ctl and pg_conf files were in place.

I then went ahead and tried this:

bash-3.2$ /Library/PostgreSQL/9.1/bin/pg_ctl -D
/Library/PostgreSQL/9.1/data start
server starting

then I checked the server status:

bash-3.2$ /Library/PostgreSQL/9.1/bin/pg_ctl -D
/Library/PostgreSQL/9.1/data status
pg_ctl: no server running

Why is the postgres not starting? I am doing all this under the postgres
superuser, so I should not have any issue with user privileges.

Thanks,

Andrew
Scott Ribe
2012-02-05 05:21:53 UTC
Permalink
Find the log file and see what it says.
Post by Andrew Barinov
Why is the postgres not starting?
--
Scott Ribe
***@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Andrew Barinov
2012-02-05 06:16:30 UTC
Permalink
I tried the following command:

bash-3.2$ /Library/PostgreSQL/9.1/bin/pg_ctl -D
/Library/PostgreSQL/9.1/data start -l logfile
server starting
sh: logfile: Permission denied

Shouldn't the postgres superuser be allowed to see the logfile?
Post by Scott Ribe
Find the log file and see what it says.
Post by Andrew Barinov
Why is the postgres not starting?
--
Scott Ribe
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Andrew J. Lauer Barinov

***@facebook.com
@ajlb8
Scott Ribe
2012-02-05 15:18:20 UTC
Permalink
Post by Andrew Barinov
Shouldn't the postgres superuser be allowed to see the logfile?
What do you mean "see the logfile"??? You're telling it to write into a file named logfile, in the current directory. Obviously, the user that postgres is being run under does not have permission to do that.
--
Scott Ribe
***@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Andrew Barinov
2012-02-05 22:14:18 UTC
Permalink
Hi Scott,

This is my first time trying to solve a postgres issue, I just now realized
that the command I tried before wasn't to open the logfile but to do
something else. I couldn't find the command in the postgres docs to open
and see the contents of the logfile, can you tell me what it is?
Post by Scott Ribe
Post by Andrew Barinov
Shouldn't the postgres superuser be allowed to see the logfile?
What do you mean "see the logfile"??? You're telling it to write into a
file named logfile, in the current directory. Obviously, the user that
postgres is being run under does not have permission to do that.
--
Scott Ribe
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Andrew J. Lauer Barinov

***@facebook.com
@ajlb8
Scott Ribe
2012-02-05 22:28:20 UTC
Permalink
This is my first time trying to solve a postgres issue, I just now realized that the command I tried before wasn't to open the logfile but to do something else. I couldn't find the command in the postgres docs to open and see the contents of the logfile, can you tell me what it is?
Ah, there is no such command. The log file is just a plain text file and you open it and look at it however you want: Console.app, cat or more at the command line, pico, vim, emacs, BBEdit, TextWrangler, TextMate, TextEdit or any of a thousand other different ways.

You do need to know where it is of course, and you've used some package manager that puts pg pieces in non-standard locations, so I can't help you with that other than refer you to the docs, if there are any, for that install.
--
Scott Ribe
***@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Andrew Barinov
2012-02-05 22:31:26 UTC
Permalink
Actually no, I installed it using a tarball of the postgres website.
Everything related to postgres is located inside /Libary/PostgreSQL/
directory, so I'll start there first. Do you know the exact location the
logfile is put in from the tarball installation?
Post by Andrew Barinov
This is my first time trying to solve a postgres issue, I just now
realized that the command I tried before wasn't to open the logfile but to
do something else. I couldn't find the command in the postgres docs to open
and see the contents of the logfile, can you tell me what it is?
Ah, there is no such command. The log file is just a plain text file and
you open it and look at it however you want: Console.app, cat or more at
the command line, pico, vim, emacs, BBEdit, TextWrangler, TextMate,
TextEdit or any of a thousand other different ways.
You do need to know where it is of course, and you've used some package
manager that puts pg pieces in non-standard locations, so I can't help you
with that other than refer you to the docs, if there are any, for that
install.
--
Scott Ribe
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Andrew J. Lauer Barinov

***@facebook.com
@ajlb8
Scott Ribe
2012-02-05 22:35:21 UTC
Permalink
Actually no, I installed it using a tarball of the postgres website. Everything related to postgres is located inside /Libary/PostgreSQL/ directory, so I'll start there first. Do you know the exact location the logfile is put in from the tarball installation?
What tarball? I'm not aware of any such thing, and in a quick look did not see it.
--
Scott Ribe
***@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Andrew Barinov
2012-02-05 22:58:58 UTC
Permalink
I got it from here: http://www.postgresql.org/download/macosx/

I found the log file (the location is set inside of pgAdmin), it turns
out my pg_hba.conf file had improper permissions set (postgres was
being denied access). Thanks for pointing me to the right direction!
Post by Scott Ribe
Actually no, I installed it using a tarball of the postgres website. Everything related to postgres is located inside /Libary/PostgreSQL/ directory, so I'll start there first. Do you know the exact location the logfile is put in from the tarball installation?
What tarball? I'm not aware of any such thing, and in a quick look did not see it.
--
Scott Ribe
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Andrew J. Lauer Barinov

***@facebook.com
@ajlb8
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Scott Ribe
2012-02-05 23:10:07 UTC
Permalink
I got it from here: http://www.postgresql.org/download/macosx/
Ah, those are all external to the postgres web site.
I found the log file (the location is set inside of pgAdmin), it turns
out my pg_hba.conf file had improper permissions set (postgres was
being denied access). Thanks for pointing me to the right direction!
Glad you found it. I would *never* have thought of looking for pgAdmin, since that also is an external project and I've never used and would have had no idea that your install had it.

These "easy" installer to "help" Mac users are kind of a mixed bag; it may be nice to not have to understand as much UNIX & pg to start, but then if anything goes wrong, you're kind of lost.
--
Scott Ribe
***@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Sent via pgsql-admin mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Loading...