From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: sk@zsrv.org
Subject: BUG #15530: unable restore index on function from earthdistance contrib
Date: Fri, 30 Nov 2018 11:46:01 +0000
Message-ID: <15530-3dc5f66205393dc0@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15530
Logged by: Sergei Kornilov
Email address: sk@zsrv.org
PostgreSQL version: 11.1
Operating system: Linux Debian
Description:
Hello
We have some immutable language SQL functions in earthdistance contrib
module. So we can build indexes on this functions. But it is unable to
restore such indexes from dump due search_path restrictions in pg_dump.
Simple reproducer is:
SELECT pg_catalog.set_config('search_path', '', false);
CREATE EXTENSION IF NOT EXISTS cube WITH SCHEMA public;
CREATE EXTENSION IF NOT EXISTS earthdistance WITH SCHEMA public;
CREATE TABLE public.points (
id integer NOT NULL,
name character varying(255) NOT NULL,
lng double precision NOT NULL,
lat double precision NOT NULL
);
CREATE INDEX points_coordinates ON public.points USING gist
(public.ll_to_earth(lat, lng));
With error on last line:
> ERROR: type "earth" does not exist
> LINE 1: ...ians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth
> ^
> QUERY: SELECT
cube(cube(cube(earth()*cos(radians($1))*cos(radians($2))),earth()*cos(radians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth
> CONTEXT: SQL function "ll_to_earth" during inlining
Seems to be broken in all supported versions. I checked on fresh HEAD, 11.1
and 10.6.
How can we fix this? Extension is marked as relocatable
regards, Sergei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, sk@zsrv.org
Subject: Re: BUG #15530: unable restore index on function from earthdistance contrib
In-Reply-To: <15530-3dc5f66205393dc0@postgresql.org>
References: <15530-3dc5f66205393dc0@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox