Skip to content

Conversation

@joto
Copy link
Collaborator

@joto joto commented Aug 15, 2025

We are accessing data that doesn't exist if we don't get three rows from the SQL query.

If the PostGIS version could not be detected, we report that.

Fixes #2378

if (res.num_tuples() >= 2) {
capabilities().postgis = {std::stoi(std::string{res.get(0, 0)}),
std::stoi(std::string{res.get(1, 0)})};
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this return do something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry. Leftover from an earlier version. Fixed and new version force-pushed.

We are accessing data that doesn't exist if we don't get three
rows from the SQL query.

If the PostGIS version could not be detected, we report that.
@joto joto force-pushed the fix-postgis-check branch from 8d4b632 to 79bc89c Compare August 18, 2025 14:38
@lonvia lonvia merged commit c1fea70 into osm2pgsql-dev:master Aug 18, 2025
24 checks passed
@joto joto deleted the fix-postgis-check branch August 19, 2025 09:59
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.

Fix parsing of PostGIS version string

2 participants