From: Joao Ferreira <jpgferreira@yahoo.com>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Querying foreign table with SP-GiST index results in “ERROR: cache lookup failed for type 0”
Date: Tue, 18 Jun 2019 13:47:05 +0000 (UTC)
Message-ID: <578490000.3108136.1560865625299@mail.yahoo.com> (raw)
In-Reply-To: <CAMkU=1xocCv5rASP6+GAk3KyhQ-CrzoezQ-vb8p6UuHnX6k38Q@mail.gmail.com>
References: <1407840601.3022762.1560857315693.ref@mail.yahoo.com>
<1407840601.3022762.1560857315693@mail.yahoo.com>
<CAMkU=1xocCv5rASP6+GAk3KyhQ-CrzoezQ-vb8p6UuHnX6k38Q@mail.gmail.com>
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ão Ferreira
On Tuesday, June 18, 2019, 01:22:27 PM GMT+1, Jeff Janes <jeff.janes@gmail.com> wrote:
On Tue, Jun 18, 2019 at 8:02 AM Joao Ferreira <jpgferreira@yahoo.com> wrote:
Greetings,
I'm using PostgreSQL 11.3 and I want to access a table in another Postgres database using postgres_fdw 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 empty (Step 7). This doesn't happen if the query is done directly to the remote table (Steps 3 and 6) or if the remote table doesn't have the index (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 operator 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: jpgferreira@yahoo.com, jeff.janes@gmail.com
Subject: Re: Querying foreign table with SP-GiST index results in “ERROR: cache lookup failed for type 0”
In-Reply-To: <578490000.3108136.1560865625299@mail.yahoo.com>
References: <1407840601.3022762.1560857315693.ref@mail.yahoo.com> <1407840601.3022762.1560857315693@mail.yahoo.com> <CAMkU=1xocCv5rASP6+GAk3KyhQ-CrzoezQ-vb8p6UuHnX6k38Q@mail.gmail.com> <578490000.3108136.1560865625299@mail.yahoo.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