select now(), query_start as started_at, now() - query_start as query_duration, format('[%s] %s', a.pid, a.query) as pid_and_query, index_relid::regclass as index_name, relid::regclass as table_name, (pg_size_pretty(pg_relation_size(relid))) as table_size, nullif(wait_event_type, '') || ': ' || wait_event as wait_type_and_event, phase, format( '%s (%s of %s)', coalesce((round(100 * blocks_done::numeric / nullif(blocks_total, 0), 2))::text || '%', 'N/A'), coalesce(blocks_done::text, '?'), coalesce(blocks_total::text, '?') ) as blocks_progress, format( '%s (%s of %s)', coalesce((round(100 * tuples_done::numeric / nullif(tuples_total, 0), 2))::text || '%', 'N/A'), coalesce(tuples_done::text, '?'), coalesce(tuples_total::text, '?') ) as tuples_progress, current_locker_pid, ...