From: Nathanael Terrien <nte@mustinformatique.fr>
To: Terje Elde <terje@elde.net>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14478: Right Trim trims too much?
Date: Mon, 26 Dec 2016 14:56:32 +0000
Message-ID: <af4cb1f0b64d4634b3b5466762fdabdd@EXCH2013.mustinformatique.fr> (raw)
In-Reply-To: <8D6B90F8-6952-4342-93E5-66F7CDE42D66@elde.net>
References: <20161226093634.10135.18443@wrigleys.postgresql.org>
<8D6B90F8-6952-4342-93E5-66F7CDE42D66@elde.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Ok, I misunderstood the documentation. The way it works is logical.
Thank you.
De : Terje Elde [mailto:terje@elde.net]
Envoyé : lundi 26 décembre 2016 15:52
À : Nathanael Terrien <nte@mustinformatique.fr>
Cc : pgsql-bugs@postgresql.org
Objet : Re: [BUGS] BUG #14478: Right Trim trims too much?
On 26 Dec 2016, at 10:36, nte@mustinformatique.fr<mailto:nte@mustinformatique.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: nte@mustinformatique.fr, terje@elde.net
Subject: Re: BUG #14478: Right Trim trims too much?
In-Reply-To: <af4cb1f0b64d4634b3b5466762fdabdd@EXCH2013.mustinformatique.fr>
References: <20161226093634.10135.18443@wrigleys.postgresql.org> <8D6B90F8-6952-4342-93E5-66F7CDE42D66@elde.net> <af4cb1f0b64d4634b3b5466762fdabdd@EXCH2013.mustinformatique.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox