"Jonathan Ellis" <[EMAIL PROTECTED]> writes:
> I'm trying to find the correct function that returns the location of a
> substring within a string.  Looking at
> http://www.postgresql.org/docs/user/x2731.htm, it gives the Function name as
> "textpos" but in the Example column it uses "position".  But neither one
> works!

Yeah, that seems to be a few versions out of date :-(

The page should probably refer to "strpos", which is the true function
name:

play=> select strpos('high','ig');
 strpos
--------
      2
(1 row)

You can also use the SQL92 POSITION syntax:

play=>  select position('ig' in 'high');
 strpos
--------
      2
(1 row)


                        regards, tom lane

Reply via email to