Re: how to determine what a process is doing - Mailing list pgsql-general

From Tom Lane
Subject Re: how to determine what a process is doing
Date
Msg-id 8145.975534223@sss.pgh.pa.us
Whole thread Raw
In response to how to determine what a process is doing  (Alex Howansky <alex@wankwood.com>)
Responses Re: how to determine what a process is doing
List pgsql-general
Alex Howansky <alex@wankwood.com> writes:
> Is there any way to determine exactly what a postgres process is
> doing at any time? The output from the ps command only shows "INSERT" or
> "SELECT", and not the full query string.

There isn't any really nice solution at the moment, but you could run
the postmaster with -d2 to cause writing of all queries to the
postmaster's log file (ie, its stdout/stderr).  You'd probably also want
to compile with ELOG_TIMESTAMPS defined (see include/config.h) to get
timestamps and process PIDs included in the log.  That'd give you info
to correlate against what "top" shows.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: ExecRestrPos: node type 18 not supported
Next
From: Tom Lane
Date:
Subject: Re: Warning: Don't delete those /tmp/.PGSQL.* files