X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id F41E69FB1B7 for ; Tue, 25 Jul 2006 11:53:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 51703-02-4 for ; Tue, 25 Jul 2006 11:53:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sifyelnet.sify.net (elneti.sifycorp.com [202.144.77.54]) by postgresql.org (Postfix) with ESMTP id 1AC6C9FB2E0 for ; Tue, 25 Jul 2006 07:25:40 -0300 (ADT) X-QHPSI: clean Received: (sifymail 28737 invoked by uid 508); 25 Jul 2006 15:55:28 +0530 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=corporate; d=sifycorp.com; b=cY65UZUjIs9D+qcOtl6gXYd3Xuvj/lb95ESwDoxwgVv4WJruY5Kaw2Shj9XDIUoI ; Received: from ::ffff:210.210.122.77 (HELO sifydba) (dilipkumar_parikh@sifycorp.com@::ffff:210.210.122.77) by 10.1.8.60 with ESMTPA; 25 Jul 2006 15:55:28 +0530 Message-ID: <0b6f01c6afd3$42667910$4d7ad2d2@sifydba> From: "Dilipkumar" To: "Shoaib Mir" , "Postgres" References: <3f0d61c40607250115m5660c40cg6a5e1df9e531ff86@mail.gmail.com> Subject: Re: Checking what is the current query running Date: Tue, 25 Jul 2006 15:45:31 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0B6C_01C6B001.5C158D50" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.781 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, FORGED_RCVD_HELO, HOT_NASTY, HTML_50_60, HTML_MESSAGE, SPF_PASS X-Spam-Level: *** X-Archive-Number: 200607/202 X-Sequence-Number: 22448 This is a multi-part message in MIME format. ------=_NextPart_000_0B6C_01C6B001.5C158D50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 -----=20 From: Shoaib Mir=20 To: Postgres=20 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 =3D on After that is done you can view queries running on database server = like this: select current_query from pg_stat_activity;=20 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 =3D on log_statement =3D 'all' Hope this helps... Thanks, Shoaib Mir EnterpriseDB On 7/25/06, Marco Bizzarri wrote: Hi all. I've a postgresql where sometimes a process can remaing running a=20 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=20 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@sifycorp.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 ------=_NextPart_000_0B6C_01C6B001.5C158D50 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
HI,
 
Is there any way to log all the = queries=20 in  7.1.1 (older release).please help out guys.
 
Thanks & Regards
Dilipkumar
----- Original Message -----
From:=20 Shoaib Mir=20
Sent: Tuesday, July 25, 2006 = 2:26=20 PM
Subject: Re: [ADMIN] Checking = what is the=20 current query running

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

stats_command_string =3D on

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

select=20 current_query from pg_stat_activity;

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

log_duration = =3D=20 on
log_statement =3D 'all'

Hope this=20 helps...

Thanks,

Shoaib Mir
EnterpriseDB


On 7/25/06, Marco=20 Bizzarri <marco.bizzarri@gmail.com = >=20 wrote:
Hi=20 all.

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

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

Regards
Marco

--
Marco Bizzarri
http://notenotturne.blogspot.c= om/

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

------=_NextPart_000_0B6C_01C6B001.5C158D50--