Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 5087D475F08 for ; Fri, 10 May 2002 06:49:49 -0400 (EDT) Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31]) by postgresql.org (Postfix) with SMTP id 896D647635A for ; Fri, 10 May 2002 06:49:26 -0400 (EDT) Received: from h00045a2e4e7c.ne.client2.attbi.com (HELO saturn.janwieck.net) (janwieck@24.61.137.137 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 10 May 2002 10:49:28 -0000 Received: (from wieck@localhost) by saturn.janwieck.net (8.11.2/8.11.2) id g4AAcGc03565; Fri, 10 May 2002 06:38:16 -0400 From: Jan Wieck Message-Id: <200205101038.g4AAcGc03565@saturn.janwieck.net> Subject: Re: Getting full query string from pg_stat_get_backend_activity In-Reply-To: <200205101513.59553.mallah@trade-india.com> from "Rajesh Kumar Mallah." at "May 10, 2002 03:13:59 pm" To: "Rajesh Kumar Mallah." Date: Fri, 10 May 2002 06:38:16 -0400 (EDT) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200205/87 X-Sequence-Number: 7723 Rajesh Kumar Mallah. wrote: > Hi , > > Is it possible to get the full SQL query from > pg_stat_get_backend_activity, currently it is truncated after > certain number of characters , example below. No, because the querystring length is unlimited, but the protocol for sending the information to the statistic collector daemon uses a compile time maximum buffer size. You can increase that buffer size to see more of your querystring. It is by default src/include/pgstat.h: #define PGSTAT_ACTIVITY_SIZE 256 Jan > > > SELECT pg_stat_get_backend_pid(s.backendid) AS procpid, > pg_stat_get_backend_activity(s.backendid) AS current_query FROM (SELECT > pg_stat_get_backend_idset() AS backendid) s; > > > procpid | current_query > 27015 | in transaction > 26978 | in transaction > 26985 | in transaction > 27135 | select count(*) from ( select distinct on (email_id) > email_id,email,contact from email_bank a join (select email_id from > email_export_category where category_id in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, > 12, 14, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1 > 12262 | SELECT source_id , cnt from (SELECT source_id,count(source_id) as > cnt from email_source group by source_id ) subsel join sources > using(source_id) order by source_id > 27136 | in transaction > (16 rows) > > -- > Rajesh Kumar Mallah, > Project Manager (Development) > Infocom Network Limited, New Delhi > phone: +91(11)6152172 (221) (L) ,9811255597 (M) > > Visit http://www.trade-india.com , > India's Leading B2B eMarketplace. > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #