Skip site navigation (1) Skip section navigation (2)

Re: Determine current running query, but no query in pg_stat_activity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Witney <awitney(at)sghms(dot)ac(dot)uk>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Determine current running query, but no query in pg_stat_activity
Date: 2005-03-29 16:02:14
Message-ID: 22780.1112112134@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
Adam Witney <awitney(at)sghms(dot)ac(dot)uk> writes:
> I am logged in as the superuser, and I just switched stats_command_string
> on.

Just now?  Too late then --- it needed to be on at the time the other
guy started his query, else he did not send the string to the stats
collector.

> I did find a reference on google to the fact that there was/is a max query
> size length for this?

Yeah, but it truncates, it doesn't just drop the string.

If you are feeling desperate you can attach to the other backend with
gdb:

	$ gdb /path/to/postgres backend-PID
	gdb> print debug_query_string
	gdb> quit
	detach and let process continue? y
	$

			regards, tom lane

In response to

pgsql-admin by date

Next:From: Scott MarloweDate: 2005-03-29 16:02:42
Subject: Re: Determine current running query,
Previous:From: Adam WitneyDate: 2005-03-29 15:50:27
Subject: Re: Determine current running query,

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group