/[pg_recode]/plpgsql_recode.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /plpgsql_recode.sql

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Sat Aug 31 08:26:57 2002 UTC revision 1.2 by dpavlin, Tue Sep 10 13:18:29 2002 UTC
# Line 1  Line 1 
1  -- this is hopefully complete implementation of pg_recode in PL/pgSQL  -- this is hopefully complete implementation of pg_recode in PL/pgSQL
2  -- it's best for portability and I still have to check it's performance  -- it's best for portability and I still have to check it's performance
3  -- 2002-08-30 Dobrica Pavlinusic <dpavlin@rot13.org>  -- 2002-08-30 Dobrica Pavlinusic <dpavlin@rot13.org>
4    -- 2002-09-10 you will have to remove "with (iscachable)" if your
5    --      PostgreSQL is not current enough (>7.2.x I think). But, if you leave
6    --      it you will be able to create function index using this functions
7    --      e.g. create index ind_osobe_ime on osobe ( toczs(ime) )
8    
9  -- drop old implementation  -- drop old implementation
10  drop function to1250(text);  drop function to1250(text);
# Line 29  begin Line 33  begin
33          end loop;          end loop;
34          return new;          return new;
35  end  end
36  ' language 'PLpgSQL';  ' language 'PLpgSQL' with (iscachable) ;
37    
38  -- convert 8859-2 to 1250  -- convert 8859-2 to 1250
39  create function to1250(text) returns text  as '  create function to1250(text) returns text  as '
# Line 52  begin Line 56  begin
56          end loop;          end loop;
57          return new;          return new;
58  end  end
59  ' language 'PLpgSQL';  ' language 'PLpgSQL' with (iscachable) ;
60    
61  -- tocsz -- convert iso8859-2 or cp1250 to czs  -- tocsz -- convert iso8859-2 or cp1250 to czs
62  create function toczs(text) returns text  as '  create function toczs(text) returns text  as '
# Line 88  begin Line 92  begin
92    
93          return new;          return new;
94  end  end
95  ' language 'PLpgSQL';  ' language 'PLpgSQL' with (iscachable) ;
96    
97  -- initcap2 -- initcap whith support for iso8859-2 or cp1250  -- initcap2 -- initcap whith support for iso8859-2 or cp1250
98  create function initcap2(text) returns text  as '  create function initcap2(text) returns text  as '
# Line 145  begin Line 149  begin
149    
150          return new;          return new;
151  end  end
152  ' language 'PLpgSQL';  ' language 'PLpgSQL' with (iscachable) ;
153    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26