• Tom Lane's avatar
    Re-establish postgres_fdw connections after server or user mapping changes. · 8bf58c0d
    Tom Lane authored
    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 ae9bfc5d
    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
    8bf58c0d
connection.c 35.7 KB