Обсуждение: Starting postgres server on mac os x 10.6.8

Поиск
Список
Период
Сортировка

Starting postgres server on mac os x 10.6.8

От
Andrew Barinov
Дата:
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

Re: Starting postgres server on mac os x 10.6.8

От
Scott Ribe
Дата:
Find the log file and see what it says.

On Feb 4, 2012, at 9:50 PM, Andrew Barinov wrote:

> Why is the postgres not starting?


--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





Re: Starting postgres server on mac os x 10.6.8

От
Andrew Barinov
Дата:
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?

On Sat, Feb 4, 2012 at 9:21 PM, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
Find the log file and see what it says.

On Feb 4, 2012, at 9:50 PM, Andrew Barinov wrote:

> Why is the postgres not starting?


--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice







--
Andrew J. Lauer Barinov

AndrewJL@facebook.com
@ajlb8

Re: Starting postgres server on mac os x 10.6.8

От
Scott Ribe
Дата:
On Feb 4, 2012, at 11:16 PM, Andrew Barinov wrote:

> 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
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





Re: Starting postgres server on mac os x 10.6.8

От
Andrew Barinov
Дата:
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?

On Sun, Feb 5, 2012 at 7:18 AM, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
On Feb 4, 2012, at 11:16 PM, Andrew Barinov wrote:

> 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.



--
Andrew J. Lauer Barinov

AndrewJL@facebook.com
@ajlb8

Re: Starting postgres server on mac os x 10.6.8

От
Scott Ribe
Дата:
On Feb 5, 2012, at 3:14 PM, Andrew Barinov wrote:

> This is my first time trying to solve a postgres issue, I just now realized that the command I tried before wasn't to
openthe logfile but to do something else. I couldn't find the command in the postgres docs to open and see the contents
ofthe 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
thousandother 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
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





Re: Starting postgres server on mac os x 10.6.8

От
Andrew Barinov
Дата:
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?

On Sun, Feb 5, 2012 at 2:28 PM, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
On Feb 5, 2012, at 3:14 PM, Andrew Barinov wrote:

> 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.



--
Andrew J. Lauer Barinov

AndrewJL@facebook.com
@ajlb8

Re: Starting postgres server on mac os x 10.6.8

От
Scott Ribe
Дата:
On Feb 5, 2012, at 3:31 PM, Andrew Barinov wrote:

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

What tarball? I'm not aware of any such thing, and in a quick look did not see it.

--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





Re: Starting postgres server on mac os x 10.6.8

От
Andrew Barinov
Дата:
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!


On Sun, Feb 5, 2012 at 2:35 PM, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
>
> On Feb 5, 2012, at 3:31 PM, Andrew Barinov wrote:
>
> > 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
fromthe tarball installation? 
>
> What tarball? I'm not aware of any such thing, and in a quick look did not see it.
>
> --
> Scott Ribe
> scott_ribe@elevated-dev.com
> http://www.elevated-dev.com/
> (303) 722-0567 voice
>
>
>
>



--
Andrew J. Lauer Barinov

AndrewJL@facebook.com
@ajlb8

Re: Starting postgres server on mac os x 10.6.8

От
Scott Ribe
Дата:
On Feb 5, 2012, at 3:58 PM, Andrew Barinov wrote:

> 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
neverused 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
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice