FDW connect errors
How do I troubleshoot the error
ERROR: could not connect to server "ar_db_server" (SQLSTATE 08001)
that I get trying to get fdw working? This error code suggests a network issue, and it occurs immediately (doesn't seem like a timeout). This is being run in the Neon SQL Editor, the foreign db is a separate Neon project that I also own. I have checked the host / username / pw / schema many times and verified the role on the foreign db has permissions to use the schema and SELECT from the table (the same role is in use elsewhere and is successfully reading from these schema tables). Everything thru creating the schema imported_data works fine. Also, if instead of IMPORTing the foreign table I create it explicitly with (removing all enum and primary key references), the table gets created properly but if you try to query it you get the same could not connect
error as above.
4 Replies
deep-jade•5mo ago
Try remove
-pooler
from the connection string. That is the flag to use connection pooling via pgbouncer. I imagine FDW via pgbouncer isn't supportedcontinuing-cyan•5mo ago
That did it. Could you guys add this to your docs on postgres_fdw? Thanks!
deep-jade•5mo ago
Cc @Daniel
continuing-cyan•5mo ago
If a branch is created from a db that has CREATE USER MAPPING needed for fdw, is the password stored with that Mapping brought over to the branch? Does this behavior vary depending on if the parent branch is protected (like Role passwords are reset when branched)?