pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_upgrade fails saying function unaccent(text) doesn't exist
7+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2018-09-06 a5322ca10f 23aad181f4 594ee1ada5 c79b39fb1c d4ab396261 25ff97ba77 a54f5b187a  Make contrib/unaccent's unaccent() function work when not in search path.
* pg_upgrade fails saying function unaccent(text) doesn't exist
@ 2018-08-29 18:09  Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Gunnlaugur Thor Briem @ 2018-08-29 18:09 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

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.

Here are the commands I run, and their output:

----- snip -----
$ sudo rm -rf /opt/local/var/db/postgresql10/defaultdb

$ sudo mkdir -p /opt/local/var/db/postgresql10/defaultdb

$ sudo chown postgres:postgres /opt/local/var/db/postgresql10/defaultdb

$ sudo su postgres -c '/opt/local/lib/postgresql10/bin/initdb -D
/opt/local/var/db/postgresql10/defaultdb --locale en_US.UTF-8'
The files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory
/opt/local/var/db/postgresql10/defaultdb ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /opt/local/lib/postgresql10/bin/pg_ctl -D
/opt/local/var/db/postgresql10/defaultdb -l logfile start

$ sudo su postgres -c '/opt/local/lib/postgresql10/bin/pg_upgrade
--old-bindir /opt/local/lib/postgresql94/bin --old-datadir
/opt/local/var/db/postgresql94/defaultdb --new-bindir
/opt/local/lib/postgresql10/bin --new-datadir
/opt/local/var/db/postgresql10/defaultdb'Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is the install user                  ok
Checking database connection settings                       ok
Checking for prepared transactions                          ok
Checking for reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Checking for invalid "unknown" user columns                 ok
Checking for roles starting with "pg_"                      ok
Creating dump of global objects                             ok
Creating dump of database schemas
                                                            ok
Checking for presence of required libraries                 ok
Checking database user is the install user                  ok
Checking for prepared transactions                          ok

If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.

Performing Upgrade
------------------
Analyzing all rows in the new cluster                       ok
Freezing all rows in the new cluster                        ok
Deleting files from new pg_xact                             ok
Copying old pg_clog to new server                           ok
Setting next transaction ID and epoch for new cluster       ok
Deleting files from new pg_multixact/offsets                ok
Copying old pg_multixact/offsets to new server              ok
Deleting files from new pg_multixact/members                ok
Copying old pg_multixact/members to new server              ok
Setting next multixact ID and offset for new cluster        ok
Resetting WAL archives                                      ok
Setting frozenxid and minmxid counters in new cluster       ok
Restoring global objects in the new cluster                 ok
Restoring database schemas in the new cluster
  dm_test
*failure*

Consult the last few lines of "pg_upgrade_dump_409041.log" for
the probable cause of the failure.
Failure, exiting
----- snip -----

And here is that pg_upgrade_dump_409041.log file:

----- snip -----
command: "/opt/local/lib/postgresql10/bin/pg_dump" --host /private/tmp
--port 50432 --username postgres --schema-only --quote-all-identifiers
--binary-upgrade --format=custom  --file="pg_upgrade_dump_409041.custom"
'dbname=dm_test' >> "pg_upgrade_dump_409041.log" 2>&1


