Re: pg_upgrade fails saying function unaccent(text) doesn't exist

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Gunnlaugur Thor Briem <gunnlaugur(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade fails saying function unaccent(text) doesn't exist
Date: 2018-08-29 19:06:35
Message-ID: 20180829190635.GD25450@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wed, Aug 29, 2018 at 06:09:53PM +0000, Gunnlaugur Thor Briem wrote:
> Hi,
>
> I'm trying to upgrade an old PG 9.4 cluster to PG 10, and it's failing on
> creating an index that uses the unaccent(text) function.
>
> That function is part of the unaccent extension, which is installed in the old
> DB cluster. I expect pg_upgrade to create that extension as part of the
> upgrade. It does create other extensions that are installed in the old DB
> cluster. I don't get why this one isn't included.

This is caused by security changes made in PG 10.3 and other minor
releases. Please see this thread for an outline of the issue:

https://www.postgresql.org/message-id/flat/152106914669.1223.5104148605998271987%40wrigleys.postgresql.org

I think you have to change your index function to specify the schema
name before the unacces function call, e.g.

SELECT lower(public.unaccent(btrim(regexp_replace(

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2018-08-29 20:50:03 Re: WAL replay issue from 9.6.8 to 9.6.10
Previous Message TalGloz 2018-08-29 18:23:02 Re: Executing a Function with an INSERT INTO command fails

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-08-29 19:15:26 Re: rare crash - FailedAssertion snapbuild.c Line: 580
Previous Message Robert Haas 2018-08-29 18:23:58 Re: FailedAssertion on partprune