Skip to content

Confusing error when postigs extension is missing #1400

Closed
@lonvia

Description

@lonvia

When running osm2pgsql without naming a database via -d or PGDATABASE, then the version check prints a rather confusing message:

me@machine:~$ ./osm2pgsql -S ../default.style ~/osm/data/liechtenstein-latest.osm.pbf 
2021-01-29 17:54:41  osm2pgsql version 1.4.0 (1.4.0-82-gfd9c0c33)
2021-01-29 17:54:41  Database version: 11.9 (Debian 11.9-0+deb10u1)
2021-01-29 17:54:41  ERROR: Database error: ERROR:  function postgis_lib_version() does not exist
LINE 1: SELECT regexp_split_to_table(postgis_lib_version(), '\.')
                                     ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

The same happens when the database is right but the postgis extension is missing. We should print a more helpful message here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions