Re: "interesting" issue with restore from a pg_dump with a database-wide search_path

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Regina Obe" <lr(at)pcorp(dot)us>
Cc: "'Joshua D(dot) Drake'" <jd(at)commandprompt(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, "'Paul Ramsey'" <pramsey(at)cleverelephant(dot)ca>
Subject: Re: "interesting" issue with restore from a pg_dump with a database-wide search_path
Date: 2018-07-23 22:36:43
Message-ID: 5130.1532385403@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Regina Obe" <lr(at)pcorp(dot)us> writes:
> Sorry for not posting from the thread. Paul alerted me to this one and I am aware of the issue.

> 1) I do have fuzzstrmatch listed as a dependency in the control file. I know because I often install the geocoder with
> CREATE EXTENSION postgis_tiger_geocoder CASCADE;
> And it installs postgis and fuzzystrmatch

OK.

> a) In this particular case, I have a function that uses fuzzystrmatch and is used in functional indexes.
> I unfortunately can't schema qualify the use of soundex, because I don't know where the user may have installed fuzzystrmatch is installed
> b) Stephen Frost had suggested, perhaps we should have some syntax like @extension_loc(fuzzystrmatch)...@ so that one could reference an extension dependency location within a function without knowing where it is installed.

You don't really need any new syntax for this particular case, I think.
You can declare the function in the extension like this:

create function ... set search_path from current;

which will cause it to absorb the search path that's set while running
the extension script, which should be what you want.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Regina Obe 2018-07-23 22:56:30 RE: "interesting" issue with restore from a pg_dump with a database-wide search_path
Previous Message Kefan Yang 2018-07-23 22:21:01 RE: GSOC 2018 Project - A New Sorting Routine