Sorry, my mistake, but actually trigrams_array is called by trigrams_vector Definition for the function dict.trigrams_vector: CREATE OR REPLACE FUNCTION dict.trigrams_vector(word text) RETURNS tsvector LANGUAGE sql IMMUTABLE STRICT AS $function$ SELECT array_to_string(dict.trigrams_array($1), ' ')::tsvector; $function$ ;