[Tile-serving] [openstreetmap/osm2pgsql] Consolidate database capability checks (PR #1843)

Jochen Topf notifications at github.com
Thu Dec 1 09:45:04 UTC 2022


There were several places (pgsql.hpp, pgsql-capabilities.hpp, db-check.hpp) that had code to check various capabilities, version numbers etc. of the database we are connected to. This is now consolidated in pgsql-capabilities.hpp. It needs to be initialized once at program start by calling init_database_capabilities() with a database connection object. Checking version numbers or capabilities is then much easier, because no active database connection is needed any more.

This also adds code to get the list of supported index methods from the database which we will need shortly.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/1843

-- Commit Summary --

  * Consolidate database capability checks

-- File Changes --

    M src/CMakeLists.txt (1)
    D src/db-check.cpp (79)
    D src/db-check.hpp (21)
    M src/flex-table.cpp (8)
    M src/osm2pgsql.cpp (24)
    M src/pgsql-capabilities.cpp (158)
    M src/pgsql-capabilities.hpp (25)
    M src/pgsql-helper.cpp (12)
    M src/pgsql-helper.hpp (7)
    M src/pgsql.cpp (45)
    M src/pgsql.hpp (13)
    M src/table.cpp (3)
    M tests/common-pg.hpp (2)
    M tests/test-output-flex-schema.cpp (1)
    M tests/test-pgsql-capabilities.cpp (43)
    M tests/test-pgsql.cpp (7)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/1843.patch
https://github.com/openstreetmap/osm2pgsql/pull/1843.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1843
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/pull/1843 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20221201/5369cc4d/attachment.htm>


More information about the Tile-serving mailing list