session A:
postgres=# create table tb1 (a int);
CREATE TABLE
postgres=# begin;
postgres=# insert into tb1 select generate_series(1,100000000);
session B:
postgres=# select * from pg_stat_activity;
datid | datname | procpid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | xact_start
| query_start | waiting | current_query
-------+----------+---------+----------+----------+------------------+-------------+-----------------+-------------+-------------------------------+--------------------
-----------+-------------------------------+---------+------------------------------------------------------
12699 | postgres | 10305 | 10 | postgres | psql | | | -1