This predicate is, I think, comprehensive, but it seems fragile, since new
state and backend_type values could be added.
( client_hostname IS NULL
AND state IS NOT NULL
AND backend_type IN ( 'client backend'
, 'parallel worker'
, 'autovacuum launcher'
, 'autovacuum worker')
)
Thus, client_hostname set to "unix" or "socket" on such local connections
would be handy.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!