On Thu, Oct 22, 2020 at 8:39 AM David G. Johnston <david.g.johns...@gmail.com> wrote: > >> If the backend is terminated within the user specified timeout then >> the function returns true, otherwise false. > > I’m suggesting an option for the second case to fail instead of returning > false. >
That seems fine. > >> > >> > I could imagine, in theory at least, wanting to wait for a backend to go >> > idle as well as for it disappearing. Scope creep in terms of this patch's >> > goal but worth at least considering now. >> > >> >> IIUC, do we need a new option, something like pg_wait_backend(pid, >> timeout, waituntil) where "waituntil" if specified "idle" waits until >> the given backend goes to idle mode, or "termination" waits until >> termination? >> >> If my understanding is wrong, could you please explain more? > > > Yes, this describes what i was thinking. > +1. I will implement these functionality and post a new patch soon. With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com