Re: pgmonitor patch for query string

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: pgmonitor patch for query string
Date: 2001-03-14 18:27:11
Message-ID: 200103141827.NAA00281@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian writes:
>
> > It does this by creating a global variable 'debug_query_string' and
> > assigning it when the query begins and clearing it when the query ends.
>
> You can find out the current query for a given backend by configuring the
> server with "debug_print_query on" and "log_pids on" and running
>
> sed -n "/[$pid]/"'s/^.*query: \(.*\)$/\1/p' $logfile
>
> This doesn't tell you whether the query is still running, but ps tells you
> that. In fact, it might be an idea to add a logging option that prints
> something like "query finished in xxx ms". We actually have something
> similar hidden under show_query_stats, but the formatting needs to be made
> more convenient and possibly less verbose. But at least this way you have
> it for the record, and not only on the screen.

Yes, I thought of that idea. I wasn't sure I would be able to find the
log file in any installation-independent way, or even if a log file was
even being kept.

And I was afraid some people wouldn't want to log all queries.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Swan 2001-03-14 18:30:59 Re: AW: Shutdown term
Previous Message Roland Roberts 2001-03-14 18:23:30 Re: AW: Re: Week number