Re: BUG #15418: pg_restore fails with [archiver (db)] could not execute query: ERROR: function XXXXX does not exist - Mailing list pgsql-bugs

From Sergei Kornilov
Subject Re: BUG #15418: pg_restore fails with [archiver (db)] could not execute query: ERROR: function XXXXX does not exist
Date
Msg-id 332441538573896@sas2-7b909973f402.qloud-c.yandex.net
Whole thread Raw
In response to BUG #15418: pg_restore fails with [archiver (db)] could not executequery: ERROR: function XXXXX does not exist  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15418: pg_restore fails with [archiver (db)] could notexecute query: ERROR: function XXXXX does not exist  (David Harper <adh@sanger.ac.uk>)
List pgsql-bugs
Hello
You have found wrong error root. Restore order is correct. Try with this function definition:

CREATE FUNCTION public.boxrange(bigint, bigint) RETURNS box
    LANGUAGE sql IMMUTABLE
    AS $_$SELECT box (public.create_point(0, $1), public.create_point($2,500000000))$_$;

It works now.
pg_restore (and pg_dump with plaintext format) set search_path to '' and this is reason why function was not found.
This was made to prevent security issue:
https://wiki.postgresql.org/wiki/A_Guide_to_CVE-2018-1058:_Protect_Your_Search_Path

regards, Sergei


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15418: pg_restore fails with [archiver (db)] could not executequery: ERROR: function XXXXX does not exist
Next
From: David Harper
Date:
Subject: Re: BUG #15418: pg_restore fails with [archiver (db)] could notexecute query: ERROR: function XXXXX does not exist