pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: rihad <rihad@mail.ru>
Cc: Garfield Lewis <garfield.lewis@lzlabs.com>
Cc: pgsql-general General <pgsql-general@postgresql.org>
Subject: Re: Currently running queries with actual arguments?
Date: Thu, 7 Oct 2021 14:47:19 -0400
Message-ID: <20211007184718.GD5476@momjian.us> (raw)
In-Reply-To: <ff6a5a5c-6fa2-90dc-1a52-e7ee1a839030@mail.ru>
References: <12669af6-901c-4b7f-834b-e17cf99e94df@mail.ru>
	<FB2D6F2B-FCDF-4195-8092-9FA0A0515EC3@lzlabs.com>
	<ff6a5a5c-6fa2-90dc-1a52-e7ee1a839030@mail.ru>

On Thu, Sep 23, 2021 at 08:51:49PM +0400, rihad wrote:
> On 9/23/21 7:58 PM, Garfield Lewis wrote:
> > The way I normally get this info is by setting the following:
> > 
> > log_statement = 'all'
> > 
> > then the arguments will be printed in the postgres.log file. There could be some other way but that is what I know.
> > 
> 
> Thanks, those queries are logged after their completion, but I specifically
> need the list of unfinished long queries currently being executed.

Uh, log_statement prints them before they are executed ---
log_min_duration_statment prints them after execution.  You can verify
this by running:

	SET log_statement = 'all';
	SELECT pg_sleep(430);

and then looking in the log file.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.






view thread (4+ messages)

Message-ID: <20211007184718.GD5476@momjian.us>
Permalink:  ../20211007184718.GD5476@momjian.us/
Also on:    postgresql.org/message-id/20211007184718.GD5476@momjian.us

 · 

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: bruce@momjian.us, rihad@mail.ru, garfield.lewis@lzlabs.com
  Subject: Re: Currently running queries with actual arguments?
  In-Reply-To: <20211007184718.GD5476@momjian.us>
  References: <12669af6-901c-4b7f-834b-e17cf99e94df@mail.ru> <FB2D6F2B-FCDF-4195-8092-9FA0A0515EC3@lzlabs.com> <ff6a5a5c-6fa2-90dc-1a52-e7ee1a839030@mail.ru> <20211007184718.GD5476@momjian.us>

* 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