test=# SELECT (x).pid, (x).backend_type FROM (SELECT pg_stat_get_activity(NULL) AS x) AS y; pid | backend_type ------+------------------------------ 4924 | autovacuum launcher 4946 | logical replication launcher 5086 | client backend 4922 | background writer 4921 | checkpointer 4923 | walwriter (6 rows)