The following bug has been logged online:
Bug reference: 6270
Logged by: Evgeniy Galkin
Email address: unikoid(at)gmail(dot)com
PostgreSQL version: 9.0.4
Operating system: GNU/Linux (Ubuntu 10.10)
Description: Invalid string comparison if the string contains '+' or
I'm running postgresql 9.0.4 on GNU/Linux system.
I'm trying to compare two strings which are starting with '+' and '-' signs.
And there is some strange behaviour.
Query "SELECT '+' > '-';" returns t (true), but "SELECT '+1' > '-2';"
returns f (false). And query "SELECT ascii('+') > ascii('-');" returns f as
it should be, so saying that '+' > '-' is true probably is not valid
More complex example:
db=> create table tbl_tmp (a text); insert into tbl_tmp values ('+'), ('-'),
('+1'), ('+2'), ('+3'), ('-1'), ('-2'), ('-3'); select * from tbl_tmp order
INSERT 0 8
This behaviour is also appeared on postgresql 9.1.1 on ubuntu 11.10, but the
same version of psql on Mac OS X Lion works as expected ("SELECT '+' > '-';"
returns f and example with order by gives at first values that are starting
with '+' and at last that are starting with '-' sign).
So, I think that it can be GNU/Linux (maybe glibc) related bug.
Sorry for probably ugly English or if it is duplication of well known issue.
pgsql-bugs by date
|Next:||From: bricklen||Date: 2011-10-25 15:42:35|
|Subject: auto_explain causes cluster crash if pg_ctl reload is used (not
|Previous:||From: snpmonster||Date: 2011-10-25 15:15:53|
|Subject: Re: BUG #6255: Unable to Install (Binary, One Click Installer|