Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 95ED5B5DC1B for ; Thu, 22 Sep 2011 13:36:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 29622-03 for ; Thu, 22 Sep 2011 16:35:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 680AAB5DC01 for ; Thu, 22 Sep 2011 13:35:59 -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 p8MGZuNk023160; Thu, 22 Sep 2011 12:35:56 -0400 (EDT) To: Robert Haas cc: Kyotaro HORIGUCHI , pgsql-hackers@postgresql.org Subject: Re: [v9.2] make_greater_string() does not return a string in some cases In-reply-to: References: <20110711.155531.15100243.horiguchi.kyotaro@oss.ntt.co.jp> <20110712.161231.138791411.horiguchi.kyotaro@oss.ntt.co.jp> <20110914.111320.18404009.horiguchi.kyotaro@oss.ntt.co.jp> <6425.1316656167@sss.pgh.pa.us> <8755.1316665444@sss.pgh.pa.us> <18434.1316702188@sss.pgh.pa.us> <21348.1316706403@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Thu, 22 Sep 2011 12:09:45 -0400" Date: Thu, 22 Sep 2011 12:35:56 -0400 Message-ID: <23159.1316709356@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: 201109/1147 X-Sequence-Number: 195336 Robert Haas writes: > On Thu, Sep 22, 2011 at 11:46 AM, Tom Lane wrote: >> Well, the metric that we were indirectly using earlier was the >> number of characters in a given locale for which the algorithm >> fails to find a greater one (excluding whichever character is "last", >> I guess, or you could just recognize there's always at least one). > What about characters that sort differently in sequence than individually? Yeah, there's a whole 'nother set of issues there, but the character incrementer is unlikely to affect that very much either way, I think. > But now that I think about it, what about using some > slightly-less-stupid version of that approach as a fallback strategy? > For example, we could pick, oh, say, 20 characters out of the space of > code points, about evenly distributed under whatever collations we > think are likely to be in use. Sure, if the "increment the top byte" strategy proves to not accomplish that effectively. But I'd prefer not to design a complex strategy until it's been proven that a simpler one doesn't work. regards, tom lane