Skip site navigation (1) Skip section navigation (2)

String comparison problem.

From: Theerasak Maneeneim <theerasak(at)thns(dot)co(dot)th>
To: pgsql-admin(at)postgresql(dot)org
Subject: String comparison problem.
Date: 2008-05-30 03:43:45
Message-ID: 483F77F1.40101@thns.co.th (view raw or flat)
Thread:
Lists: pgsql-admin
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.



pgsql-admin by date

Next:From: kevin kempterDate: 2008-05-30 04:35:19
Subject: postgres, syslog and freeBSD
Previous:From: Medi MontaseriDate: 2008-05-29 05:14:12
Subject: Re: what happend to my database

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group