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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

String comparison problem.



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.







Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group