Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0HFSR025904 for ; Wed, 17 Jan 2001 10:28:27 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f0HFSFJ16932; Wed, 17 Jan 2001 10:28:15 -0500 (EST) To: Rolf Johansson cc: pgsql-sql@postgresql.org Subject: Re: sort order with < & > in varchar fields In-reply-to: <7jhf2yfgbh.fsf@junk.nocrew.org> References: <7jhf2yfgbh.fsf@junk.nocrew.org> Comments: In-reply-to Rolf Johansson message dated "17 Jan 2001 14:39:46 +0100" Date: Wed, 17 Jan 2001 10:28:15 -0500 Message-ID: <16929.979745295@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200101/190 X-Sequence-Number: 854 Rolf Johansson writes: > Is there documentation on how >= and <= works with varchar > fields? Does pg count in the "," character or ignore it? That depends. If you compiled with --enable-locale then it's whatever strcoll() says for the locale you are running the postmaster in. If not, it's whatever strcmp() says, which is normally plain ASCII collation order. Note: beware of changing the postmaster's locale on the fly; this can leave your indexes on textual columns out of order and hence effectively corrupt. You can fix that by dropping/rebuilding such indexes, or with REINDEX. regards, tom lane