From: Robert Haas <robertmhaas@gmail.com>
To: Administrator <admin@navigator-info.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re:
Date: Mon, 1 Mar 2010 09:38:37 -0500
Message-ID: <603c8f071003010638v5e5c3b86m728408fa2d48b759@mail.gmail.com> (raw)
In-Reply-To: <bb1c30de2348d76fe53d6c1968848a4a@navigator-info.com>
References: <bb1c30de2348d76fe53d6c1968848a4a@navigator-info.com>
On Fri, Feb 26, 2010 at 7:12 PM, Administrator <admin@navigator-info.com> wrote:
> Logged by: Michael Kopljan
> email: admin@navigator-info.com
> PostgreSQL version: 8.4.2
> Operating system: Windows 2008 Server
> Description: bug in string comparison
> Details:
>
> -- Drop
> DROP TABLE IF EXISTS "public"."test" ;
> -- Definition
> CREATE TABLE "public"."test" (
> "id_robe" INTEGER NOT NULL,
> "sifra" VARCHAR(15) NOT NULL,
> "naziv" VARCHAR(50) NOT NULL,
> PRIMARY KEY("id_robe")
> ) WITH OIDS;
>
> ALTER TABLE "public"."test"
> ALTER COLUMN "id_robe" SET STATISTICS 0;
> ALTER TABLE "public"."test"
> ALTER COLUMN "sifra" SET STATISTICS 0;
> ALTER TABLE "public"."test"
> ALTER COLUMN "naziv" SET STATISTICS 0;
>
> COMMENT ON COLUMN "public"."test"."id_robe"
> IS 'PK';
>
> -- Data
> INSERT INTO "public"."test" VALUES(1, 'PDTT18', 'POD TT18') ;
> INSERT INTO "public"."test" VALUES(2, 'K-K8-8', 'kutija 840x410x145') ;
> INSERT INTO "public"."test" VALUES(3, 'ZDTT25', 'ZID TT25') ;
> INSERT INTO "public"."test" VALUES(4, 'ZDW18' , 'ZID W18') ;
> INSERT INTO "public"."test" VALUES(5, 'ZDTT18', 'ZID TT18') ;
> INSERT INTO "public"."test" VALUES(6, 'ZDOR18', 'ZID OR18') ;
> INSERT INTO "public"."test" VALUES(7, 'ZDX18' , 'ZID X18') ;
> INSERT INTO "public"."test" VALUES(8, 'ZDW25' , 'ZID W25') ;
>
> -----------
> -- QUERY --
> -----------
>
> --Query#1 (In PostgreSQL 8.2 returns all rows, but in 8.4 only 2 rows?
> Select
> t1.*
> From public.test t1
> Where t1.sifra BETWEEN '%' AND 'z%' ;
>
> --Query#2 (In PostgreSQL 8.2 returns 0 rows, but in 8.4 only 2 rows?
> Select
> t1.*
> From public.test t1
> Where t1.sifra BETWEEN 'a%' AND 'z%' ;
>
> --Query#3 (In PostgreSQL 8.2 returns all rows and in 8.4 returns all rows!
> Select
> t1.*
> From public.test t1
> Where t1.sifra BETWEEN '%' AND 'zz%' ;
>
> -- BUG
> -- In field "sifra" data is stored in UPPER CASE, why query#1 don't return all data in 8.4?
> -- In field "sifra" data is stored in UPPER CASE, why query#2 return 2 rows in 8.4?
> -- Why, in query#3, must for second parameter of BETWEEN operator use "zz%" instead "z%" (that work on 8.2) to get all rows?
My thought is that you must have different locale/encoding settings on
your 8.2 database than you do on your 8.4 database.
...Robert
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-bugs@postgresql.org
Cc: robertmhaas@gmail.com, admin@navigator-info.com
Subject: Re:
In-Reply-To: <603c8f071003010638v5e5c3b86m728408fa2d48b759@mail.gmail.com>
* 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