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

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Gunnlaugur Thor Briem <gunnlaugur(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade fails saying function unaccent(text) doesn't exist
Date: 2018-08-31 14:14:18
Message-ID: 2b69e74d-566b-3d0a-1edd-5b5066d4d01e@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 08/30/2018 09:03 AM, Gunnlaugur Thor Briem wrote:
> \dFd unaccent
> List of text search dictionaries
>  Schema |   Name   | Description
> --------+----------+-------------
>  public | unaccent |
> (1 row)
>
> \dFd+ unaccent
>                     List of text search dictionaries
>  Schema |   Name   |    Template     |    Init options    | Description
> --------+----------+-----------------+--------------------+-------------
>  public | unaccent | public.unaccent | rules = 'unaccent' |
> (1 row)
>
> Cheers,
> Gulli
>

I could not replicate with simple case:

select version();
version

------------------------------------------------------------------------------------
PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (SUSE Linux)
4.8.5, 64-bit

CREATE OR REPLACE FUNCTION public.semantic_normalize(title text)
RETURNS text
LANGUAGE sql
AS $function$
SELECT lower(unaccent(btrim(regexp_replace($1,
'\s+', ' ', 'g'), ' "')))
$function$

CREATE TABLE unaccent_test(title text);

INSERT INTO unaccent_test values ('Hukić'), ('Böttcher'), ('ÀÁÂÃÄÅ'),
('électro');

CREATE INDEX ix_semantic_normalize_title on unaccent_test(title);

VACUUM ANALYZE unaccent_test;
VACUUM

vacuumdb -U postgres -z -t unaccent_test test
vacuumdb: vacuuming database "test"

The only thing I can think of is that you have an older version of
vacuumdb that is not aware of the schema specification changes in the
newer versions of Postgrse.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mate Varga 2018-08-31 14:15:19 Re: very slow largeobject transfers through JDBC
Previous Message Dmitry Igrishin 2018-08-31 13:58:48 Re: very slow largeobject transfers through JDBC

Browse pgsql-hackers by date

  From Date Subject
Next Message Adrian Klaver 2018-08-31 14:17:06 Re: pg_upgrade fails saying function unaccent(text) doesn't exist
Previous Message Tom Lane 2018-08-31 13:59:40 Re: Hint to set owner for tablespace directory