BUG #9541: Result of TRIM function has changed - Mailing list pgsql-bugs

From uehara.kazuki@po.ntts.co.jp
Subject BUG #9541: Result of TRIM function has changed
Date
Msg-id 20140312093753.335.3227@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #9541: Result of TRIM function has changed
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      9541
Logged by:          Kazuki Uehara
Email address:      uehara.kazuki@po.ntts.co.jp
PostgreSQL version: 9.3.3
Operating system:   CentOS release 5.6
Description:

Depending on the version, the result of the TRIM function is different.

I did the following steps.

1. Change the setting of search_path.
---------------------------------------------
search_path='test,pg_catalog,"$user",public'
---------------------------------------------

2. Run the following query.
-------------------------------------------
CREATE FUNCTION LTRIM(CHAR,text)
RETURNS text
AS 'ltrim'
LANGUAGE internal
STRICT;
SELECT '|' || TRIM(LEADING 'a' FROM 'abcd'::char(7)) || '|';
--------------------------------------------


Execution result of each version

PostgreSQL9.3.1
| postgres=# SELECT '|' || TRIM(LEADING 'a' FROM 'abcd'::char(7)) || '|';
|  ?column?
| ----------
|  |bcd|
| (1 row)

PostgreSQL9.3.2:
| postgres=# SELECT '|' || TRIM(LEADING 'a' FROM 'abcd'::char(7)) || '|';
|  ?column?
| ----------
|  |bcd|
| (1 row)

PostgreSQL9.3.3:
| postgres=# SELECT '|' || TRIM(LEADING 'a' FROM 'abcd'::char(7)) || '|';
|  ?column?
| ----------
|  |bcd   |
| (1 row)


Thank you very much.

pgsql-bugs by date:

Previous
From: Lekshmi Ts
Date:
Subject: postgres 8.2.13 compatibility with RHEL 6.4
Next
From: prasanna@semantifi.com
Date:
Subject: BUG #9547: Unable install postgres on AIX 5.3