RefLib

Reference library for AI

Back

postgresql_16:9.6.12.14.4 Notes

PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > dblink — connect to other PostgreSQL databases > dblink_get_result > Notes

This function *must* be called if dblink_send_query returned 1. It must be called once for each query sent, and one additional time to obtain an empty set result, before the connection can be used again.

When using dblink_send_query and dblink_get_result, dblink fetches the entire remote query result before returning any of it to the local query processor. If the query returns a large number of rows, this can result in transient memory bloat in the local session. It may be better to open such a query as a cursor with dblink_open and then fetch a manageable number of rows at a time. Alternatively, use plain dblink(), which avoids memory bloat by spooling large result sets to disk.

Back