Re: BUG #14478: Right Trim trims too much?

From: Nathanael Terrien <nte(at)mustinformatique(dot)fr>
To: 'Terje Elde' <terje(at)elde(dot)net>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14478: Right Trim trims too much?
Date: 2016-12-26 14:56:32
Message-ID: af4cb1f0b64d4634b3b5466762fdabdd@EXCH2013.mustinformatique.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ok, I misunderstood the documentation. The way it works is logical.
Thank you.

De : Terje Elde [mailto:terje(at)elde(dot)net]
Envoyé : lundi 26 décembre 2016 15:52
À : Nathanael Terrien <nte(at)mustinformatique(dot)fr>
Cc : pgsql-bugs(at)postgresql(dot)org
Objet : Re: [BUGS] BUG #14478: Right Trim trims too much?

On 26 Dec 2016, at 10:36, nte(at)mustinformatique(dot)fr<mailto:nte(at)mustinformatique(dot)fr> wrote:
Not sure if a bug or if I'm missing something but this query produces weird
results with TRIM and TRIM:
SELECT DISTINCT TRIM(TRAILING FROM 'cnam_lpp_histo_io','_io')

The devil is in the details. Trim won't remove the string "_io", it'll trim off the characters "_", "i" and "o". And with that logic, the "o" at the end of "histo" is correctly removed as well.

IOW, works as intended and advertised.

Doc here:
https://www.postgresql.org/docs/current/static/functions-string.html

Terje

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-12-26 16:36:25 Re: BUG #14478: Right Trim trims too much?
Previous Message Terje Elde 2016-12-26 14:51:48 Re: BUG #14478: Right Trim trims too much?