Re: PG FDW query fails, works local, same credentials

From: "Pete O'Such" <posuch(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PG FDW query fails, works local, same credentials
Date: 2023-09-01 07:10:34
Message-ID: CAEdngj9XPBLD=Vi5c2iZerAPfrEX0kbiYfeqH=oPhed+ZFfCmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Check your search path assumptions. postgres_fdw runs remote
> queries with a very minimal search_path setting,

Indeed it was the search path, combined with references to user-defined
functions that weren't schema-qualified.

Thank you for the pointer!

-Pete

On Thu, Aug 31, 2023 at 12:46 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "Pete O'Such" <posuch(at)gmail(dot)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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sai Teja 2023-09-01 14:22:35 Taking too much time to fetch the data from Azure postgreSQL Large objects (pg_largeobjects)
Previous Message Jethro Elmer Sanidad 2023-09-01 03:05:07 Re: [EXTERNAL] Oracle FDW version