I wrote: > ... maybe we could do "select 1 from > pg_stat_activity where application_name = computed-pattern", but that > has the same problem that a cache flush might have terminated the > remote session.
Hah - I thought of a solution. We can avoid this race condition if we make the remote session itself inspect pg_stat_activity and return its displayed application_name. Just need a foreign table that maps onto pg_stat_activity. Of course, this'd add yet another layer of baroque-ness to a test section that I already don't think is worth the trouble. Should we go that way, or just rip it out? regards, tom lane