ltrim function

From: Serdar Başyiğit <serdarbasyigit(at)yandex(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: ltrim function
Date: 2019-12-12 23:15:33
Message-ID: 7218441576192533@vla4-87a00c2d2b1b.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<div><span style="color:#000000"><span style="float:none;font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Hello,</span></span><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:#000000">I use Postgres with version PostgreSQL 11.5 on x86_64-pc-linux-gnu, compiled by gcc (Debian 7.3.0-5) 7.3.0, 64-bit;</span></div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div> </div><div><span style="color:#000000">select ltrim('TRYTND', 'TRY’); — result is ND but I expected TND</span></div><div><span style="color:#000000">select ltrim('TRYUSD', 'TRY’); — result is USD it is same what I expect</span></div><div> </div><div><span style="color:#000000">I need to change with;</span></div><div><span style="color:#000000">select substring('TRYTND', length('TRY')+1, length('TRYTND')); — TND</span></div><div><span style="color:#000000">select substring('TRYUSD', length('TRY')+1, length('TRYUSD')); — USD</span></div></div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:#000000">Is there some thing that I misunderstood?</span></div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:#000000">I thing it does not look for all of second parameters and works recursive. </span></div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:#000000">select ltrim('TRYTND', 'TRY’);</span></div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:#000000">1. TRYTND   TRY</span></div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:#000000">2. TND</span><span style="color:#000000;white-space:pre">          </span><span style="color:#000000">TRY — recursive</span></div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:#000000">3. ND           </span><span style="color:#000000;white-space:pre"> </span><span style="color:#000000">TRY — it only found first character of second parameter(T) into first parameter and removed it on first parameter.</span></div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="color:rgb( 255 , 255 , 255 );font-family:'helvetica';font-size:12px;font-style:normal;font-weight:normal;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="color:#000000">Thanks,</span></div></div><div> </div><div> </div><div> </div>

Attachment Content-Type Size
unknown_filename text/html 4.7 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Janes 2019-12-13 00:05:53 Re: BUG #16162: create index using gist_trgm_ops leads to panic
Previous Message Andres Freund 2019-12-12 21:59:27 Re: postgres has no spinlock support on riscv rv64imafdc