Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WOSfM-00068q-9h for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Mar 2014 14:00:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WOSfK-0006lD-OR for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Mar 2014 14:00:50 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WOOTa-0000UH-Tf for pgsql-bugs@postgresql.org; Fri, 14 Mar 2014 09:32:27 +0000 Received: from mail12.ics.ntts.co.jp ([210.232.35.65]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WOOTX-0005ki-Nu for pgsql-bugs@postgresql.org; Fri, 14 Mar 2014 09:32:26 +0000 Received: from sadoku34.silk.ntts.co.jp (sadoku34 [10.7.18.34]) by mail12.ics.ntts.co.jp (8.14.4/8.14.4/NTTSOFT) with ESMTP id s2E9WKCJ020806; Fri, 14 Mar 2014 18:32:20 +0900 (JST) Received: (from root@localhost) by sadoku34.silk.ntts.co.jp (8.13.8/NTTSOFT) id s2E9WKLH015263; Fri, 14 Mar 2014 18:32:20 +0900 (JST) Received: from ccmds32.silk.ntts.co.jp [10.107.0.32] by sadoku34.silk.ntts.co.jp with SMTP id UAA15262; Fri, 14 Mar 2014 18:32:20 +0900 Received: from mail147.silk.ntts.co.jp (ccmds32.silk.ntts.co.jp [127.0.0.1]) by ccmds32.silk.ntts.co.jp (8.14.3/8.14.3) with ESMTP id s2E9WJEi018246; Fri, 14 Mar 2014 18:32:19 +0900 Received: from mail147.silk.ntts.co.jp (localhost.localdomain [127.0.0.1]) by mail147.silk.ntts.co.jp (8.14.5/8.14.5/NTTSOFT) with ESMTP id s2E9WDXo006496; Fri, 14 Mar 2014 18:32:13 +0900 Received: from ccmds32 (mail145.silk.ntts.co.jp [10.107.0.145]) by mail147.silk.ntts.co.jp (8.14.5/8.14.5/NTTSOFT) with SMTP id s2E9WD3R006493; Fri, 14 Mar 2014 18:32:13 +0900 Date: Fri, 14 Mar 2014 18:30:58 +0900 From: =?ISO-2022-JP?B?GyRCPmU4NiEhMGw8eRsoQg==?= To: Tom Lane Subject: Re: BUG #9541: Result of TRIM function has changed Cc: pgsql-bugs@postgresql.org In-Reply-To: <11692.1394634565@sss.pgh.pa.us> References: <20140312093753.335.3227@wrigleys.postgresql.org> <11692.1394634565@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.64.06 [ja] Message-Id: <201403140930.s2E9UlgO017648@ccmds32.silk.ntts.co.jp> X-CC-Mail-RelayStamp: CC-Mail-V4.3-Client X-CC-Mail-RelayStamp: CC-Mail-V4.3-Server X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org I'm sorry. This is my mistake. My way was wrong. PostgreSQL is processing in accordance with the specification Thank you for your reply despite being so busy. On Wed, 12 Mar 2014 10:29:25 -0400 Tom Lane wrote: | uehara.kazuki@po.ntts.co.jp writes: | > Depending on the version, the result of the TRIM function is different. | | I'm not sure that anyone would consider this a supported thing to do: | | > CREATE FUNCTION LTRIM(CHAR,text) | > RETURNS text | > AS 'ltrim' | > LANGUAGE internal | > STRICT; | | My attitude towards overriding system functions like that is "if it | breaks, you get to keep both pieces". (BTW, is there a reason you | omitted IMMUTABLE from this?) | | However, | | > PostgreSQL9.3.3: | > | postgres=# SELECT '|' || TRIM(LEADING 'a' FROM 'abcd'::char(7)) || '|'; | > | ?column? | > | ---------- | > | |bcd | | > | (1 row) | | I get "|bcd|" from this example, in both 9.3 and HEAD branch. I would | be surprised to get anything different, because the grammar converts | that syntax into "pg_catalog.ltrim(..., ...)" and so your override | function cannot be selected as the expansion. At least not if the | override function went into schema "public", which would be the default. | | I suspect that in 9.3.3 you forced the function into the pg_catalog | schema, but omitted to do that in the other two examples. | | regards, tom lane -- Kazuki Uehara uehara.kazuki@po.ntts.co.jp -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs