Index: fe-connect.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v retrieving revision 1.339 diff -c -r1.339 fe-connect.c *** fe-connect.c 21 Nov 2006 16:28:00 -0000 1.339 --- fe-connect.c 16 Dec 2006 03:47:08 -0000 *************** *** 567,572 **** --- 567,573 ---- const char *pwd) { PGconn *conn; + char *conninit = ""; /* * Allocate memory for the conn structure *************** *** 575,585 **** if (conn == NULL) return NULL; /* ! * Parse an empty conninfo string in order to set up the same defaults ! * that PQconnectdb() would use. */ ! if (!connectOptions1(conn, "")) return conn; /* --- 576,595 ---- if (conn == NULL) return NULL; + /* + * Have we got something that might be a conninfo string? + */ + if (dbName && strchr(dbName,'=')) + { + conninit = (char *) dbName; + } + /* ! * Parse a string in order to set up the same defaults ! * that PQconnectdb() would use. Use the info string if we ! * found it, ortherwise an empty string. */ ! if (!connectOptions1(conn, conninit)) return conn; /* *************** *** 613,619 **** conn->pgtty = strdup(pgtty); } ! if (dbName && dbName[0] != '\0') { if (conn->dbName) free(conn->dbName); --- 623,630 ---- conn->pgtty = strdup(pgtty); } ! /* Skip the dbname param if we already usaed it as conninfo */ ! if (!*conninit && dbName && dbName[0] != '\0') { if (conn->dbName) free(conn->dbName);