aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-connect.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2014-04-19 08:41:51 -0400
committerBruce Momjian <bruce@momjian.us>2014-04-19 08:41:51 -0400
commit13ecb822e8da5668133b706474c25bc908ae370a (patch)
treebf80faa006fbf9b60cbdb245bcecd9c9a464f099 /src/interfaces/libpq/fe-connect.c
parent66b1084e2ccf1f5b8cb57ebb41f54f76850a2b5d (diff)
downloadpostgresql-13ecb822e8da5668133b706474c25bc908ae370a.tar.gz
postgresql-13ecb822e8da5668133b706474c25bc908ae370a.zip
libpq: have PQconnectdbParams() and PQpingParams accept "" as default
Previously, these functions treated "" optin values as defaults in some ways, but not in others, like when comparing to .pgpass. Also, add documentation to clarify that now "" and NULL use defaults, like PQsetdbLogin() has always done. BACKWARD INCOMPATIBILITY Patch by Adrian Vondendriesch, docs by me Report by Jeff Janes
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r--src/interfaces/libpq/fe-connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 3909367be6f..0791774af78 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -4357,7 +4357,7 @@ conninfo_array_parse(const char *const * keywords, const char *const * values,
const char *pname = keywords[i];
const char *pvalue = values[i];
- if (pvalue != NULL)
+ if (pvalue != NULL && pvalue[0] != '\0')
{
/* Search for the param record */
for (option = options; option->keyword != NULL; option++)