changeset 10:3686ba3f9cdb

don't include password in connection string if it is empty; it's seems its not supported by some pg drivers
author am@osimis.io
date Mon, 09 Jul 2018 11:43:31 +0200
parents eff482803d30
children 0217486720b3
files .hgignore Framework/PostgreSQL/PostgreSQLParameters.cpp PostgreSQL/Plugins/IndexPlugin.cpp
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Mon Jul 09 11:43:31 2018 +0200
@@ -0,0 +1,4 @@
+build*
+PostgreSQL/CMakeLists.txt.user
+PostgreSQL/ThirdPartyDownloads/
+
--- a/Framework/PostgreSQL/PostgreSQLParameters.cpp	Mon Jul 09 08:36:20 2018 +0200
+++ b/Framework/PostgreSQL/PostgreSQLParameters.cpp	Mon Jul 09 11:43:31 2018 +0200
@@ -176,10 +176,14 @@
     {
       target = std::string("sslmode=disable") +  // TODO WHY SSL DOES NOT WORK? ("SSL error: wrong version number")
         " user=" + username_ + 
-        " password=" + password_ + 
         " host=" + host_ + 
         " port=" + boost::lexical_cast<std::string>(port_);
 
+      if (!password_.empty())
+      {
+        target += " password=" + password_;
+      }
+
       if (database_.size() > 0)
       {
         target += " dbname=" + database_;
--- a/PostgreSQL/Plugins/IndexPlugin.cpp	Mon Jul 09 08:36:20 2018 +0200
+++ b/PostgreSQL/Plugins/IndexPlugin.cpp	Mon Jul 09 11:43:31 2018 +0200
@@ -106,7 +106,7 @@
 
   ORTHANC_PLUGINS_API void OrthancPluginFinalize()
   {
-    LOG(WARNING) << "PostgreSQL storage area is finalizing";
+    LOG(WARNING) << "PostgreSQL index area is finalizing";
     backend_.reset(NULL);
   }