3 ms·
Just be careful with FDWs. They run outside of many of the normal checks within the PG server and so a badly written FDW can actually cause the whole server to
by mason55 11y ago
Just be careful with FDWs. They run outside of many of the normal checks within the PG server and so a badly written FDW can actually cause the whole server to crash. We've experienced a number of issues with the MongoDB FDW from Citus where we do benign things like comparing an integer to a string and the entire Postgres server goes down. Another issues we've run into is that the query planning cache seems to get confused by FDWs, and if we try to query an FDW from within a stored procedure it just never returns or it crashes the DB. Instead we have to construct the query with dynamic SQL inside the stored proc which is both a pain in the ass and way increases the chances for bugs.
We're still on 9.1 so maybe some of this has been fixed by now but people seem to push FDWs as this panacea where you get all the guarantees & safety of running within Postgres and that's just not the case.
- avifreedman 11y agoGood advice... In our case (@kentik), we're mainly focused on having a Dremel-like system accessible via FDW. Primarily we're using Postgres as the "API" to it, so if it dies as a result of an FDW bug it'd be a primary operational problem for us.