Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdEgQ-0005ot-U9 for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Jun 2019 14:01:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hdEgP-0001oa-Rz for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Jun 2019 14:01:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdESF-00071k-M9 for pgsql-bugs@lists.postgresql.org; Tue, 18 Jun 2019 13:47:20 +0000 Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdES9-0000Nl-0I for pgsql-bugs@lists.postgresql.org; Tue, 18 Jun 2019 13:47:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1560865630; bh=KSoHCJVNWYbG4pgcLf9xpzLYwvv/ZDoxjTDCEh44XsM=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=VoDBbwy09ydNbbyzBaHs6Axz0lKe540DorvvnevWyJo3bAWesTc5xuaLxKBq8hbWs1+nFkwJ95D3uxlL8U7mdgq6pspcuE+9xTeAG5T54akqhICsVCYVpgtVnv+4C0q3Xw3PNtx5ZLVCQ3A71FPNgl6jVdP50AxQufE0b4riXY3bLi9m8CAeTu9iP9dU9VzhSEjFTR5tl5Ec3UcBfD9IFR/xO1iEnBJbeaMb5S+3A5qKZ1Z+7dYGx4V/IAvWAYuyT0v7YUCzZnjsfAERpA7iMvldyFnnv+n/hW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fjDrU_FG_Xaoch.Ieq2lwhZSyhtLMi4gCX.W_d11ntbj 1Yoq3HTtRZA2WlNNlUwn3xt8WaXjqUpGF9iOpsIXLAKZsht3zVsHWdCXw4MqgtwzjeeujAJ8Ie22 szWyTEz_AsIMwFMWIcgfmksbWBge1MbPJr1JTIKhU93Z38oHQA3mFWDaFnNCQmaHTi1.kP1m1hgu jeLOSYaaVkjC4kaR5XFYqXV8rExv_2DziAYo1_8oGhjFJ7kWmwD4Wx87jFEKnuKrJMp53KH0- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Tue, 18 Jun 2019 13:47:10 +0000 Date: Tue, 18 Jun 2019 13:47:05 +0000 (UTC) From: Joao Ferreira To: Jeff Janes Cc: "pgsql-bugs@lists.postgresql.org" Message-ID: <578490000.3108136.1560865625299@mail.yahoo.com> In-Reply-To: References: <1407840601.3022762.1560857315693.ref@mail.yahoo.com> <1407840601.3022762.1560857315693@mail.yahoo.com> Subject: =?UTF-8?Q?Re:_Querying_foreign_table_with_SP-GiST_index_re?= =?UTF-8?Q?sults_in_=E2=80=9CERROR:_cache_l?= =?UTF-8?Q?ookup_failed_for_type_0=E2=80=9D?= MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3108135_1000828982.1560865625296" X-Mailer: WebService/1.1.13837 YMailNorrin Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36 Content-Length: 5299 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_3108135_1000828982.1560865625296 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you Jeff. I'll create the index on the geometry column as gist instead of spgist. On = my first impression it seems to work fine ;) Cheers, Jo=C3=A3o Ferreira On Tuesday, June 18, 2019, 01:22:27 PM GMT+1, Jeff Janes wrote: =20 =20 On Tue, Jun 18, 2019 at 8:02 AM Joao Ferreira wrot= e: Greetings, I'm using PostgreSQL 11.3 and I want to access a table in another Postgres = database using=C2=A0postgres_fdw=C2=A0but since the original table has an= =C2=A0SP-GiST=C2=A0index on a geometry column, the query on the foreign tab= le fails with "ERROR: cache lookup failed for type 0", even if the table is= empty (Step 7). This doesn't happen if the query is done directly to the r= emote table (Steps 3 and 6)=C2=A0or if the remote table doesn't have the in= dex (Steps 3 and 4). I've verified this on ubuntu 18.04 with 11.3 installed from PGDG apt repo, = and attached a single-file reproduction. If I change from sp-gist to just gist, there is no problem.=C2=A0 And if I = change to indexing a built-in sp-gist operator class (point rather than geo= m), there is also no problem. Getting postgis to compile is a bit hard and slow, so I haven't completed a= ny tests against the unreleased versions yet.=C2=A0Cheers, Jeff =20 ------=_Part_3108135_1000828982.1560865625296 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you Jeff.

I'll create the index= on the geometry column as gist instead of spgist. On my first impression i= t seems to work fine ;)

Cheers,

Jo=C3=A3o Ferreira

=20
=20
On Tuesday, June 18, 2019, 01:22:27 PM GMT+1, Jeff Jane= s <jeff.janes@gmail.com> wrote:


On Tue, Jun 18, 2019 at 8:02 AM J= oao Ferreira <jpgferreira@yahoo.com> wrote:
Greetings,

=
I'm using PostgreSQL 11.3 and I want to access a table in another Post= gres database using postg= res_fdw&nb= sp;but since the original table has an SP-GiST index on a geometry column, the query on the foreign table= fails with "ERROR: cache lookup failed for type 0", even if the table is e= mpty (Step 7). This doesn't happen if the query is done directly to the rem= ote table (St= eps 3 and 6) or if the remote table doesn't have the ind= ex (Steps 3 and 4).
=
I've verified this on ubuntu 18.04 with 11.3 = installed from PGDG apt repo, and attached a single-file reproduction.

If I change from sp-gist to just gist, = there is no problem.  And if I change to indexing a built-in sp-gist o= perator class (point rather than geom), there is also no problem.

Getting postgis to compile is a bit hard and= slow, so I haven't completed any tests against the unreleased versions yet= .
 
Cheers,

Jeff
------=_Part_3108135_1000828982.1560865625296--