Upon enabling Transliteration on a test install, I get the following errors:

  • warning: pg_query() [function.pg-query]: Query failed: ERROR: language "plpgsql" does not exist
    HINT: Use CREATE LANGUAGE to load the language into the database. in /srv/http/localhost/htdocs/comics/includes/database.pgsql.inc on line 139.
  • user warning:
    query: CREATE OR REPLACE FUNCTION substring_index(text, text, integer)
    RETURNS text AS $$
    DECLARE
    tokens text[];
    BEGIN
    tokens := pg_catalog.string_to_array($1, $2);

    IF $3 >= 0 THEN
    RETURN pg_catalog.array_to_string(tokens[1:$3], $2);
    ELSE
    RETURN pg_catalog.array_to_string(tokens[($3 * -1):pg_catalog.array_upper(tokens, 1)], $2);
    END IF;
    END;
    $$ IMMUTABLE STRICT LANGUAGE PLPGSQL; in /srv/http/localhost/htdocs/comics/sites/all/modules/transliteration/transliteration.install on line 43.

  • warning: pg_query() [function.pg-query]: Query failed: ERROR: function substring_index(character varying, unknown, integer) does not exist
    LINE 1: SELECT fid, filepath FROM files WHERE SUBSTRING_INDEX(filepa...
    ^
    HINT: No function matches the given name and argument types. You might need to add explicit type casts. in /srv/http/localhost/htdocs/comics/includes/database.pgsql.inc on line 139.
  • user warning:
    query: SELECT fid, filepath FROM files WHERE SUBSTRING_INDEX(filepath, '/', -1) ~* '[^0-9A-Za-z_.-]' in /srv/http/localhost/htdocs/comics/sites/all/modules/transliteration/transliteration.install on line 69.

Comments

stormsweeper’s picture

You need the "plpgsql" language installed into Postgres, which is not by default. I just ran into this myself.

stormsweeper’s picture

More on this:
http://www.postgresql.org/docs/8.3/static/sql-createlanguage.html

The quick answer:

yourserver$ psql -U pgsql drupaldb
Welcome to psql 8.2.12, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

drupaldb=# begin;
BEGIN
drupaldb=# CREATE LANGUAGE plpgsql;
CREATE LANGUAGE
drupaldb=# commit;
COMMIT
drupaldb=# 

This might work run as your database owner rather than the superuser for the db if your configuration supports it (see above link).

If you already installed, you need to uninstall the module, which needs to be done from the db since there is not an uninstall hook.

smk-ka’s picture

Status: Active » Fixed

Since today the dependency on SUBSTRING_INDEX is gone in CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.