pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Ramsey <pramsey@cleverelephant.ca>
Cc: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Joao Ferreira <jpgferreira@yahoo.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Re: Querying foreign table with SP-GiST index results in “ERROR: cache lookup failed for type 0”
Date: Wed, 26 Jun 2019 19:39:43 -0400
Message-ID: <18552.1561592383@sss.pgh.pa.us> (raw)
In-Reply-To: <F549949F-9E52-4067-BC0D-3149AF4F4D51@cleverelephant.ca>
References: <1407840601.3022762.1560857315693.ref@mail.yahoo.com>
	<1407840601.3022762.1560857315693@mail.yahoo.com>
	<CAMkU=1xocCv5rASP6+GAk3KyhQ-CrzoezQ-vb8p6UuHnX6k38Q@mail.gmail.com>
	<CAPmGK15z66yN9e=PU4pSpSi6Qs5NG+J4MoEOCLDB79ESadPG0A@mail.gmail.com>
	<CAPmGK16s=M3P28tP_XRiWT49nYysa72MOx57VWWA_VJekrkCNQ@mail.gmail.com>
	<12443.1561583207@sss.pgh.pa.us>
	<F549949F-9E52-4067-BC0D-3149AF4F4D51@cleverelephant.ca>

Paul Ramsey <pramsey@cleverelephant.ca> writes:
>> On Jun 26, 2019, at 2:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> More than a bit :-(.  That's guaranteed to fail if type box2df isn't
>> in the search path, which it likely won't be during a remote query,
>> since postgres_fdw locks down the search path to just pg_catalog.

> We had a similar problem, if I recall correctly, doing lookups of spatial reference information, for similar reasons: calling over FDW the search_path was so limited the internal lookup functions couldn’t find the spatial_ref_sys table. I just looked up the work-around, and it looks like we infer that the table we’re looking for (part of PostGIS) resides in the same schema as the calling function (part of PostGIS), and then cache that schema name for future use.

Yeah.  The variant I was thinking about was to look up the namespace
of the geometry type (which in this example you could get from attType
of the spgConfigIn parameter struct) and assume that box2df is in that
schema.  But working from the function's own schema might be better
because you could do the same thing in all these places, rather than
needing to find an associated object in some call-site-specific way.

			regards, tom lane





view thread (9+ messages)  latest in thread

Message-ID: <18552.1561592383@sss.pgh.pa.us>
Permalink:  ../18552.1561592383@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18552.1561592383@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, pramsey@cleverelephant.ca, etsuro.fujita@gmail.com, jeff.janes@gmail.com, jpgferreira@yahoo.com
  Subject: Re: Querying foreign table with SP-GiST index results in “ERROR: cache lookup failed for type 0”
  In-Reply-To: <18552.1561592383@sss.pgh.pa.us>
  References: <1407840601.3022762.1560857315693.ref@mail.yahoo.com> <1407840601.3022762.1560857315693@mail.yahoo.com> <CAMkU=1xocCv5rASP6+GAk3KyhQ-CrzoezQ-vb8p6UuHnX6k38Q@mail.gmail.com> <CAPmGK15z66yN9e=PU4pSpSi6Qs5NG+J4MoEOCLDB79ESadPG0A@mail.gmail.com> <CAPmGK16s=M3P28tP_XRiWT49nYysa72MOx57VWWA_VJekrkCNQ@mail.gmail.com> <12443.1561583207@sss.pgh.pa.us> <F549949F-9E52-4067-BC0D-3149AF4F4D51@cleverelephant.ca> <18552.1561592383@sss.pgh.pa.us>

* 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