On Wed, Jul 1, 2020 at 5:15 AM Bharath Rupireddy <bharath.rupireddyforpostg...@gmail.com> wrote: > If I understand it correctly, your suggestion is to add > keep_connection option and use that while defining the server object. > IMO having keep_connection option at the server object level may not > serve the purpose being discussed here. > For instance, let's say I create a foreign server in session 1 with > keep_connection on, and I want to use that > server object in session 2 with keep_connection off and session 3 with > keep_connection on and so on. > One way we can change the server's keep_connection option is to alter > the server object, but that's not a good choice, > as we have to alter it at the system level. > > Overall, though we define the server object in a single session, it > will be used in multiple sessions, having an > option at the per-server level would not be a good idea.
You present this here as if it should be a Boolean (on or off) but I don't see why that should be the case. You can imagine trying to close connections if they have been idle for a certain length of time, or if there are more than a certain number of them, rather than (or in addition to) always/never. Which one is best, and why? I tend to think this is better as an FDW property rather than a core facility, but I'm not 100% sure of that and I think it likely depends somewhat on the answers we choose to the questions in the preceding paragraph. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company