pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pete O'Such <posuch@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PG FDW query fails, works local, same credentials
Date: Thu, 31 Aug 2023 00:46:28 -0400
Message-ID: <305861.1693457188@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEdngj828Z=6gfHxq1-Q0uLW6YkzP3-EeSuw1E7ZxSiMuvnpVA@mail.gmail.com>
References: <CAEdngj828Z=6gfHxq1-Q0uLW6YkzP3-EeSuw1E7ZxSiMuvnpVA@mail.gmail.com>

"Pete O'Such" <posuch@gmail.com> writes:
> I've got a view on server A (PG 15.2) that fails when queried via FDW from
> server B (also PG 15.2).  Querying it as a foreign table from server B
> yields a message like "ERROR:  function blah(type) does not exist".

Check your search path assumptions.  postgres_fdw runs remote queries
with a very minimal search_path setting, so that unqualified references
to non-built-in objects are likely to fail.

			regards, tom lane





view thread (3+ messages)  latest in thread

Message-ID: <305861.1693457188@sss.pgh.pa.us>
Permalink:  ../305861.1693457188@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/305861.1693457188@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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, posuch@gmail.com
  Subject: Re: PG FDW query fails, works local, same credentials
  In-Reply-To: <305861.1693457188@sss.pgh.pa.us>
  References: <CAEdngj828Z=6gfHxq1-Q0uLW6YkzP3-EeSuw1E7ZxSiMuvnpVA@mail.gmail.com> <305861.1693457188@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