--- plpgsql_recode.sql 2002/08/31 08:26:57 1.1 +++ plpgsql_recode.sql 2002/09/10 13:18:29 1.2 @@ -1,6 +1,10 @@ -- this is hopefully complete implementation of pg_recode in PL/pgSQL -- it's best for portability and I still have to check it's performance -- 2002-08-30 Dobrica Pavlinusic +-- 2002-09-10 you will have to remove "with (iscachable)" if your +-- PostgreSQL is not current enough (>7.2.x I think). But, if you leave +-- it you will be able to create function index using this functions +-- e.g. create index ind_osobe_ime on osobe ( toczs(ime) ) -- drop old implementation drop function to1250(text); @@ -29,7 +33,7 @@ end loop; return new; end -' language 'PLpgSQL'; +' language 'PLpgSQL' with (iscachable) ; -- convert 8859-2 to 1250 create function to1250(text) returns text as ' @@ -52,7 +56,7 @@ end loop; return new; end -' language 'PLpgSQL'; +' language 'PLpgSQL' with (iscachable) ; -- tocsz -- convert iso8859-2 or cp1250 to czs create function toczs(text) returns text as ' @@ -88,7 +92,7 @@ return new; end -' language 'PLpgSQL'; +' language 'PLpgSQL' with (iscachable) ; -- initcap2 -- initcap whith support for iso8859-2 or cp1250 create function initcap2(text) returns text as ' @@ -145,5 +149,5 @@ return new; end -' language 'PLpgSQL'; +' language 'PLpgSQL' with (iscachable) ;