Changeset 902


Ignore:
Timestamp:
Jan 6, 2017, 11:31:57 AM (3 years ago)
Author:
cito
Message:

Fix an issue with connection.host under Postgres 9.6

PQhost can now return a directory path if the connection is via Unix socket.
However, we want to return 'localhost' as host, as it used to be before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pgmodule.c

    r877 r902  
    34853485        {
    34863486                char *r = PQhost(self->cnx);
    3487                 if (!r)
     3487                if (!r || r[0] == '/') /* Pg 9.6 can return a Unix socket path */
    34883488                        r = "localhost";
    34893489                return PyStr_FromString(r);
Note: See TracChangeset for help on using the changeset viewer.