agora inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
Add "io worker" as backend_type to the pg_stat_activity documentation
12+ messages / 3 participants
[nested] [flat]

* Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-21 07:58  Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 12+ messages in thread

From: Laurenz Albe @ 2026-07-21 07:58 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org

I happened to notice that "io worker" was missing in the list of
backend types in the pg_stat_activity documentation.

Here is a patch to fix that.

I wondered vaguely if the list should be sorted alphabetically,
but didn't do it a) to keep the patch easy to read and
b) because the list is not long enough for readers to get lost.

Yours,
Laurenz Albe

Attachments:

  [text/x-patch] v1-0001-Document-io-worker-as-possible-backend_type.patch (1.3K, ../../5e94c0196084f648ae6a00107125494f5804318a.camel@cybertec.at/2-v1-0001-Document-io-worker-as-possible-backend_type.patch)
  download | inline diff:
From 44d1dd4353ef38e4fb5972973255f88336b1cccd Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Tue, 21 Jul 2026 09:53:11 +0200
Subject: [PATCH v1] Document "io worker" as possible backend_type

The documentation of pg_stat_activity lists all possible values for
the backend type, but when I/O workers were added, the list was not
amended.

Author: Laurenz Albe <laurenz.albe@cybertec.at>
---
 doc/src/sgml/monitoring.sgml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index d1a20d001e9..632ae7e345d 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1059,7 +1059,7 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
       <para>
        Type of current backend. Possible types are
        <literal>autovacuum launcher</literal>, <literal>autovacuum worker</literal>,
-       <literal>logical replication launcher</literal>,
+       <literal>io worker</literal>, <literal>logical replication launcher</literal>,
        <literal>logical replication worker</literal>,
        <literal>parallel worker</literal>, <literal>background writer</literal>,
        <literal>client backend</literal>, <literal>checkpointer</literal>,
-- 
2.55.0



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-21 08:02  Michael Paquier <michael@paquier.xyz>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 12+ messages in thread

From: Michael Paquier @ 2026-07-21 08:02 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-docs@lists.postgresql.org

On Tue, Jul 21, 2026 at 09:58:34AM +0200, Laurenz Albe wrote:
> I happened to notice that "io worker" was missing in the list of
> backend types in the pg_stat_activity documentation.

Right.

> Here is a patch to fix that.
> 
> I wondered vaguely if the list should be sorted alphabetically,
> but didn't do it a) to keep the patch easy to read and
> b) because the list is not long enough for readers to get lost.

And here I just thought while looking at this section of the docs that
the list is super long, and that we could reshape it the same way as
"state" for the possible values, sorting it on the way.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../al8noIYGjD_Lyyi8@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-21 09:59  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 12+ messages in thread

From: Laurenz Albe @ 2026-07-21 09:59 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: pgsql-docs@lists.postgresql.org

On Tue, 2026-07-21 at 17:02 +0900, Michael Paquier wrote:
> On Tue, Jul 21, 2026 at 09:58:34AM +0200, Laurenz Albe wrote:
> > I happened to notice that "io worker" was missing in the list of
> > backend types in the pg_stat_activity documentation.
> 
> Right.
> 
> > I wondered vaguely if the list should be sorted alphabetically,
> > but didn't do it a) to keep the patch easy to read and
> > b) because the list is not long enough for readers to get lost.
> 
> And here I just thought while looking at this section of the docs that
> the list is super long, and that we could reshape it the same way as
> "state" for the possible values, sorting it on the way.

Ok, here is a patch with the list sorted alphabetically and
converted into an itemiized list.

Yours,
Laurenz Albe

Attachments:

  [text/x-patch] v2-0001-Document-io-worker-as-possible-backend_type.patch (5.9K, ../../eb735d8aedf16ab2121af6f9b65b3274927afd2d.camel@cybertec.at/2-v2-0001-Document-io-worker-as-possible-backend_type.patch)
  download | inline diff:
From 7f53f7b1bb55e93586e4b7a1ffe25ace055d29cc Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Tue, 21 Jul 2026 11:58:07 +0200
Subject: [PATCH v2] Document "io worker" as possible backend_type

The documentation of pg_stat_activity lists all possible values for
the backend type, but when I/O workers were added, the list was not
amended.

Since the list is growing long, sort it alphabetically and convert
it to an itemized list.

Author: Laurenz Albe <laurenz.albe@cybertec.at>
Reviewed-By: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/5e94c0196084f648ae6a00107125494f5804318a.camel@cybertec.at
---
 doc/src/sgml/monitoring.sgml | 118 ++++++++++++++++++++++++++++++++---
 1 file changed, 108 insertions(+), 10 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index d1a20d001e9..f0e15d435fb 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1057,16 +1057,114 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
        <structfield>backend_type</structfield> <type>text</type>
       </para>
       <para>
-       Type of current backend. Possible types are
-       <literal>autovacuum launcher</literal>, <literal>autovacuum worker</literal>,
-       <literal>logical replication launcher</literal>,
-       <literal>logical replication worker</literal>,
-       <literal>parallel worker</literal>, <literal>background writer</literal>,
-       <literal>client backend</literal>, <literal>checkpointer</literal>,
-       <literal>archiver</literal>, <literal>standalone backend</literal>,
-       <literal>startup</literal>, <literal>walreceiver</literal>,
-       <literal>walsender</literal>, <literal>walwriter</literal> and
-       <literal>walsummarizer</literal>.
+       Type of current backend. Possible types are:
+       <itemizedlist>
+        <listitem>
+         <para>
+          <literal>archiver</literal>: The WAL archiver, active when
+          <xref linkend="guc-archive-mode"/> is <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>autovacuum launcher</literal>: The background process that
+          launches autovacuum workers, active when
+          <xref linkend="guc-autovacuum"/> is <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>autovacuum worker</literal>: A background process running
+          <command>VACUUM</command> or <command>ANALYZE</command> on a single
+          table.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>background writer</literal>: The background process that
+          makes sure that there are enough clean buffers in shared buffers.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>checkpointer</literal>: The background process that
+          performs <link linkend="wal-configuration">checkpoints</link>
+          regularly.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>client backend</literal>: The server process performing
+          work for a regular database connection.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>io worker</literal>: A background process performing
+          asynchronous I/O, active when <xref linkend="guc-io-method"/> is set
+          to <literal>worker</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication launcher</literal>: The background
+          process that launches logical replication worker processes for
+          subscriptions.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication worker</literal>: A background process
+          that applies data modifications replicated with logical replication.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>parallel worker</literal>: A background process that helps
+          a backend process to perform operations in parallel.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>standalone backend</literal>: The backend process when
+          <productname>PostgreSQL</productname> was started in
+          <xref linkend="app-postgres-single-user"/>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>startup</literal>: The background process that replays WAL
+          during crash recovery, archive recovery or streaming replication.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walreceiver</literal>: The background process that receives
+          WAL records from a WAL sender, active in streaming replication
+          standby mode.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walsender</literal>: A background process that sends WAL
+          records to receivers (during streaming replication) or decodes WAL
+          and sends the decoded information (during logical replication).
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walsummarizer</literal>: The background process that
+          creates summaries from WAL for use with incremental backup, active
+          when <xref linkend="guc-summarize-wal"/> is <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walwriter</literal>: The background process that persists
+          WAL records from WAL buffers to disk.
+         </para>
+        </listitem>
+       </itemizedlist>
        In addition, background workers registered by extensions may have
        additional types.
       </para></entry>
-- 
2.55.0



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-21 16:48  Fujii Masao <masao.fujii@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 12+ messages in thread

From: Fujii Masao @ 2026-07-21 16:48 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-docs@lists.postgresql.org

On Tue, Jul 21, 2026 at 6:59 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> On Tue, 2026-07-21 at 17:02 +0900, Michael Paquier wrote:
> > On Tue, Jul 21, 2026 at 09:58:34AM +0200, Laurenz Albe wrote:
> > > I happened to notice that "io worker" was missing in the list of
> > > backend types in the pg_stat_activity documentation.
> >
> > Right.

Isn't it better to add the other missing process names as well, such as
slotsync worker, data checksums launcher, data checksums worker, and
REPACK decoding worker?

