Re: Checking what is the current query running

From: "Dilipkumar" <dilipkumar_parikh(at)sifycorp(dot)com>
To: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>, "Postgres" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Checking what is the current query running
Date: 2006-07-25 10:15:31
Message-ID: 0b6f01c6afd3$42667910$4d7ad2d2@sifydba
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

HI,

Is there any way to log all the queries in 7.1.1 (older release).please help out guys.

Thanks & Regards
Dilipkumar
----- Original Message -----
From: Shoaib Mir
To: Postgres
Sent: Tuesday, July 25, 2006 2:26 PM
Subject: Re: [ADMIN] Checking what is the current query running

You have to enable "stats_command_string' in your postgresql.conf file:

stats_command_string = on

After that is done you can view queries running on database server like this:

select current_query from pg_stat_activity;

You can also get the query execution times and which queries were run, in the database server logs files by enabling the following in postgresql.conf file:

log_duration = on
log_statement = 'all'

Hope this helps...

Thanks,

Shoaib Mir
EnterpriseDB

On 7/25/06, Marco Bizzarri <marco(dot)bizzarri(at)gmail(dot)com > wrote:
Hi all.

I've a postgresql where sometimes a process can remaing running a
query for a very long time.

Aside from logging the queries, is there a way to know which query is
running in one particular moment?

Regards
Marco

--
Marco Bizzarri
http://notenotturne.blogspot.com/

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

********** DISCLAIMER **********
Information contained and transmitted by this E-MAIL is proprietary to
Sify Limited and is intended for use only by the individual or entity to
which it is addressed, and may contain information that is privileged,
confidential or exempt from disclosure under applicable law. If this is a
forwarded message, the content of this E-MAIL may not have been sent with
the authority of the Company. If you are not the intended recipient, an
agent of the intended recipient or a person responsible for delivering the
information to the named recipient, you are notified that any use,
distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at admin(at)sifycorp(dot)com

Watch the latest updates on Mumbai, with video coverage of news, events,
Bollywood, live darshan from Siddhivinayak temple and more, only on
www.mumbailive.in

Watch the hottest videos from Bollywood, Fashion, News and more only on
www.sifymax.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message adey 2006-07-25 10:27:01 Re: UTF8 characters
Previous Message Markus Wollny 2006-07-25 09:34:28 Re: Checking what is the current query running