pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David G. Johnston <david.g.johnston@gmail.com>
To: Robert Lichtenberger <r.lichtenberger@synedra.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: pg_stat_activity.query empty
Date: Tue, 26 Apr 2022 16:24:12 +0200
Message-ID: <b0c734cdbd70b890cc719bdc5ab2b4512a02f522.camel@cybertec.at> (raw)
In-Reply-To: <CAKFQuwbGGMETbFKV7BwW95Hr0OK2HeWpdTA6m=KhpeEbugfSUg@mail.gmail.com>
References: <ad84086a-12fc-f1e7-a24e-c24674a745d8@synedra.com>
	<CAKFQuwbGGMETbFKV7BwW95Hr0OK2HeWpdTA6m=KhpeEbugfSUg@mail.gmail.com>

On Tue, 2022-04-26 at 06:59 -0700, David G. Johnston wrote:
> On Tue, Apr 26, 2022 at 6:55 AM Robert Lichtenberger <r.lichtenberger@synedra.com> wrote:
> > When executing "SELECT * FROM pg_stat_activity" I get lots of rows that 
> > have an empty "query" column.
> > 
> > According to [1] this column should contain the "Text of this backend's 
> > most recent query", either a query that is currently running or the last 
> > query that was executed.
> > 
> > So how comes that a lot of the rows in pg_stat_activity have an empty 
> > "query"?
> > 
> > https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW
> 
> They've never executed a query.  Probably due to connection pooling opening connections for the pool but never needing to hand them out.

An alternative option is that the last query sent was an empty string.

Yours,
Laurenz Albe






view thread (4+ messages)  latest in thread

Message-ID: <b0c734cdbd70b890cc719bdc5ab2b4512a02f522.camel@cybertec.at>
Permalink:  ../b0c734cdbd70b890cc719bdc5ab2b4512a02f522.camel@cybertec.at/
Also on:    postgresql.org/message-id/b0c734cdbd70b890cc719bdc5ab2b4512a02f522.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, david.g.johnston@gmail.com, r.lichtenberger@synedra.com
  Subject: Re: pg_stat_activity.query empty
  In-Reply-To: <b0c734cdbd70b890cc719bdc5ab2b4512a02f522.camel@cybertec.at>
  References: <ad84086a-12fc-f1e7-a24e-c24674a745d8@synedra.com> <CAKFQuwbGGMETbFKV7BwW95Hr0OK2HeWpdTA6m=KhpeEbugfSUg@mail.gmail.com> <b0c734cdbd70b890cc719bdc5ab2b4512a02f522.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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