Also, the current list says "logical replication worker", but that isn't
an actual process name. It refers to four different worker types:
logical replication apply worker, logical replication parallel worker,
logical replication sequence synchronization worker, and logical replication
table synchronization worker. Isn't it better to list those actual
process names instead?

Regards,

-- 
Fujii Masao






^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-21 19:04  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Laurenz Albe @ 2026-07-21 19:04 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@gmail.com>; +Cc: Michael Paquier <michael@paquier.xyz>; pgsql-docs@lists.postgresql.org

On Wed, 2026-07-22 at 01:48 +0900, Fujii Masao wrote:
> > > On Tue, Jul 21, 2026 at 09:58:34AM +0200, Laurenz Albe wrote:
> > > > I happened to notice that "io worker" was missing in the list of
> > > > backend types in the pg_stat_activity documentation.
> 
> Isn't it better to add the other missing process names as well, such as
> slotsync worker, data checksums launcher, data checksums worker, and
> REPACK decoding worker?
> 
> Also, the current list says "logical replication worker", but that isn't
> an actual process name. It refers to four different worker types:
> logical replication apply worker, logical replication parallel worker,
> logical replication sequence synchronization worker, and logical replication
> table synchronization worker. Isn't it better to list those actual
> process names instead?

You are right.  Here is patch v3 with a completed list; I hope I didn't
forget anything.

Yours,
Laurenz Albe

Attachments:

  [text/x-patch] v3-0001-Properly-document-pg_stat_activity.backend_type.patch (7.8K, ../../4aff5b0f5a1bf3b487d06daec5ed5a287afa7a22.camel@cybertec.at/2-v3-0001-Properly-document-pg_stat_activity.backend_type.patch)
  download | inline diff:
From 453957c7e2d39134b3a43c878f27f1748dde7c9f Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Tue, 21 Jul 2026 21:02:59 +0200
Subject: [PATCH v3] Properly document pg_stat_activity.backend_type

The documentation of pg_stat_activity should list all possible values
for the backend type, but the list was inaccurate and incomplete.

Since the complete list is pretty long, turn it into an alphabetically
sorted itemized list and add a description for each type.

Author: Laurenz Albe <laurenz.albe@cybertec.at>
Reviewed-By: Michael Paquier <michael@paquier.xyz>
Reviewed-By: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/5e94c0196084f648ae6a00107125494f5804318a.camel@cybertec.at
---
 doc/src/sgml/monitoring.sgml | 165 ++++++++++++++++++++++++++++++++---
 1 file changed, 155 insertions(+), 10 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index d1a20d001e9..12ecba6e275 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1057,16 +1057,161 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
        <structfield>backend_type</structfield> <type>text</type>
       </para>
       <para>
-       Type of current backend. Possible types are
-       <literal>autovacuum launcher</literal>, <literal>autovacuum worker</literal>,
-       <literal>logical replication launcher</literal>,
-       <literal>logical replication worker</literal>,
-       <literal>parallel worker</literal>, <literal>background writer</literal>,
-       <literal>client backend</literal>, <literal>checkpointer</literal>,
-       <literal>archiver</literal>, <literal>standalone backend</literal>,
-       <literal>startup</literal>, <literal>walreceiver</literal>,
-       <literal>walsender</literal>, <literal>walwriter</literal> and
-       <literal>walsummarizer</literal>.
+       Type of current backend. Possible types are:
+       <itemizedlist>
+        <listitem>
+         <para>
+          <literal>archiver</literal>: The WAL archiver, active when
+          <xref linkend="guc-archive-mode"/> is <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>autovacuum launcher</literal>: The background process that
+          launches autovacuum workers, active when
+          <xref linkend="guc-autovacuum"/> is <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>autovacuum worker</literal>: A background process running
+          <command>VACUUM</command> or <command>ANALYZE</command> on a single
+          table.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>background writer</literal>: The background process that
+          makes sure that there are enough clean buffers in shared buffers.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>checkpointer</literal>: The background process that
+          performs <link linkend="wal-configuration">checkpoints</link>
+          regularly.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>client backend</literal>: The server process performing
+          work for a regular database connection.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>datachecksums launcher</literal>: The background process
+          that launches data checksum workers.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>datachecksums worker</literal>: A background process that
+          calculates data checksums for all pages in one database.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>io worker</literal>: A background process performing
+          asynchronous I/O, active when <xref linkend="guc-io-method"/> is set
+          to <literal>worker</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication launcher</literal>: The background
+          process that launches logical replication worker processes for
+          subscriptions.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication apply worker</literal>: A background
+          process that applies data modifications on a logical subscriber.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication parallel worker</literal>: A background
+          process that applies data modifications on a logical subscriber
+          for a subscription with <literal>streaming = parallel</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication sequencesync worker</literal>: A
+          background process that replicates sequence data on a logical
+          subscriber.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication tablesync worker</literal>: A
+          background process that copies table data on a logical subscriber
+          for a subscription with <literal>copy_data = true</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>parallel worker</literal>: A background process that helps
+          a backend process to perform operations in parallel.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>REPACK decoding worker</literal>: A background process that
+          decodes WAL for <command>REPACK (CONCURRENTLY)</command>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>slotsync worker</literal>: The background process that
+          synchronizes logical replication slots on a streaming replication
+          standby server, active when <xref linkend="guc-sync-replication-slots"/>
+          is set to <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>standalone backend</literal>: The backend process when
+          <productname>PostgreSQL</productname> was started in
+          <xref linkend="app-postgres-single-user"/>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>startup</literal>: The background process that replays WAL
+          during crash recovery, archive recovery or streaming replication.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walreceiver</literal>: The background process that receives
+          WAL records from a WAL sender, active in streaming replication
+          standby mode.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walsender</literal>: A background process that sends WAL
+          records to receivers (during streaming replication) or decodes WAL
+          and sends the decoded information (during logical replication).
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walsummarizer</literal>: The background process that
+          creates summaries from WAL for use with incremental backup, active
+          when <xref linkend="guc-summarize-wal"/> is <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walwriter</literal>: The background process that persists
+          WAL records from WAL buffers to disk.
+         </para>
+        </listitem>
+       </itemizedlist>
        In addition, background workers registered by extensions may have
        additional types.
       </para></entry>
-- 
2.55.0



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-21 22:18  Michael Paquier <michael@paquier.xyz>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 2 replies; 12+ messages in thread

From: Michael Paquier @ 2026-07-21 22:18 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Fujii Masao <masao.fujii@gmail.com>; pgsql-docs@lists.postgresql.org

On Tue, Jul 21, 2026 at 09:04:15PM +0200, Laurenz Albe wrote:
> You are right.  Here is patch v3 with a completed list; I hope I didn't
> forget anything.

I am counting 23 entries.  I don't see anything forgotten on top of my
mind, and we are indeed missing a lot of new entries..  I feel that
like everybody who has added a new worker in the backend has forgotten
to update this list. 

While on it, I also feel like we may have some holes with
log_min_messages and the new process_type.  At least a bunch of them
are missing..  I'll ping that fact on a new thread.  No need to worry
about that here.

> +         <para>
> +          <literal>autovacuum worker</literal>: A background process running
> +          <command>VACUUM</command> or <command>ANALYZE</command> on a single
> +          table.
> +         </para>

Also active when autovacuum = on?

> +         <para>
> +          <literal>walreceiver</literal>: The background process that receives
> +          WAL records from a WAL sender, active in streaming replication
> +          standby mode.
> +         </para>

We can only have one of these.

> +        </listitem>
> +        <listitem>
> +         <para>
> +          <literal>walsender</literal>: A background process that sends WAL
> +          records to receivers (during streaming replication) or decodes WAL
> +          and sends the decoded information (during logical replication).
> +         </para>
> +        </listitem>

No mention of the max_wal_senders dependency?  Perhaps not worth
mentioning, still..
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../al_wOWrsHfB65Zbk@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-22 05:36  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Michael Paquier <michael@paquier.xyz>
  1 sibling, 1 reply; 12+ messages in thread

From: Laurenz Albe @ 2026-07-22 05:36 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Fujii Masao <masao.fujii@gmail.com>; pgsql-docs@lists.postgresql.org

On Wed, 2026-07-22 at 07:18 +0900, Michael Paquier wrote:
> On Tue, Jul 21, 2026 at 09:04:15PM +0200, Laurenz Albe wrote:
> > You are right.  Here is patch v3 with a completed list; I hope I didn't
> > forget anything.
> 
> I am counting 23 entries.  I don't see anything forgotten on top of my
> mind, and we are indeed missing a lot of new entries.

Great.

> > +         <para>
> > +          <literal>autovacuum worker</literal>: A background process running
> > +          <command>VACUUM</command> or <command>ANALYZE</command> on a single
> > +          table.
> > +         </para>
> 
> Also active when autovacuum = on?

Well, anti-wraparound autovacuum workers can also run if autovacuum = off.
Also, autovacuum workers only indirectly depend on the GUC.
I figured that if I say that the autovacuum launcher depends on the GUC and
launches autovacuum workers, the indirect dependency should be obvious.

> > +         <para>
> > +          <literal>walreceiver</literal>: The background process that receives
> > +          WAL records from a WAL sender, active in streaming replication
> > +          standby mode.
> > +         </para>
> 
> We can only have one of these.

That's why I said "*the* background process".
Or did I miss your point?

> > +        </listitem>
> > +        <listitem>
> > +         <para>
> > +          <literal>walsender</literal>: A background process that sends WAL
> > +          records to receivers (during streaming replication) or decodes WAL
> > +          and sends the decoded information (during logical replication).
> > +         </para>
> > +        </listitem>
> 
> No mention of the max_wal_senders dependency?  Perhaps not worth
> mentioning, still..

I don't want to mention all GUCs that have an influence on the processes,
and I feel that my descriptions are already pretty long.

If I mention that dependency, I should also mention that max_connections
limits the number of backends, and so on...

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-22 08:21  Michael Paquier <michael@paquier.xyz>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 12+ messages in thread

From: Michael Paquier @ 2026-07-22 08:21 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Fujii Masao <masao.fujii@gmail.com>; pgsql-docs@lists.postgresql.org

On Wed, Jul 22, 2026 at 07:36:14AM +0200, Laurenz Albe wrote:
> launches autovacuum workers, the indirect dependency should be
> obvious.

Okay.

> That's why I said "*the* background process".
> Or did I miss your point?

No, I have managed to miss the "the".

> If I mention that dependency, I should also mention that max_connections
> limits the number of backends, and so on...

Okay by me.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../amB9cf2mv53lC2dB@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-22 09:34  Fujii Masao <masao.fujii@gmail.com>
  parent: Michael Paquier <michael@paquier.xyz>
  1 sibling, 1 reply; 12+ messages in thread

From: Fujii Masao @ 2026-07-22 09:34 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-docs@lists.postgresql.org

On Wed, Jul 22, 2026 at 7:18 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Tue, Jul 21, 2026 at 09:04:15PM +0200, Laurenz Albe wrote:
> > You are right.  Here is patch v3 with a completed list; I hope I didn't
> > forget anything.
>
> I am counting 23 entries.  I don't see anything forgotten on top of my
> mind,

+1

Also a couple of minor comments:

+          <literal>archiver</literal>: The WAL archiver, active when
+          <xref linkend="guc-archive-mode"/> is <literal>on</literal>.

The archiver is also active when archive_mode = always. So isn't it better
to say "active when archive_mode is enabled" (as in the Glossary), or
"when archive_mode is on or always"?

+          <literal>logical replication launcher</literal>: The background
+          process that launches logical replication worker processes for
+          subscriptions.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication apply worker</literal>: A background
+          process that applies data modifications on a logical subscriber.

If these entries are meant to be in alphabetical order, shouldn't
"logical replication apply worker" come before "logical replication launcher"?

Regards,

-- 
Fujii Masao





^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-22 10:22  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Laurenz Albe @ 2026-07-22 10:22 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@gmail.com>; Michael Paquier <michael@paquier.xyz>; +Cc: pgsql-docs@lists.postgresql.org

