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