Re: [BeginnerQuestion]Why these is 6 rows in my SELECT statement?

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: BeginnerC <chuxuec(at)outlook(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: [BeginnerQuestion]Why these is 6 rows in my SELECT statement?
Date: 2022-09-08 09:02:05
Message-ID: CAB8KJ=iaVh=tiDq97AaWWA=z74r3gD-TfZZwzS2KPb90h90Wmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2022年9月8日(木) 17:37 BeginnerC <chuxuec(at)outlook(dot)com>:
>
> Hello community,
> I am checking my pg_stat_activity view,but something confused me.
> Just like this:
>
> postgres=# SELECT wait_event_type, wait_event FROM pg_stat_activity;
> wait_event_type | wait_event
> -----------------+---------------------
> Activity | AutoVacuumMain
> Activity | LogicalLauncherMain
> |
> Activity | BgWriterHibernate
> Activity | CheckpointerMain
> Activity | WalWriterMain
> (6 rows)
>
> As you can see, the third row is empty,but I don't know why.
> Can anyone provide some solution to me?

It's empty because that's your own client session and it's not waiting
on anything :).

postgres=# SELECT pg_backend_pid();
pg_backend_pid
----------------
24941
(1 row)

postgres=# SELECT pid, backend_type, wait_event_type, wait_event
FROM pg_stat_activity;
pid | backend_type | wait_event_type |
wait_event
-------+------------------------------+-----------------+---------------------
20859 | autovacuum launcher | Activity | AutoVacuumMain
20860 | logical replication launcher | Activity |
LogicalLauncherMain
21554 | walsender | Activity | WalSenderMain
24941 | client backend | |
20856 | background writer | Activity | BgWriterHibernate
20855 | checkpointer | Activity | CheckpointerMain
20858 | walwriter | Activity | WalWriterMain
(7 rows)

Regards

Ian Barwick

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matheus Martin 2022-09-08 10:17:54 Re: Missing query plan for auto_explain.
Previous Message BeginnerC 2022-09-08 08:37:00 [BeginnerQuestion]Why these is 6 rows in my SELECT statement?