command: "/opt/local/lib/postgresql10/bin/pg_restore" --host /private/tmp
--port 50432 --username postgres --exit-on-error --verbose --dbname
'dbname=dm_test' "pg_upgrade_dump_409041.custom" >>
"pg_upgrade_dump_409041.log" 2>&1
pg_restore: connecting to database for restore
pg_restore: creating pg_largeobject "pg_largeobject"
pg_restore: creating pg_largeobject_metadata "pg_largeobject_metadata"
pg_restore: creating SCHEMA "acl_admin"
pg_restore: creating COMMENT "SCHEMA "acl_admin""
pg_restore: creating SCHEMA "public"
pg_restore: creating COMMENT "SCHEMA "public""
pg_restore: creating EXTENSION "fuzzystrmatch"
pg_restore: creating COMMENT "EXTENSION "fuzzystrmatch""
pg_restore: creating EXTENSION "hstore"
pg_restore: creating COMMENT "EXTENSION "hstore""
pg_restore: creating EXTENSION "sslinfo"
pg_restore: creating COMMENT "EXTENSION "sslinfo""
pg_restore: creating TYPE "public.dataimport_job_state"
pg_restore: creating TYPE "public.dblink_pkey_results"...
[...]
pg_restore: creating INDEX "public.ix_semantic_mapping_lower_title"
pg_restore: creating INDEX "public.ix_semantic_mapping_normalize_title"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 5240; 1259 427215 INDEX
ix_semantic_mapping_normalize_title dm_admin
pg_restore: [archiver (db)] could not execute query: ERROR:  function
unaccent(text) does not exist
LINE 2:   SELECT lower(unaccent(btrim(regexp_replace($1, '\s+', ' ',...
                       ^
HINT:  No function matches the given name and argument types. You might
need to add explicit type casts.
QUERY:
  SELECT lower(unaccent(btrim(regexp_replace($1, '\s+', ' ', 'g'), ' "')))

CONTEXT:  SQL function "semantic_normalize" during inlining
    Command was:
-- For binary upgrade, must preserve pg_class oids
SELECT
pg_catalog.binary_upgrade_set_next_index_pg_class_oid('427215'::pg_catalog.oid);

CREATE INDEX "ix_semantic_mapping_normalize_title" ON
"public"."semantic_mapping" USING "btree"
("public"."semantic_normalize"("title"));
----- snip -----

These occurrences of unaccent at the end are the only ones in the file:

$ sudo grep -n unaccent  pg_upgrade_dump_409041.log g
1713:pg_restore: [archiver (db)] could not execute query: ERROR:  function
unaccent(text) does not exist
1714:LINE 2:   SELECT lower(unaccent(btrim(regexp_replace($1, '\s+', ' ',...
1718:  SELECT lower(unaccent(btrim(regexp_replace($1, '\s+', ' ', 'g'), '
"')))

Here is the definition of that index in the old DB:

\d ix_semantic_mapping_normalize_title
  Index "public.ix_semantic_mapping_normalize_title"
       Column       | Type |        Definition
--------------------+------+---------------------------
 semantic_normalize | text | semantic_normalize(title)
btree, for table "public.semantic_mapping"

and the semantic_normalize function it uses:

\x \df+ semantic_normalize
Expanded display is on.
List of functions
-[ RECORD 1
]-------+---------------------------------------------------------------------------
Schema              | public
Name                | semantic_normalize
Result data type    | text
Argument data types | title text
Type                | normal
Volatility          | immutable
Owner               | dm_admin
Security            | invoker
Access privileges   |
Language            | sql
Source code
|
+
                    |   SELECT lower(unaccent(btrim(regexp_replace($1,
'\s+', ' ', 'g'), ' "')))+
                    |
Description         |

Any more information I can provide, to help troubleshoot this?

Cheers,
Gulli

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_upgrade fails saying function unaccent(text) doesn't exist
@ 2018-08-29 19:06  Bruce Momjian <bruce@momjian.us>
  parent: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Bruce Momjian @ 2018-08-29 19:06 UTC (permalink / raw)
  To: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>; +Cc: pgsql-general@lists.postgresql.org

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.postgres...

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@momjian.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 +




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_upgrade fails saying function unaccent(text) doesn't exist
@ 2018-08-30 09:24  Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Gunnlaugur Thor Briem @ 2018-08-30 09:24 UTC (permalink / raw)
  To: bruce@momjian.us; +Cc: pgsql-general@lists.postgresql.org

Thank you! That got the pg_upgrade to completion. But then during
./analyze_new_cluster.sh vacuum fails thus:

vacuumdb: processing database "dm_test": Generating minimal optimizer
statistics (1 target)
vacuumdb: vacuuming of database "dm_test" failed: ERROR:  text search
dictionary "unaccent" does not exist
CONTEXT:  SQL function "semantic_normalize" statement 1

And yet a text search dictionary with that name does exist:

$ psql -d dm_test -c '\dFd+ unaccent'
                    List of text search dictionaries
 Schema |   Name   |    Template     |    Init options    | Description
--------+----------+-----------------+--------------------+-------------
 public | unaccent | public.unaccent | rules = 'unaccent' |
(1 row)

Running VACUUM ANALYZE semantic_mapping in psql works:

$ psql -d dm_test -c 'VACUUM ANALYZE semantic_mapping'
VACUUM
Time: 1231,767 ms (00:01,232)

But running it with the vacuumdb command doesn't:

vacuumdb -z -t semantic_mapping dm_test
vacuumdb: vacuuming database "dm_test"
vacuumdb: vacuuming of table "semantic_mapping" in database "dm_test"
failed: ERROR:  text search dictionary "unaccent" does not exist
CONTEXT:  SQL function "semantic_normalize" statement 1

This is presumably a similar search path problem, because I can reproduce
this in psql by setting the search path to exclude public:

set search_path to "$user";
vacuum analyze public.semantic_mapping;
ERROR:  text search dictionary "unaccent" does not exist
CONTEXT:  SQL function "semantic_normalize" statement 1
Time: 851,562 ms

Can't find a place to poke the "public." prefix in to work around this ...
I can't even see where it's getting the link to the text search dictionary
from. Is that in native code in the unaccent extension?

The unaccent definition looks like this:

\df+ public.unaccent

List of functions
 Schema |   Name   | Result data type | Argument data types |  Type  |
Volatility | Parallel | Owner | Security | Access privileges | Language |
Source code  | Description
--------+----------+------------------+---------------------+--------+------------+----------+-------+----------+-------------------+----------+---------------+-------------
 public | unaccent | text             | regdictionary, text | normal |
stable     | safe     | gthb  | invoker  |                   | c        |
unaccent_dict |
 public | unaccent | text             | text                | normal |
stable     | safe     | gthb  | invoker  |                   | c        |
unaccent_dict |
(2 rows)

Any tips?

Cheers,
Gulli

On Wed, Aug 29, 2018 at 7:06 PM Bruce Momjian <bruce@momjian.us> wrote:

> 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.postgres...
>
> 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@momjian.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 +
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_upgrade fails saying function unaccent(text) doesn't exist
@ 2018-08-30 13:48  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Adrian Klaver @ 2018-08-30 13:48 UTC (permalink / raw)
  To: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>; bruce@momjian.us; +Cc: pgsql-general@lists.postgresql.org

On 08/30/2018 02:24 AM, Gunnlaugur Thor Briem wrote:
> Thank you! That got the pg_upgrade to completion. But then during 
> ./analyze_new_cluster.sh vacuum fails thus:
> 
> vacuumdb: processing database "dm_test": Generating minimal optimizer 
> statistics (1 target)
> vacuumdb: vacuuming of database "dm_test" failed: ERROR:  text search 
> dictionary "unaccent" does not exist
> CONTEXT:  SQL function "semantic_normalize" statement 1
> 
> And yet a text search dictionary with that name does exist:
> 
> $ psql -d dm_test -c '\dFd+ unaccent'
>                      List of text search dictionaries
>   Schema |   Name   |    Template     |    Init options    | Description
> --------+----------+-----------------+--------------------+-------------
>   public | unaccent | public.unaccent | rules = 'unaccent' |
> (1 row)
> 
> Running VACUUM ANALYZE semantic_mapping in psql works:
> 
> $ psql -d dm_test -c 'VACUUM ANALYZE semantic_mapping'
> VACUUM
> Time: 1231,767 ms (00:01,232)
> 
> But running it with the vacuumdb command doesn't:
> 
> vacuumdb -z -t semantic_mapping dm_test
> vacuumdb: vacuuming database "dm_test"
> vacuumdb: vacuuming of table "semantic_mapping" in database "dm_test" 
> failed: ERROR:  text search dictionary "unaccent" does not exist
> CONTEXT:  SQL function "semantic_normalize" statement 1
> 
> This is presumably a similar search path problem, because I can 
> reproduce this in psql by setting the search path to exclude public:
> 
> set search_path to "$user";
> vacuum analyze public.semantic_mapping;
> ERROR:  text search dictionary "unaccent" does not exist
> CONTEXT:  SQL function "semantic_normalize" statement 1
> Time: 851,562 ms
> 
> Can't find a place to poke the "public." prefix in to work around this 
> ... I can't even see where it's getting the link to the text search 
> dictionary from. Is that in native code in the unaccent extension?

Since the semantic_normalize function is tripping it and it uses 
unaccent I would say it is native to the extension.

What does:

\dFd unaccent

show?

> 
> The unaccent definition looks like this:
> 
> \df+ public.unaccent
>                                                                                List of functions
>   Schema |   Name   | Result data type | Argument data types |  Type  | 
> Volatility | Parallel | Owner | Security | Access privileges | Language 
> |  Source code  | Description
> --------+----------+------------------+---------------------+--------+------------+----------+-------+----------+-------------------+----------+---------------+-------------
>   public | unaccent | text             | regdictionary, text | normal | 
> stable     | safe     | gthb  | invoker  |                   | c        
> | unaccent_dict |
>   public | unaccent | text             | text                | normal | 
> stable     | safe     | gthb  | invoker  |                   | c        
> | unaccent_dict |
> (2 rows)
> 
> Any tips?
> 
> Cheers,
> Gulli
> 
> On Wed, Aug 29, 2018 at 7:06 PM Bruce Momjian <bruce@momjian.us 
> <mailto:bruce@momjian.us>> wrote:
> 
>     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.postgres...
> 
>     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@momjian.us <mailto:bruce@momjian.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 +
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_upgrade fails saying function unaccent(text) doesn't exist
@ 2018-08-30 16:03  Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 2 replies; 7+ messages in thread

From: Gunnlaugur Thor Briem @ 2018-08-30 16:03 UTC (permalink / raw)
  To: adrian.klaver@aklaver.com; +Cc: Bruce Momjian <bruce@momjian.us>; pgsql-general@lists.postgresql.org

\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

On Thu, Aug 30, 2018 at 1:48 PM Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

> On 08/30/2018 02:24 AM, Gunnlaugur Thor Briem wrote:
> > Thank you! That got the pg_upgrade to completion. But then during
> > ./analyze_new_cluster.sh vacuum fails thus:
> >
> > vacuumdb: processing database "dm_test": Generating minimal optimizer
> > statistics (1 target)
> > vacuumdb: vacuuming of database "dm_test" failed: ERROR:  text search
> > dictionary "unaccent" does not exist
> > CONTEXT:  SQL function "semantic_normalize" statement 1
> >
> > And yet a text search dictionary with that name does exist:
> >
> > $ psql -d dm_test -c '\dFd+ unaccent'
> >                      List of text search dictionaries
> >   Schema |   Name   |    Template     |    Init options    | Description
> > --------+----------+-----------------+--------------------+-------------
> >   public | unaccent | public.unaccent | rules = 'unaccent' |
> > (1 row)
> >
> > Running VACUUM ANALYZE semantic_mapping in psql works:
> >
> > $ psql -d dm_test -c 'VACUUM ANALYZE semantic_mapping'
> > VACUUM
> > Time: 1231,767 ms (00:01,232)
> >
> > But running it with the vacuumdb command doesn't:
> >
> > vacuumdb -z -t semantic_mapping dm_test
> > vacuumdb: vacuuming database "dm_test"
> > vacuumdb: vacuuming of table "semantic_mapping" in database "dm_test"
> > failed: ERROR:  text search dictionary "unaccent" does not exist
> > CONTEXT:  SQL function "semantic_normalize" statement 1
> >
> > This is presumably a similar search path problem, because I can
> > reproduce this in psql by setting the search path to exclude public:
> >
> > set search_path to "$user";
> > vacuum analyze public.semantic_mapping;
> > ERROR:  text search dictionary "unaccent" does not exist
> > CONTEXT:  SQL function "semantic_normalize" statement 1
> > Time: 851,562 ms
> >
> > Can't find a place to poke the "public." prefix in to work around this
> > ... I can't even see where it's getting the link to the text search
> > dictionary from. Is that in native code in the unaccent extension?
>
> Since the semantic_normalize function is tripping it and it uses
> unaccent I would say it is native to the extension.
>
> What does:
>
> \dFd unaccent
>
> show?
>
> >
> > The unaccent definition looks like this:
> >
> > \df+ public.unaccent
> >
>
> List of functions
> >   Schema |   Name   | Result data type | Argument data types |  Type  |
> > Volatility | Parallel | Owner | Security | Access privileges | Language
> > |  Source code  | Description
> >
> --------+----------+------------------+---------------------+--------+------------+----------+-------+----------+-------------------+----------+---------------+-------------
> >   public | unaccent | text             | regdictionary, text | normal |
> > stable     | safe     | gthb  | invoker  |                   | c
> > | unaccent_dict |
> >   public | unaccent | text             | text                | normal |
> > stable     | safe     | gthb  | invoker  |                   | c
> > | unaccent_dict |
> > (2 rows)
> >
> > Any tips?
> >
> > Cheers,
> > Gulli
> >
> > On Wed, Aug 29, 2018 at 7:06 PM Bruce Momjian <bruce@momjian.us
> > <mailto:bruce@momjian.us>> wrote:
> >
> >     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.postgres...
> >
> >     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@momjian.us <mailto:bruce@momjian.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 +
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_upgrade fails saying function unaccent(text) doesn't exist
@ 2018-08-31 14:14  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Adrian Klaver @ 2018-08-31 14:14 UTC (permalink / raw)
  To: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; pgsql-general@lists.postgresql.org

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.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_upgrade fails saying function unaccent(text) doesn't exist
@ 2018-08-31 14:17  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Adrian Klaver @ 2018-08-31 14:17 UTC (permalink / raw)
  To: Gunnlaugur Thor Briem <gunnlaugur@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; pgsql-general@lists.postgresql.org

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
> 

Forgot to add to previous post:

\dx unaccent
                        List of installed extensions
    Name   | Version | Schema |                 Description
----------+---------+--------+---------------------------------------------
  unaccent | 1.1     | public | text search dictionary that removes accents



-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2018-08-31 14:17 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29 18:09 pg_upgrade fails saying function unaccent(text) doesn't exist Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
2018-08-29 19:06 ` Bruce Momjian <bruce@momjian.us>
2018-08-30 09:24   ` Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
2018-08-30 13:48     ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-08-30 16:03       ` Gunnlaugur Thor Briem <gunnlaugur@gmail.com>
2018-08-31 14:14         ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-08-31 14:17         ` Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox