Re: Building Postgresql under Windows question - Mailing list pgsql-hackers

From Dann Corbit
Subject Re: Building Postgresql under Windows question
Date
Msg-id D425483C2C5C9F49B5B7A41F894415470296219C@postal.corporate.connx.com
Whole thread Raw
In response to Re: Building Postgresql under Windows question  ("Dann Corbit" <DCorbit@connx.com>)
Responses Re: Building Postgresql under Windows question  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
In this function:
static bool
test_postmaster_connection(bool do_checkpoint)

This code will never succeed:snprintf(connstr, sizeof(connstr),         "dbname=postgres port=%s connect_timeout=5",
portstr);
for (i = 0; i < wait_seconds; i++){    if ((conn = PQconnectdb(connstr)) != NULL &&        (PQstatus(conn) ==
CONNECTION_OK||         PQconnectionNeedsPassword(conn)))    {        PQfinish(conn);        success = true;
break;   } 


Because pg_hba.conf has this:
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
host    all         all         ::1/128               trust

to allow connections from the local machine.

(A password is not needed to connect, so the code always fails).




pgsql-hackers by date:

Previous
From: "Dann Corbit"
Date:
Subject: Re: Building Postgresql under Windows question
Next
From: vadim
Date:
Subject: ...