X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5EFF49FA5CE for ; Wed, 7 Jun 2006 20:06:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 91767-10 for ; Wed, 7 Jun 2006 20:06:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lara.cc.fer.hr (lara.cc.fer.hr [161.53.72.113]) by postgresql.org (Postfix) with ESMTP id 5B5889FA3C0 for ; Wed, 7 Jun 2006 20:06:07 -0300 (ADT) Received: from [127.0.0.1] (localhost.cc.fer.hr [127.0.0.1]) by lara.cc.fer.hr (8.13.6/8.13.4) with ESMTP id k57N4rDp026917; Thu, 8 Jun 2006 01:04:53 +0200 (CEST) (envelope-from ivoras@fer.hr) Message-ID: <44875B95.5000005@fer.hr> Date: Thu, 08 Jun 2006 01:04:53 +0200 From: Ivan Voras User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050921) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: Curious sorting puzzle References: <4487285A.5050104@fer.hr> <17522.1149714973@sss.pgh.pa.us> In-Reply-To: <17522.1149714973@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/82 X-Sequence-Number: 19439 Tom Lane wrote: >>An ideal solution would be to have a >>"not-locale-affected-varchar" field type :) > > > If you're just storing ASCII then I think bytea might work for this. > Do you need any actual text operations (like concatenation), or this > just a store-and-retrieve field? I've just tested bytea and it looks like a perfect solution - it supports: - character-like syntax - indexes - uses indexes with LIKE 'x%' queries - SUBSTRING() That's good enough for us - it seems it's just what we need - a string-like type with byte collation. Thanks!