Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dDGh7-0000dP-RJ for pgsql-hackers@arkaria.postgresql.org; Tue, 23 May 2017 20:46:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dDGh7-0007qL-8q for pgsql-hackers@arkaria.postgresql.org; Tue, 23 May 2017 20:46:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dDGfZ-0004fX-Cj for pgsql-hackers@postgreSQL.org; Tue, 23 May 2017 20:44:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dDGfW-0004Ol-D6 for pgsql-hackers@postgreSQL.org; Tue, 23 May 2017 20:44:40 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v4NKiNBo006475; Tue, 23 May 2017 16:44:23 -0400 From: Tom Lane To: Heikki Linnakangas cc: pgsql-hackers@postgreSQL.org Subject: Re: Tightening isspace() tests where behavior should match SQL parser In-reply-to: <08ea5ab0-5f9a-f80a-cb2f-79058e581199@iki.fi> References: <10129.1495302480@sss.pgh.pa.us> <08ea5ab0-5f9a-f80a-cb2f-79058e581199@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Tue, 23 May 2017 06:56:58 -0400" Date: Tue, 23 May 2017 16:44:23 -0400 Message-ID: <1716.1495572263@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Heikki Linnakangas writes: > On 05/20/2017 01:48 PM, Tom Lane wrote: >> Attached is a proposed patch. I'm vacillating on whether to >> back-patch this --- it will fix a reported bug, but it seems >> at least somewhat conceivable that it will also break cases >> that were working acceptably before. Thoughts? > +1 for back-patching. If I understand correctly, it would change the > behavior when you pass a string with non-ASCII leading or trailing > whitespace characters to those functions. I suppose that can happen, but > it's only pure luck if the current code happens to work in that case. Well, it'd work properly for e.g. no-break space in LATINn. But that seems like a very narrow use-case, and probably not enough to justify the misbehavior you might get in multi-byte character sets. A compromise possibly worth considering is to apply isspace() only in single-byte encodings. I think that's more complication than it's worth, but others might think differently. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers