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

Re: Optional postgres database not so optional in 8.1

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paesold <mpaesold(at)gmx(dot)at>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, John Hansen <john(at)geeknet(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Optional postgres database not so optional in 8.1
Date: 2005-12-02 22:45:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I never saw a followup to this. Is someone working on a ping protocol 
extension, or should we revert pg_ctl to using template1 on the ground 
that it does a poor man's ping anyway?



Andrew Dunstan wrote:

> Tom Lane wrote:
>> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>>> I now notice that "pg_ctl -w start" fails if the postgres db is 
>>> missing. I am not sure that changing pg_ctl to use this rather than 
>>> template1 was a good thing, and it can't be overridden. I suggest we 
>>> revert that particular change - it seems to me to confer little to 
>>> no benefit, unlike the case with createdb etc.
>> pg_ctl -w is already incredibly fragile because it needs a working
>> password-free login name.  Rather than worrying about whether the
>> database name exists, what we ought to do is invent the long-awaited
>> "ping" extension to the postmaster protocol --- something that would
>> just ask "are you up and ready to accept connections" without having
>> to specify a valid user *or* database name.
>> You can sort of do this today if you are willing to examine the error
>> message that comes back from the postmaster, but I think it'd be cleaner
>> to have an official protocol extension.
> Actually, it looks like pg_ctl already does this:
>        if ((conn = PQsetdbLogin(NULL, portstr, NULL, NULL,
>                                 "postgres", NULL, NULL)) != NULL &&
>            (PQstatus(conn) == CONNECTION_OK ||
>             (strcmp(PQerrorMessage(conn),
>                     PQnoPasswordSupplied) == 0)))
>        {
>            PQfinish(conn);
>            success = true;
>            break;
>        }

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-12-02 22:45:10
Subject: Re: Reducing relation locking overhead
Previous:From: Bruce MomjianDate: 2005-12-02 22:41:34
Subject: Re: Numeric 508 datatype

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