$OpenBSD: patch-Core_PostgreSQLConnection_cpp,v 1.3 2019/02/19 05:13:02 jeremy Exp $

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

Fix build with PostgreSQL 11.

Index: Core/PostgreSQLConnection.cpp
--- Core/PostgreSQLConnection.cpp.orig
+++ Core/PostgreSQLConnection.cpp
@@ -30,6 +30,7 @@
 // PostgreSQL includes
 #include <libpq-fe.h>
 #include <c.h>
+#include <postgresql/server/postgres.h>
 #include <catalog/pg_type.h>
 
 
@@ -79,8 +80,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
     {
