[Tile-serving] [openstreetmap/osm2pgsql] New PostGIS check breaks CockroachDB compatibility (#1412)

Stephan notifications at github.com
Fri Feb 12 08:36:03 UTC 2021


osm2pgsql checks for existence of the postgis extension and its version. PostgreSQL stores extensions in a dedicated table. This queries for it:

    SELECT regexp_split_to_table(extversion, '\\.') FROM pg_extension WHERE extname='postgis';

If CockroachDB should be supported it has to publish existence of the plugin and its version.

I had a very short look into the documentation. For me it looks like CockroachDB is not using postgis at all, but re-implemented the functions. There is a meta-issue in Github mentioning over 100 implementations missing: 

https://www.cockroachlabs.com/docs/v20.2/known-limitations#spatial-support-limitations

linking to Github: https://github.com/cockroachdb/cockroach/issues/49203

So as compatibility with CockroachDB then depends not on the version of Postgis, but on the main version of CockroachDB a potential fix would have to distinguish between PostgreSQL and CockroachDB. And for CockroachDB check its version against a version tested to be compatible.

    SELECT version();


With the spatial implementation differing, I would expect subtle differences in behavior.

The query for postgis version is fake:

> https://www.cockroachlabs.com/docs/v20.2/functions-and-operators.html
> 
> postgis_lib_version() → string | Compatibility placeholder function with PostGIS. Returns a fixed string based on PostGIS 3.0.1, with minor edits.
> -- | --
> 

Whoever intents do submit a PR should keep this in mind.

-- 
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/issues/1412#issuecomment-778056527
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20210212/e80049c6/attachment.htm>


More information about the Tile-serving mailing list