On Wed, Nov 25, 2020 at 7:24 AM Craig Ringer <craig.rin...@enterprisedb.com> wrote: > > A quick thought here. > > Would it make sense to add a hook in the DISCARD ALL implementation that > postgres_fdw can register for? > > There's precedent here, since DISCARD ALL already has the same effect as > SELECT pg_advisory_unlock_all(); amongst other things. >
IIUC, then it is like a core(server) function doing some work for the postgres_fdw module. Earlier in the discussion, one point raised was that it's better not to have core handling something related to postgres_fdw. This is the reason we have come up with postgres_fdw specific function and a GUC, which get defined when extension is created. Similarly, dblink also has it's own bunch of functions one among them is dblink_disconnect(). With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com