pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Theerasak Maneeneim <theerasak@thns.co.th>
To: pgsql-admin@postgresql.org
Subject: String comparison problem.
Date: Fri, 30 May 2008 10:43:45 +0700
Message-ID: <483F77F1.40101@thns.co.th> (raw)

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.





Message-ID: <483F77F1.40101@thns.co.th>
Permalink:  ../483F77F1.40101@thns.co.th/
Also on:    postgresql.org/message-id/483F77F1.40101@thns.co.th

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: theerasak@thns.co.th
  Subject: Re: String comparison problem.
  In-Reply-To: <483F77F1.40101@thns.co.th>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox