BUG #14478: Right Trim trims too much?

From: nte(at)mustinformatique(dot)fr
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14478: Right Trim trims too much?
Date: 2016-12-26 09:36:34
Message-ID: 20161226093634.10135.18443@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14478
Logged by: Nathanael TERRIEN
Email address: nte(at)mustinformatique(dot)fr
PostgreSQL version: 9.6.1
Operating system: Windows
Description:

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') AS "A"
,RTRIM('cnam_lpp_histo_io','_io') AS "B"
,REPLACE('cnam_lpp_histo_io','_io','') AS "C"
,REGEXP_REPLACE('cnam_lpp_histo_io','_io$','') AS "D";
Results A and B seems wrong to me (C and D are OK):
A=cnam_lpp_hist
B=cnam_lpp_hist
C=cnam_lpp_histo
D=cnam_lpp_histo

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Terje Elde 2016-12-26 14:51:48 Re: BUG #14478: Right Trim trims too much?
Previous Message Tom Lane 2016-12-25 21:07:37 Re: BUG #14476: crosstabview reports mistaken location