On Wed, 2026-07-22 at 18:34 +0900, Fujii Masao wrote:
> a couple of minor comments:
> 
> +          <literal>archiver</literal>: The WAL archiver, active when
> +          <xref linkend="guc-archive-mode"/> is <literal>on</literal>.
> 
> The archiver is also active when archive_mode = always. So isn't it better
> to say "active when archive_mode is enabled" (as in the Glossary), or
> "when archive_mode is on or always"?

True.  I went with "enabled".

> +          <literal>logical replication launcher</literal>: The background
> +          process that launches logical replication worker processes for
> +          subscriptions.
> +         </para>
> +        </listitem>
> +        <listitem>
> +         <para>
> +          <literal>logical replication apply worker</literal>: A background
> +          process that applies data modifications on a logical subscriber.
> 
> If these entries are meant to be in alphabetical order, shouldn't
> "logical replication apply worker" come before "logical replication launcher"?

I must have picked the wrong collation :^/

v4 is attached.

Yours,
Laurenz Albe

Attachments:

  [text/x-patch] v4-0001-Properly-document-pg_stat_activity.backend_type.patch (7.8K, ../../659d0c76d86b5f0e4c37071ac7a7e2fd3efd9fdb.camel@cybertec.at/2-v4-0001-Properly-document-pg_stat_activity.backend_type.patch)
  download | inline diff:
From af0e0a1b50a3c1270077f64b88949a14fc1fd10d Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Wed, 22 Jul 2026 12:20:00 +0200
Subject: [PATCH v4] Properly document pg_stat_activity.backend_type

The documentation of pg_stat_activity should list all possible values
for the backend type, but the list was inaccurate and incomplete.

Since the complete list is pretty long, turn it into an alphabetically
sorted itemized list and add a description for each type.

Author: Laurenz Albe <laurenz.albe@cybertec.at>
Reviewed-By: Michael Paquier <michael@paquier.xyz>
Reviewed-By: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/5e94c0196084f648ae6a00107125494f5804318a.camel@cybertec.at
---
 doc/src/sgml/monitoring.sgml | 165 ++++++++++++++++++++++++++++++++---
 1 file changed, 155 insertions(+), 10 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index d1a20d001e9..b087d499041 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -1057,16 +1057,161 @@ postgres   27093  0.0  0.0  30096  2752 ?        Ss   11:34   0:00 postgres: ser
        <structfield>backend_type</structfield> <type>text</type>
       </para>
       <para>
