pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedGetting full query string from pg_stat_get_backend_activity
3+ messages / 2 participants
[nested] [flat]
* Getting full query string from pg_stat_get_backend_activity
@ 2002-05-10 09:43 Rajesh Kumar Mallah. <mallah@trade-india.com>
0 siblings, 1 reply; 3+ messages in thread
From: Rajesh Kumar Mallah. @ 2002-05-10 09:43 UTC (permalink / raw)
To: pgsql-sql
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.
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 | <IDLE> in transaction
26978 | <IDLE> in transaction
26985 | <IDLE> 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 | <IDLE> 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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Getting full query string from pg_stat_get_backend_activity
@ 2002-05-10 10:38 Jan Wieck <janwieck@yahoo.com>
parent: Rajesh Kumar Mallah. <mallah@trade-india.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jan Wieck @ 2002-05-10 10:38 UTC (permalink / raw)
To: Rajesh Kumar Mallah. <mallah@trade-india.com>; +Cc: pgsql-sql
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 | <IDLE> in transaction
> 26978 | <IDLE> in transaction
> 26985 | <IDLE> 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 | <IDLE> 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 #
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Getting full query string from pg_stat_get_backend_activity
@ 2002-05-10 11:08 Rajesh Kumar Mallah. <mallah@trade-india.com>
parent: Jan Wieck <janwieck@yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: Rajesh Kumar Mallah. @ 2002-05-10 11:08 UTC (permalink / raw)
To: Jan Wieck <janwieck@yahoo.com>; +Cc: pgsql-sql
Thanks Jan for the accurate guidance,
i am currently preapring a reply to you other post.
regds
mallah.
On Friday 10 May 2002 04:08 pm, Jan Wieck wrote:
> 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 | <IDLE> in transaction
> > 26978 | <IDLE> in transaction
> > 26985 | <IDLE> 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 | <IDLE> 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
--
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-05-10 11:08 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-05-10 09:43 Getting full query string from pg_stat_get_backend_activity Rajesh Kumar Mallah. <mallah@trade-india.com>
2002-05-10 10:38 ` Jan Wieck <janwieck@yahoo.com>
2002-05-10 11:08 ` Rajesh Kumar Mallah. <mallah@trade-india.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox