pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jonathan Ellis <jellis@advocast.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: String function page incorrect?
Date: Thu, 30 Nov 2000 18:05:42 -0500
Message-ID: <26096.975625542@sss.pgh.pa.us> (raw)
In-Reply-To: <017c01c05b05$5729dfa0$0d00a8c0@dsl.inconnect.com>
References: <5.0.2.1.2.20001130113826.082b4ec0@pop.mindspring.com>
	<3A268A5C.91CB7353@wgcr.org>
	<14886.40191.455322.734798@onceler.kciLink.com>
	<017c01c05b05$5729dfa0$0d00a8c0@dsl.inconnect.com>

"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



view thread (3+ messages)  latest in thread

Message-ID: <26096.975625542@sss.pgh.pa.us>
Permalink:  ../26096.975625542@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26096.975625542@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jellis@advocast.com
  Subject: Re: String function page incorrect?
  In-Reply-To: <26096.975625542@sss.pgh.pa.us>
  References: <5.0.2.1.2.20001130113826.082b4ec0@pop.mindspring.com> <3A268A5C.91CB7353@wgcr.org> <14886.40191.455322.734798@onceler.kciLink.com> <017c01c05b05$5729dfa0$0d00a8c0@dsl.inconnect.com> <26096.975625542@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox