$OpenBSD: patch-Core_PostgreSQLConnection_cpp,v 1.2 2017/08/25 18:39:28 jasper Exp $

https://bitbucket.org/sjodogne/orthanc-postgresql/commits/11c4f0a4b64711dc8feefb22e8e73c28a639ffcc

Index: Core/PostgreSQLConnection.cpp
--- Core/PostgreSQLConnection.cpp.orig
+++ Core/PostgreSQLConnection.cpp
@@ -79,8 +79,18 @@ namespace OrthancPlugins
   {
     if (uri_.empty())
     {
-      return ("postgresql://" + username_ + ":" + password_ + "@" + 
-              host_ + ":" + boost::lexical_cast<std::string>(port_) + "/" + database_);
+      std::string actualUri = "postgresql://" + username_;
+      if (!password_.empty())
+      {
+        actualUri += ":" + password_;
+      }
+      actualUri += "@" + host_;
+      if (port_ > 0)
+      {
+        actualUri += ":" + boost::lexical_cast<std::string>(port_);
+      }
+      actualUri += "/" + database_;
+      return actualUri;
     }
     else
     {