-       Type of current backend. Possible types are
-       <literal>autovacuum launcher</literal>, <literal>autovacuum worker</literal>,
-       <literal>logical replication launcher</literal>,
-       <literal>logical replication worker</literal>,
-       <literal>parallel worker</literal>, <literal>background writer</literal>,
-       <literal>client backend</literal>, <literal>checkpointer</literal>,
-       <literal>archiver</literal>, <literal>standalone backend</literal>,
-       <literal>startup</literal>, <literal>walreceiver</literal>,
-       <literal>walsender</literal>, <literal>walwriter</literal> and
-       <literal>walsummarizer</literal>.
+       Type of current backend. Possible types are:
+       <itemizedlist>
+        <listitem>
+         <para>
+          <literal>archiver</literal>: The WAL archiver, active when
+          <xref linkend="guc-archive-mode"/> is enabled.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>autovacuum launcher</literal>: The background process that
+          launches autovacuum workers, active when
+          <xref linkend="guc-autovacuum"/> is <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>autovacuum worker</literal>: A background process running
+          <command>VACUUM</command> or <command>ANALYZE</command> on a single
+          table.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>background writer</literal>: The background process that
+          makes sure that there are enough clean buffers in shared buffers.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>checkpointer</literal>: The background process that
+          performs <link linkend="wal-configuration">checkpoints</link>
+          regularly.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>client backend</literal>: The server process performing
+          work for a regular database connection.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>datachecksums launcher</literal>: The background process
+          that launches data checksum workers.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>datachecksums worker</literal>: A background process that
+          calculates data checksums for all pages in one database.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>io worker</literal>: A background process performing
+          asynchronous I/O, active when <xref linkend="guc-io-method"/> is set
+          to <literal>worker</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication apply worker</literal>: A background
+          process that applies data modifications on a logical subscriber.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication launcher</literal>: The background
+          process that launches logical replication worker processes for
+          subscriptions.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication parallel worker</literal>: A background
+          process that applies data modifications on a logical subscriber
+          for a subscription with <literal>streaming = parallel</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication sequencesync worker</literal>: A
+          background process that replicates sequence data on a logical
+          subscriber.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>logical replication tablesync worker</literal>: A
+          background process that copies table data on a logical subscriber
+          for a subscription with <literal>copy_data = true</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>parallel worker</literal>: A background process that helps
+          a backend process to perform operations in parallel.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>REPACK decoding worker</literal>: A background process that
+          decodes WAL for <command>REPACK (CONCURRENTLY)</command>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>slotsync worker</literal>: The background process that
+          synchronizes logical replication slots on a streaming replication
+          standby server, active when <xref linkend="guc-sync-replication-slots"/>
+          is set to <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>standalone backend</literal>: The backend process when
+          <productname>PostgreSQL</productname> was started in
+          <xref linkend="app-postgres-single-user"/>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>startup</literal>: The background process that replays WAL
+          during crash recovery, archive recovery or streaming replication.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walreceiver</literal>: The background process that receives
+          WAL records from a WAL sender, active in streaming replication
+          standby mode.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walsender</literal>: A background process that sends WAL
+          records to receivers (during streaming replication) or decodes WAL
+          and sends the decoded information (during logical replication).
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walsummarizer</literal>: The background process that
+          creates summaries from WAL for use with incremental backup, active
+          when <xref linkend="guc-summarize-wal"/> is <literal>on</literal>.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+          <literal>walwriter</literal>: The background process that persists
+          WAL records from WAL buffers to disk.
+         </para>
+        </listitem>
+       </itemizedlist>
        In addition, background workers registered by extensions may have
        additional types.
       </para></entry>
-- 
2.55.0



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-23 07:23  Michael Paquier <michael@paquier.xyz>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 12+ messages in thread

From: Michael Paquier @ 2026-07-23 07:23 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Fujii Masao <masao.fujii@gmail.com>; pgsql-docs@lists.postgresql.org

On Wed, Jul 22, 2026 at 12:22:23PM +0200, Laurenz Albe wrote:
> v4 is attached.

This one looks pretty clean after double-checking, so applied on HEAD.
Thanks.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../amHBVABbfuOnMcc6@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: Add "io worker" as backend_type to the pg_stat_activity documentation
@ 2026-07-23 10:57  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 12+ messages in thread

From: Laurenz Albe @ 2026-07-23 10:57 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Fujii Masao <masao.fujii@gmail.com>; pgsql-docs@lists.postgresql.org

On Thu, 2026-07-23 at 16:23 +0900, Michael Paquier wrote:
> This one looks pretty clean after double-checking, so applied on HEAD.

Thanks for the review and the commit.

Laurenz Albe






^ permalink  raw  reply  [nested|flat] 12+ messages in thread


end of thread, other threads:[~2026-07-23 10:57 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-21 07:58 Add "io worker" as backend_type to the pg_stat_activity documentation Laurenz Albe <laurenz.albe@cybertec.at>
2026-07-21 08:02 ` Michael Paquier <michael@paquier.xyz>
2026-07-21 09:59   ` Laurenz Albe <laurenz.albe@cybertec.at>
2026-07-21 16:48     ` Fujii Masao <masao.fujii@gmail.com>
2026-07-21 19:04       ` Laurenz Albe <laurenz.albe@cybertec.at>
2026-07-21 22:18         ` Michael Paquier <michael@paquier.xyz>
2026-07-22 05:36           ` Laurenz Albe <laurenz.albe@cybertec.at>
2026-07-22 08:21             ` Michael Paquier <michael@paquier.xyz>
2026-07-22 09:34           ` Fujii Masao <masao.fujii@gmail.com>
2026-07-22 10:22             ` Laurenz Albe <laurenz.albe@cybertec.at>
2026-07-23 07:23               ` Michael Paquier <michael@paquier.xyz>
2026-07-23 10:57                 ` Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox