Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAUN5UF24477 for ; Thu, 30 Nov 2000 18:05:30 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eAUN5hY26099; Thu, 30 Nov 2000 18:05:43 -0500 (EST) To: "Jonathan Ellis" cc: pgsql-sql@postgresql.org Subject: Re: String function page incorrect? 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> Comments: In-reply-to "Jonathan Ellis" message dated "Thu, 30 Nov 2000 12:40:01 -0700" Date: Thu, 30 Nov 2000 18:05:42 -0500 Message-ID: <26096.975625542@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200011/294 X-Sequence-Number: 325 "Jonathan Ellis" 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