Created
May 20, 2014 16:11
-
-
Save fernandor777/7833248f81d3b6f5ccf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION documental.ferunaccent(text) | |
RETURNS text AS | |
$BODY$ | |
SELECT unaccent($1); | |
$BODY$ | |
LANGUAGE sql IMMUTABLE | |
COST 100; | |
-- GIST: | |
CREATE INDEX docmdvalor_txtidxbtree ON documental.doc_md_valor | |
USING gist ( (lower(documental.ferunaccent(valor_text))) gist_trgm_ops ) | |
WHERE valor_text IS NOT NULL ; | |
-- GIN: | |
CREATE INDEX docmdvalor_vchargin | |
ON documental.doc_md_valor | |
USING gin | |
(lower(documental.ferunaccent(valor_varchar::text)) COLLATE pg_catalog."default" gin_trgm_ops) | |
WHERE valor_varchar IS NOT NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment