Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 48637632B5C for ; Wed, 23 Jun 2010 19:23:54 -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 69066-05 for ; Wed, 23 Jun 2010 22:23:42 +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 29F03632A99 for ; Wed, 23 Jun 2010 19:23:43 -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 o5NMNdos029536; Wed, 23 Jun 2010 18:23:39 -0400 (EDT) To: Tatsuhito Kasahara cc: pgsql-bugs@postgresql.org Subject: Re: make_greater_string() does not return a string in some cases In-reply-to: <4C21D716.70808@oss.ntt.co.jp> References: <4C1F389B.1010606@oss.ntt.co.jp> <13689.1277136605@sss.pgh.pa.us> <4C21D716.70808@oss.ntt.co.jp> Comments: In-reply-to Tatsuhito Kasahara message dated "Wed, 23 Jun 2010 18:42:46 +0900" Date: Wed, 23 Jun 2010 18:23:39 -0400 Message-ID: <29535.1277331819@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/337 X-Sequence-Number: 27298 Tatsuhito Kasahara writes: > I have another idea. > 1. We prepare new operators ( <,<=,>,=>,= ) for text and bytea. > 2. In make_greater_string(), if > multi-byte-string was set and > using locale-C and > could not find greater string, > returns bytea which has greater byte-code of last-character. > Is the idea reasonable ? Maybe, but it only works for text_pattern_ops indexes not normal ones. Not sure if people will be happy with maintaining a special index just to cover this corner case. I'm not convinced that there's enough of a problem here to be worth sweating over. If we're not able to generate a "greater" string with the current rules, the odds are that the pattern is so close to the end of the index range that a one-sided test is not going to make much difference compared to a two-sided one. regards, tom lane