PG FDW query fails, works local, same credentials - Mailing list pgsql-general

From Pete O'Such
Subject PG FDW query fails, works local, same credentials
Date
Msg-id CAEdngj828Z=6gfHxq1-Q0uLW6YkzP3-EeSuw1E7ZxSiMuvnpVA@mail.gmail.com
Whole thread Raw
Responses Re: PG FDW query fails, works local, same credentials  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
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".

Confusingly, I succeed when: I log into server A, set my role to match the role used with the FDW, and query with the exact query text that server B sent to server A (according to the error on server B).

The function that it complains about does exist, and I have made the effort to provide appropriate grants to the role in question.  So it does work as expected from within server A, as the same role. But why would it then fail from server B?

Both cases use the same role/credentials.  Plenty of other foreign tables work in this same setup between these two servers, whether pointing to tables or views.  I hit and resolved similar issues earlier where the role lacked necessary grants.  Having experienced it before, this time I'm pretty sure that the right grants are in place, yet it still fails when used via FDW.

I'm running out of things to try and wondering if this will turn out to be a bug.  What should I be trying before reporting it as a bug?

Thanks,
Pete

pgsql-general by date:

Previous
From: Dimitrios Apostolou
Date:
Subject: Re: Partitionwise JOIN scanning all partitions, even unneeded ones
Next
From: Tom Lane
Date:
Subject: Re: PG FDW query fails, works local, same credentials