Thread: textpos() in postgreSQL 7.0

textpos() in postgreSQL 7.0

From
"Adam Walczykiewicz"
Date:
Hi
I notice that string function textpos() doesn't exist in postgreSQL 7.0. I have some
plpgsql functions written for 6.5.2 that use textpos() and when I tried to use them
in postgreSQL 7.0 I'v got error. Should I compile postgreSQL 7.0 with more options
than -enable locale ?!!?
Thanks for any help.
Adam
 

Re: textpos() in postgreSQL 7.0

From
"Ross J. Reedstrom"
Date:
Adam - 
Looks like it was renamed to strpos() in 7.0. A quick compatability 
hack to get up and running until you can rewrite the code would be to 
do something like:

CREATE FUNCTION textpos (text,text) RETURNS int AS 'SELECT strpos($1,$2)'
LANGUAGE 'SQL';

Now all your old code will work, just a little slower.

Ross

On Thu, Jun 01, 2000 at 07:47:32AM +0200, Adam Walczykiewicz wrote:
> Hi
> I notice that string function textpos() doesn't exist in postgreSQL 7.0. I
> have some
> plpgsql functions written for 6.5.2 that use textpos() and when I tried to
> use them
> in postgreSQL 7.0 I'v got error. 
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005