Forum OpenACS Q&A: pg_hba.conf

Collapse
8: pg_hba.conf (response to 5)
Posted by Sean Redmond on

How to most securely setup the user for the remote connection is an interesting but separate problem, so I think I'll start another thread on it.

Collapse
9: Re: pg_hba.conf (response to 8)
Posted by Jeff Davis on
Well, here is the code fragment from the postgres driver. If it's a bug it's an intentional one.
 if (!strcmp(host, "localhost")) {
            Ns_Log(Notice, "Opening %s on %s", db, host);
            pgConn = PQsetdbLogin(NULL, port, NULL, NULL, db, handle->user,
                                  handle->password);
        } else {
            Ns_Log(Notice, "Opening %s on %s, port %s", db, host, port);
            pgConn = PQsetdbLogin(host, port, NULL, NULL, db, handle->user,
                             handle->password);
        }
Maybe if we are connection because we have "localhost" we should try 127.0.0.1 if the unix domain socket fails.

I will ping Lamar Owen and see what he thinks...