Re: Request to add feature to the Position function

From: Ron Ben <ronb910(at)walla(dot)co(dot)il>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Brian Dunavant <brian(at)omniti(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Request to add feature to the Position function
Date: 2017-03-28 07:29:41
Message-ID: ~00258DA10E53251C4004E5B@walla.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<div><div dir="rtl"><div>
<div>Here is a refer to the stackoverflow question:<br><br></div>
<div><a href="http://stackoverflow.com/questions/42974822/find-sub-string-position-from-the-end-of-string-in-postgresql">http://stackoverflow.com/questions/42974822/find-sub-string-position-from-the-end-of-string-in-postgresql</a></div>
<div>&nbsp;</div>
<div>it carry another example and the solution however I still think that this fuctionality should be avliable in a build-in postgresql function.</div>
<div>&nbsp;</div>
<br><br></div></div><section class="cust_msg_end"></section><blockquote style="margin:0;margin-bottom:20px;border-top:1px solid #e0e0e0;"><br>ב מרץ 27, 2017 19:58, Adrian Klaver כתב:<blockquote style="margin:0;margin-bottom:20px;border-top:1px solid #e0e0e0">On 03/27/2017 09:15 AM, David G. Johnston wrote:<br>&gt; On Mon, Mar 27, 2017 at 9:03 AM, Brian Dunavant <brian(at)omniti(dot)com<br>&gt; <mailto:brian(at)omniti(dot)com>&gt;wrote:<br>&gt;<br>&gt; That does not return the correct answer for the original poster's<br>&gt; request.<br>&gt;<br>&gt; flpg=#<br>&gt; ​​<br>&gt; select position('om' in reverse('Tomomasaaaaaaaaaaa'));<br>&gt; position<br>&gt; ----------<br>&gt; 15<br>&gt; (1 row)<br>&gt;<br>&gt;<br>&gt; ​Easy oversight to make - if you reverse the string being searched you<br>&gt; must also reverse the string that you are looking for.<br>&gt;<br>&gt; That said the OP hasn't actually defined what they mean by "locate" when<br>&gt; considered in a backward sense - some length adjustments might be needed<br>&gt; to compensate for the length of the term being searched for.<br><br>I think there is also a RTL language involved, so we may need more <br>information to answer the question.<br><br>&gt;<br>&gt; Patches are welcomed. Given the lack of any links to previous requests<br>&gt; of this nature I'd say its not exactly a highly in-demand capability.<br>&gt;<br>&gt; David J.<br>&gt;<br><br><br>-- <br>Adrian Klaver<br>adrian(dot)klaver(at)aklaver(dot)com<br><br></mailto:brian(at)omniti(dot)com></brian(at)omniti(dot)com<br><br></blockquote></blockquote><br></div>

Attachment Content-Type Size
unknown_filename text/html 2.1 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Agarwal, Prateek 2017-03-28 10:15:01 Issue in autovacuum
Previous Message John McKown 2017-03-27 23:52:19 Re: browser interface to forums please?