-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
bug 🐛Something isn't workingSomething isn't workinghelp wanted ⛏️Extra attention is neededExtra attention is needed
Description
Hello,
Creating a dump using pg_dump and later restoring it fails due to the following error:
ERROR: function h3_lat_lng_to_cell(point, integer) does not exist
LINE 1: SELECT h3_lat_lng_to_cell($1::point, $2);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
QUERY: SELECT h3_lat_lng_to_cell($1::point, $2);
CONTEXT: SQL function "h3_lat_lng_to_cell" during inlining
I believe this is due to the conjunction of two things:
- pg_dump setting
search_pathto an empty string in the dump it creates
[...]
SELECT pg_catalog.set_config('search_path', '', false);
[...]
- The definition of
h3_lat_lng_to_cellnot explicitly using the namespace of thepointtype (public)
CREATE OR REPLACE FUNCTION h3_lat_lng_to_cell(geometry, resolution integer) RETURNS h3index
AS $$ SELECT h3_lat_lng_to_cell($1::point, $2); $$ IMMUTABLE STRICT PARALLEL SAFE LANGUAGE SQL;
COMMENT ON FUNCTION
h3_lat_lng_to_cell(geometry, resolution integer)
IS 'Indexes the location at the specified resolution.';This is not an issue when one can modify the created dump (adding SET search_path TO "$user", public, topology; fixes it), however this causes issues in RDS for a database upgrade.
Not quite sure how to confirm that changing to $1::public.point would fix the problem.
If that helps, here's a the full SQL file created with pg_dump for a reproducible example.
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
CREATE TABLE public.foo (
bar public.geometry(Point,4326) NOT NULL
);
CREATE INDEX foo_h3_lat_lng_to_cell_idx ON public.foo USING btree (public.h3_lat_lng_to_cell(bar, 15));Let me know if you need anything else!
Metadata
Metadata
Assignees
Labels
bug 🐛Something isn't workingSomething isn't workinghelp wanted ⛏️Extra attention is neededExtra attention is needed