Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id EF688B5DC65 for ; Mon, 29 Aug 2011 13:27:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 84951-07 for ; Mon, 29 Aug 2011 16:27:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 304CBB5DC55 for ; Mon, 29 Aug 2011 13:27:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p7TGRh63023080; Mon, 29 Aug 2011 12:27:43 -0400 (EDT) To: "Itagaki Takahiro" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6181: concat_ws() incompatibility with MySQL In-reply-to: <201108291142.p7TBgjiJ027349@wwwmaster.postgresql.org> References: <201108291142.p7TBgjiJ027349@wwwmaster.postgresql.org> Comments: In-reply-to "Itagaki Takahiro" message dated "Mon, 29 Aug 2011 11:42:45 +0000" Date: Mon, 29 Aug 2011 12:27:43 -0400 Message-ID: <23079.1314635263@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201108/177 X-Sequence-Number: 30989 "Itagaki Takahiro" writes: > For query concat_ws('/', NULL, 'X'), > PostgreSQL 9.1 returns '/X', but MySQL returns 'X'. > I think postgres should return 'X' because of compatibility. > Another reason is that both of the two queries below return 'X'. > - concat_ws('/', 'X', NULL) > - array_to_string(ARRAY[NULL, 'X'], '/') Yeah, I think you're right. Fortunately it's not too late to change this without introducing backwards-compatibility issues of our own. Will fix. regards, tom lane