Skip site navigation (1) Skip section navigation (2)

pg_ctl -w start does not know that it has started postmaster

From: Aaron Hillegass <aaron(at)bignerdranch(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: pg_ctl -w start does not know that it has started postmaster
Date: 2004-11-20 19:22:59
Message-ID: 96F494B8-3B29-11D9-B925-000A95A0A0F0@bignerdranch.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Your name		:	Aaron Hillegass
Your email address	:      aaron(at)bignerdranch(dot)com


System Configuration
---------------------
   Architecture (example: Intel Pentium)  	: PPC

   Operating System (example: Linux 2.4.18) :  Mac OS X 10.3.5

   PostgreSQL version (example: PostgreSQL-8.0):   PostgreSQL-8.0b4

   Compiler used (example:  gcc 2.95.2)		:  gcc version 3.3 20030304  
(Apple Computer, Inc. build 1666)


Please enter a FULL description of your problem:
------------------------------------------------

I have a script that must start the postmaster before continuing, so I  
do this:

 > sudo -u postgres /Library/PostgreSQL/bin/pg_ctl -w start

But this always fails:

 > sudo -u postgres /Library/PostgreSQL/bin/pg_ctl -w start
waiting for postmaster to  
start...............................................................coul 
d not start postmaster

But the postmaster is actually started:

 > /Library/PostgreSQL/bin/psql -Unopali template1
Welcome to psql 8.0.0beta4, the PostgreSQL interactive terminal.

template1=#

Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

Note that the process's user name (postgres) is different from the  
database's owner (nopali).


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

I suspect that the problem is that when I did initdb,  I used 'nopali'  
as the username, but pg_ctl is being run as 'postgres'.  Because there  
is no database user called 'postgres', I think that this line in  
pg_ctl.c always fails:

        if ((conn = PQsetdbLogin(NULL, portstr, NULL, NULL,
                                                                   
"template1", NULL, NULL)) != NULL &&
                         (PQstatus(conn) == CONNECTION_OK ||
                          (strcmp(PQerrorMessage(conn),
                                          PQnoPasswordSupplied) == 0)))



Responses

pgsql-bugs by date

Next:From: Michael FuhrDate: 2004-11-21 07:47:41
Subject: plperl: Undefined subroutine &main::mksafefunc
Previous:From: Devrim GUNDUZDate: 2004-11-20 16:08:10
Subject: Re: Wrong version of INIT script in postgresql-7.3.8-3PGDG.i686.rpm

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group