BUG #9541: Result of TRIM function has changed

From: uehara(dot)kazuki(at)po(dot)ntts(dot)co(dot)jp
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #9541: Result of TRIM function has changed
Date: 2014-03-12 09:37:53
Message-ID: 20140312093753.335.3227@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: 9541
Logged by: Kazuki Uehara
Email address: uehara(dot)kazuki(at)po(dot)ntts(dot)co(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Grégory Giannoni 2014-03-12 10:38:00 LIMIT causes huge slow down
Previous Message Sandeep Thakkar 2014-03-12 09:16:57 Re: HP-UX 11.31 Itanium2 64bit again