Re: Dump/Reload broken with relocatable extensions

From: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
To:
Cc: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dump/Reload broken with relocatable extensions
Date: 2013-09-20 08:09:45
Message-ID: 523C02C9.9010503@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/19/2013 11:40 PM, Dimitri Fontaine wrote:
> Vik Fearing <vik(dot)fearing(at)dalibo(dot)com> writes:
>> I don't know if this has been discussed before, a cursory search of the
>> archives didn't turn up anything interesting. I perhaps didn't put in
>> the right keywords.
> For others not to spend too much time on this: it seems like a problem
> with the extension not abiding by the rules about its relocatable
> property and the @extschema@ thingy.
>
> http://www.postgresql.org/docs/9.3/static/extend-extensions.html#AEN54999

I can't get this to work. If I modify my function to be

CREATE FUNCTION no_accents(text)
RETURNS boolean
AS 'select $1 = unaccent($1);'
LANGUAGE sql STABLE STRICT
SET search_path = '@extschema@';

then I get

d=# create extension unaccent;
ERROR: function unaccent(text) does not exist
LINE 1: select $1 = unaccent($1);
^
HINT: No function matches the given name and argument types. You might
need to add explicit type casts.
QUERY: select $1 = unaccent($1);

If I modify it to be

CREATE FUNCTION no_accents(text)
RETURNS boolean
AS 'select $1 = unaccent($1);'
LANGUAGE sql STABLE STRICT;
ALTER FUNCTION no_accents(text) SET search_path = '@extschema@';

then I get the same restore problem I originally described.

What am I doing wrong?

--
Vik

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Farina 2013-09-20 08:11:37 Re: pg_stat_statements: calls under-estimation propagation
Previous Message Amit Kapila 2013-09-20 07:41:57 Re: Minor inheritance/check bug: Inconsistent behavior