Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLbfZ-0007hm-DJ for pgsql-bugs@postgresql.org; Tue, 09 Oct 2012 15:24:29 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLbfW-0000KO-14 for pgsql-bugs@postgresql.org; Tue, 09 Oct 2012 15:24:29 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLbfU-0001bN-I1 for pgsql-bugs@postgresql.org; Tue, 09 Oct 2012 15:24:25 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TLbfT-00063H-Si for pgsql-bugs@postgresql.org; Tue, 09 Oct 2012 15:24:23 +0000 Date: Tue, 09 Oct 2012 15:24:23 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7591: Large query string has limit To: pgsql-bugs@postgresql.org From: pking@nrcan.gc.ca X-Pg-Spam-Score: -4.0 (----) X-Archive-Number: 201210/63 X-Sequence-Number: 34363 The following bug has been logged on the website: Bug reference: 7591 Logged by: Pat King Email address: pking@nrcan.gc.ca PostgreSQL version: 9.1.3 Operating system: RedHat Linux 6.2 Description: = Hi : I am dealing with the open source program called "Geonetwork". It is passing the following query to postgres/postgis : SELECT "fid", asText("the_geom") FROM "public"."spatialindex" WHERE ("fid" = =3D '10') OR ("fid" =3D '100') OR ("fid" =3D '1000') OR ("fid" =3D '10001') OR = ("fid" =3D '10005') .......... Unfortunately, the query has > 50,000 OR clauses, and the query hangs. I tried the query for < 50,000 OR clauses with success. The spatialindex table is : geonetwork=3D# \d spatialindex Table "public.spatialindex" Column | Type | Modifiers ----------+------------------------+----------- fid | integer | not null id | character varying(250) | the_geom | geometry | Indexes: "spatialindex_pkey" PRIMARY KEY, btree (fid) "spatialindexndx1" btree (id) "spatialindexndx2" gist (the_geom) Check constraints: "enforce_dims_the_geom" CHECK (st_ndims(the_geom) =3D 2) "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) =3D 'MULTIPOLYGON'::text OR the_geom IS NULL) "enforce_srid_the_geom" CHECK (st_srid(the_geom) =3D 4326)