Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E62D5632404 for ; Mon, 1 Mar 2010 10:38:50 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 46758-02 for ; Mon, 1 Mar 2010 14:38:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f223.google.com (mail-fx0-f223.google.com [209.85.220.223]) by mail.postgresql.org (Postfix) with ESMTP id 089A862DBD2 for ; Mon, 1 Mar 2010 10:38:39 -0400 (AST) Received: by fxm23 with SMTP id 23so164329fxm.3 for ; Mon, 01 Mar 2010 06:38:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CPFt20zh5RSuUpwmA91kx5oXVf9d1dI3iK3DrVgfk/Q=; b=GCEzaFCGn0alRE1T/+ztaCUkNuQe0W4fQYTK74q/u/dg95LAPX/yvW4fO3HSTReucU O82nAm5/9a0TNkznbuLO4PnbfOC7A8n6gs/4CBZl5F2k3rksGVpRaljCC1kv7HFuS9tq BTK7vT0/dMS72V+TPGtHZ9Oat5/edRzusZT74= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gtLsqwTsfevTr87bhD8Y6Cm0xTswHsU2aJ/xvyLvUrcdkhw9e6DzCqBpxuRQL8EW1S PGZKs23s06knEk2rCGxjAfZh1OMTLX/x74Q5SV8hDNJYznBOtUdQyxhnawcK/uJS3ykU 6xNJJ+4wz2VpFWNpPCD7PGfCRzon1bwvP/UV0= MIME-Version: 1.0 Received: by 10.239.162.210 with SMTP id m18mr443930hbd.189.1267454317939; Mon, 01 Mar 2010 06:38:37 -0800 (PST) In-Reply-To: References: Date: Mon, 1 Mar 2010 09:38:37 -0500 Message-ID: <603c8f071003010638v5e5c3b86m728408fa2d48b759@mail.gmail.com> Subject: Re: From: Robert Haas To: Administrator Cc: pgsql-bugs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.482 tagged_above=-10 required=5 tests=AWL=0.117, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/5 X-Sequence-Number: 26141 On Fri, Feb 26, 2010 at 7:12 PM, Administrator w= rote: > 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" ( > =A0"id_robe" INTEGER NOT NULL, > =A0"sifra" VARCHAR(15) NOT NULL, > =A0"naziv" VARCHAR(50) NOT NULL, > =A0PRIMARY KEY("id_robe") > ) WITH OIDS; > > ALTER TABLE "public"."test" > =A0ALTER COLUMN "id_robe" SET STATISTICS 0; > ALTER TABLE "public"."test" > =A0ALTER COLUMN "sifra" SET STATISTICS 0; > ALTER TABLE "public"."test" > =A0ALTER 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 > =A0t1.* > 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 > =A0t1.* > 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 > =A0t1.* > 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 retur= n all data in 8.4? > -- In field "sifra" data is stored in UPPER CASE, why query#2 return 2 ro= ws 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