postgresql/contrib
Fujii Masao e3ebcca843 postgres_fdw: Fix connection leak.
In postgres_fdw, the cached connections to foreign servers will not be
closed until the local session exits if the user mappings or foreign servers
that those connections depend on are dropped. Those connections can be
leaked.

To fix that connection leak issue, after a change to a pg_foreign_server
or pg_user_mapping catalog entry, this commit makes postgres_fdw close
the connections depending on that entry immediately if current
transaction has not used those connections yet. Otherwise, mark those
connections as invalid and then close them at the end of current transaction,
since they cannot be closed in the midst of the transaction using them.
Closed connections will be remade at the next opportunity if necessary.

Back-patch to all supported branches.

Author: Bharath Rupireddy
Reviewed-by: Zhihong Yu, Zhijie Hou, Fujii Masao
Discussion: https://postgr.es/m/CALj2ACVNcGH_6qLY-4_tXz8JLvA+4yeBThRfxMz7Oxbk1aHcpQ@mail.gmail.com
2020-12-28 19:56:13 +09:00
..
adminpack
amcheck Fix some typos 2020-11-14 11:43:10 +09:00
auth_delay
auto_explain
bloom
bool_plperl
btree_gin
btree_gist
citext
cube
dblink Improve hash_create()'s API for some added robustness. 2020-12-15 11:38:53 -05:00
dict_int
dict_xsyn
earthdistance
file_fdw Remove leftover comments, left behind by removal of WITH OIDS. 2020-11-30 10:26:43 +02:00
fuzzystrmatch
hstore Allow subscripting of hstore values. 2020-12-11 18:58:21 -05:00
hstore_plperl
hstore_plpython
intagg
intarray
isn
jsonb_plperl
jsonb_plpython
lo
ltree
ltree_plpython
oid2name
old_snapshot
pageinspect
passwordcheck
pg_buffercache
pg_freespacemap
pg_prewarm Fix race condition between shutdown and unstarted background workers. 2020-12-24 17:00:43 -05:00
pg_standby
pg_stat_statements Fix typos and grammar in docs and comments 2020-12-24 17:05:49 +09:00
pg_surgery
pg_trgm Handle equality operator in contrib/pg_trgm 2020-11-15 08:52:35 +03:00
pg_visibility
pgcrypto Refactor logic to check for ASCII-only characters in string 2020-12-21 09:37:11 +09:00
pgrowlocks
pgstattuple
postgres_fdw postgres_fdw: Fix connection leak. 2020-12-28 19:56:13 +09:00
seg
sepgsql Fix expected output: the order of agg permission checks changed. 2020-11-24 12:50:16 +02:00
spi
sslinfo Use be_tls_* API for SSL information in sslinfo 2020-11-03 09:47:36 +01:00
start-scripts
tablefunc Improve hash_create()'s API for some added robustness. 2020-12-15 11:38:53 -05:00
tcn
test_decoding Fix 'skip-empty-xacts' option in test_decoding for streaming mode. 2020-11-17 12:14:53 +05:30
tsm_system_rows
tsm_system_time
unaccent
uuid-ossp Improve some code around cryptohash functions 2020-12-14 12:38:13 +09:00
vacuumlo
xml2
contrib-global.mk
Makefile
README

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.