Re: String function page incorrect? - Mailing list pgsql-sql

From Tom Lane
Subject Re: String function page incorrect?
Date
Msg-id 26096.975625542@sss.pgh.pa.us
Whole thread Raw
In response to String function page incorrect?  ("Jonathan Ellis" <jellis@advocast.com>)
List pgsql-sql
"Jonathan Ellis" <jellis@advocast.com> 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


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: I get an error with Foreign Keys
Next
From: Roberto Mello
Date:
Subject: Re: String function page incorrect?