<div dir='rtl'><div>
<div>Hi,</div>
<div>position(<tt>substring</tt> in <tt>string</tt>)</div>
<div>as listed here:</div>
<div><a href="https://www.postgresql.org/docs/9.1/static/functions-string.html">https://www.postgresql.org/docs/9.1/static/functions-string.html</a></div>
<div>locates sub string in a string.</div>
<div> </div>
<div>It doesn't support locateing the substring from the back.</div>
<div> </div>
<div>For example:</div>
<div> </div>
<div>position('om' in 'Tomomas')</div>
<div>gives 2</div>
<div> </div>
<div>But if I want to locate the first occurance from the back of the string it's impossible/</div>
<div> </div>
<div>My suggestion is to create a function </div>
<div>position(<tt>substring</tt> in <tt>string,order</tt>)</div>
<div>where order can be: begin, end</div>
<div> </div>
<div>and it will find the string according to this parameter.</div>
<div>This is pretty easy to implement and should be a part of the PostgreSQL tools.</div>
<div> </div>
<div>similar fuctionality exists in trim function where user can specify leading or taling parameter</div>
</div></div>