postgres_fdw: Add option to control whether to keep connections open.
Fujii Masao <fujii@postgresql.org>
postgres_fdw: Add option to control whether to keep connections open. This commit adds a new option keep_connections that controls whether postgres_fdw keeps the connections to the foreign server open so that the subsequent queries can re-use them. This option can only be specified for a foreign server. The default is on. If set to off, all connections to the foreign server will be discarded at the end of transaction. Closed connections will be re-established when they are necessary by future queries using a foreign table. This option is useful, for example, when users want to prevent the connections from eating up the foreign servers connections capacity. Author: Bharath Rupireddy Reviewed-by: Alexey Kondratov, Vignesh C, Fujii Masao Discussion: https://postgr.es/m/CALj2ACVvrp5=AVp2PupEm+nAC8S4buqR3fJMmaCoc7ftT0aD2A@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/postgres_fdw/connection.c | modified | +29 −4 |
| contrib/postgres_fdw/expected/postgres_fdw.out | modified | +22 −1 |
| contrib/postgres_fdw/option.c | modified | +3 −1 |
| contrib/postgres_fdw/sql/postgres_fdw.sql | modified | +13 −0 |
| doc/src/sgml/postgres-fdw.sgml | modified | +34 −3 |
Documentation touched
Discussion
- [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit 175 messages · 2020-06-22 → 2021-04-02