Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id C265D2E002F for ; Fri, 30 May 2008 01:13:09 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 60996-04 for ; Fri, 30 May 2008 01:12:47 -0300 (ADT) X-Greylist: delayed 00:28:18.250773 by SQLgrey-1.7.6 Received: from email.thns.co.th (unknown [203.154.173.35]) by developer.postgresql.org (Postfix) with ESMTP id 83CE52E004C for ; Fri, 30 May 2008 01:12:00 -0300 (ADT) Received: from localhost (email.thns.co.th [127.0.0.1]) by email.thns.co.th (Postfix) with ESMTP id 1996C5FC28 for ; Fri, 30 May 2008 10:44:13 +0700 (ICT) X-Virus-Scanned: amavisd-new at thns.co.th Received: from email.thns.co.th ([127.0.0.1]) by localhost (email.thns.co.th [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F4nnAYHhCui9 for ; Fri, 30 May 2008 10:44:04 +0700 (ICT) Received: from [172.27.170.219] (unknown [172.27.170.219]) by email.thns.co.th (Postfix) with ESMTP id 9F6215FC2C for ; Fri, 30 May 2008 10:43:59 +0700 (ICT) Message-ID: <483F77F1.40101@thns.co.th> Date: Fri, 30 May 2008 10:43:45 +0700 From: Theerasak Maneeneim Reply-To: theerasak@thns.co.th User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: String comparison problem. X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=RDNS_NONE=0.1 X-Spam-Level: X-Archive-Number: 200805/238 X-Sequence-Number: 29322 Dear All, I have some problem with string comparison. I use postgresql 8.3.1,UTF8 encoding, on CentOS 5.5. Why dose the result of SQL statement : "select '1.1' < '101';" is false but "select '1.1'::bytea < '101'::bytea;" is ture? mis=# select '.' < '0'; ?column? ---------- t (1 row) mis=# select '1.' < '10'; ?column? ---------- t (1 row) mis=# select '1.1' < '101'; ?column? ---------- f (1 row) mis=# select '1.1'::text < '101'::text; ?column? ---------- f (1 row) mis=# select '1.1'::bytea < '101'::bytea; ?column? ---------- t (1 row) Thank you very much.