-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating from v3.7.2 to v4.0.0 breaks some functions #86
Comments
List of affected functions:
|
That's bad, but also great! This must be the same problem as #47. Do you (or someone else) know how to properly rename functions in update scripts? Am I forced to remove and re-create them if the C function names change? |
I think,
So this is the correct way of changing a definition of existing function. Since C symbol name is explicitly stored in @Komzpa may be you know for sure? |
The best way we found in PostGIS to handle C level renames is to stub+deprecate the old C name and drop the old function and to create a new one. The stubs: https://github.com/postgis/postgis/blob/master/postgis/postgis_legacy.c Really, we never ever change the C names of the functions, that's one reason why they're in various styles in PostGIS - only create new and deprecate old. The reason why you want to stub out the old C name as that on Postgres version upgrade pg_upgrade may not let you upgrade both extension and cluster at the same time if a C function is missing in new library. A highly-enterprisey way would be also to move the old function to some h3_legacy_compat extension (I hope you don't, but maybe in some other place that will be useful). |
Do the new changes mean that the functions no longer work with geometry types? Using the example in the documentation I see this behavior. SELECT h3_lat_lng_to_cell(POINT('37.3615593,-122.0553238'), 5);
h3_lat_lng_to_cell
--------------------
85e35e73fffffff
(1 row) This works as expected, but that requires the data to be pulled in as a string of long/lat. That won't work for points stored as geometry as seen here. SELECT h3_lat_lng_to_cell(ST_SetSRID(ST_MakePOINT(37.3615593,-122.0553238), 4326), 5);
ERROR: function h3_lat_lng_to_cell(geometry, integer) does not exist
LINE 1: SELECT h3_lat_lng_to_cell(ST_SetSRID(ST_MakePOINT(37.3615593...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts. With 3.7.2, Similarly, |
As part of 4.0.0, I have extracted the postgis/geometry integration into its own extension, Depending on how you are installing, you might only need to run I need to be clearer about this in the README, since most people is going to want to install that along side the base extension. |
I had no clue h3_postgis existed. Cool idea. Are the function names the same as the new API and you provide geometry objects? |
Many of the function names changed as part of They are all listed in the auto-generated docs at: https://pgxn.org/dist/h3/docs/api.html#PostGIS.Integration Most functions should support both geometry and geography. |
That's huge. I froze to an earlier version because I couldn't use geometry, but now I'm going to try this other extension. Thanks! |
Functions that are renamed and not re-created in
h3--3.7.2--4.0.0.sql
are left linked to old C function names, that are no longer available.To reproduce:
select h3_polygon_to_cells(st_setsrid(st_geomfromtext('POLYGON ((30 60, 31 60, 31 61, 30 61, 30 60))'),4326)::polygon, array[]::polygon[], 8)
:[42883] ERROR: could not find function "h3_polyfill" in file "/usr/local/pgsql/lib/h3.so"
The text was updated successfully, but these errors were encountered: