[Tile-serving] [openstreetmap/osm2pgsql] Allow conninfo string in -d/--database option (#1281)

Paul Norman notifications at github.com
Mon Oct 5 17:14:04 UTC 2020


@pnorman commented on this pull request.



>  std::string database_options_t::conninfo() const
 {
+    if (compare_prefix(db, "postgresql://") ||
+        compare_prefix(db, "postgres://")) {
+        return db;
+    }
+
     std::string out{"fallback_application_name='osm2pgsql'"};

Should this be above the block for `postgresql://` handling? We still want to set the fallback application name

>      std::string out{"fallback_application_name='osm2pgsql'"};
 
+    if (std::strchr(db.c_str(), '=') != nullptr) {

Would this cause problems with properly escaped DB names containing a =?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1281#pullrequestreview-502258130
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20201005/7e1e3714/attachment.htm>


More information about the Tile-serving mailing list