]> granicus.if.org Git - postgresql/commit
Re-establish postgres_fdw connections after server or user mapping changes.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 21 Jul 2017 16:51:38 +0000 (12:51 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 21 Jul 2017 16:51:38 +0000 (12:51 -0400)
commitd86a2b7b58bc9e5455a77f37690bf4588f4d2836
treebf11cea355d91956876389ccbbfc2de93062b387
parent38a4a5349c8f54a8d835675d395365d11628afac
Re-establish postgres_fdw connections after server or user mapping changes.

Previously, postgres_fdw would keep on using an existing connection even
if the user did ALTER SERVER or ALTER USER MAPPING commands that should
affect connection parameters.  Teach it to watch for catcache invals
on these catalogs and re-establish connections when the relevant catalog
entries change.  Per bug #14738 from Michal Lis.

In passing, clean up some rather crufty decisions in commit ae9bfc5d6
about where fields of ConnCacheEntry should be reset.  We now reset
all the fields whenever we open a new connection.

Kyotaro Horiguchi, reviewed by Ashutosh Bapat and myself.
Back-patch to 9.3 where postgres_fdw appeared.

Discussion: https://postgr.es/m/20170710113917.7727.10247@wrigleys.postgresql.org
contrib/postgres_fdw/connection.c
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/sql/postgres_fdw.sql