Comment 13 for bug 1501781

Revision history for this message
Blake GH (bmagic) wrote :

Loaded this code and there is a problem setting up the db:
Results of this command:
#
perl Open-ILS/src/support-scripts/eg_db_config --update-config \
       --service all --create-database --create-schema --create-offline \
       --user evergreen --password dapassword --hostname ipaddress --port 5432 \
       --database evergreen --admin-user gadmin --admin-pass admin --load-all-sample
....
...
CREATE INDEX
psql:005.schema.actors.sql:85: ERROR: function evergreen.unaccent_and_squash(text) does not exist
LINE 1: ...r_usr_first_given_name_unaccent_idx ON actor.usr (evergreen....
                                                             ^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
psql:005.schema.actors.sql:86: ERROR: current transaction is aborted, commands ignored until end of transaction block

It looks like those index calls need to happen after that function is created:

CREATE INDEX actor_usr_first_given_name_unaccent_idx ON actor.usr (evergreen.unaccent_and_squash(first_given_name));
CREATE INDEX actor_usr_second_given_name_unaccent_idx ON actor.usr (evergreen.unaccent_and_squash(second_given_name));
CREATE INDEX actor_usr_family_name_unaccent_idx ON actor.usr (evergreen.unaccent_and_squash(family_name));

I will go ahead and remove those lines from 005.schema.actors.sql and manually run those after the database is setup.

Now I have issues adding the index:

CREATE INDEX actor_usr_first_given_name_unaccent_idx ON actor.usr (evergreen.unaccent_and_squash(first_given_name::text));
ERROR: function evergreen.unaccent(text) does not exist
LINE 1: SELECT evergreen.lowercase(evergreen.unaccent(regexp_replace...
                                   ^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

My DB doesn't have a function called "unaccent" in the evergreen schema. Where is the code for that function?
I guess this bug wont be loaded for bug squashing day