Skip to content

Conversation

@joto
Copy link
Collaborator

@joto joto commented Dec 1, 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.

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. (Only works with PostgreSQL >9.5.)
@joto joto force-pushed the refactor-db-capabilities branch from 6bf9c3c to 2ed7e91 Compare December 1, 2022 14:29
- uses: actions/checkout@v3
- uses: ./.github/actions/ubuntu-prerequisites
- uses: ./.github/actions/build-and-test

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want to loose the test with gcc7?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I have put it back in.

PostgreSQL 9.5 has been marked as unsupported for a while, both by the
PostgreSQL itself as by us. This removes the build on Github action
which is failing now.
@joto joto force-pushed the refactor-db-capabilities branch from 2ed7e91 to cdc523d Compare December 2, 2022 09:11
@lonvia lonvia merged commit eff5b95 into osm2pgsql-dev:master Dec 5, 2022
@joto joto deleted the refactor-db-capabilities branch December 5, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants