Unix Technical Forum

which commands under PostgreSQL do the similar func provided by "showprocesslist" under mysql

This is a discussion on which commands under PostgreSQL do the similar func provided by "showprocesslist" under mysql within the Pgsql General forums, part of the PostgreSQL category; --> Greetings, I have a question about how to see current processes running under postgreSQL. "show processlist" will display DB, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 09:17 PM
Ying Lu
 
Posts: n/a
Default which commands under PostgreSQL do the similar func provided by "showprocesslist" under mysql

Greetings,

I have a question about how to see current processes running under
postgreSQL.

"show processlist" will display DB, command, time, State, etc under MySQL:

| Id | User | Host | db | Command | Time |
*State * | *Info*
| 21 | admin | server1:40898 | test | *Query* | 104 |
Copying to tmp table | INSERT INTO test (SELECT ... ...


May I know which commands to display similar current running
commands/states under PostgreSQL please?

Thanks a lot!
Emi



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 09:18 PM
David Fetter
 
Posts: n/a
Default Re: which commands under PostgreSQL do the similar func provided by "show processlist" under mysql

On Mon, Jun 06, 2005 at 11:22:23AM -0400, Ying Lu wrote:
> Greetings,
>
> I have a question about how to see current processes running under
> postgreSQL.
>
> "show processlist" will display DB, command, time, State, etc under MySQL:
>
> | Id | User | Host | db | Command | Time |
> *State * | *Info*
> | 21 | admin | server1:40898 | test | *Query* | 104 |
> Copying to tmp table | INSERT INTO test (SELECT ... ...
>
>
> May I know which commands to display similar current running
> commands/states under PostgreSQL please?


You're looking for something like

SELECT * FROM pg_stat_activity;

Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 09:18 PM
Chris Browne
 
Posts: n/a
Default Re: which commands under PostgreSQL do the similar func provided by "show processlist" under mysql

ying_lu@cs.concordia.ca (Ying Lu) writes:
> Greetings,
>
> I have a question about how to see current processes running under
> postgreSQL.
>
> "show processlist" will display DB, command, time, State, etc under MySQL:
>
> | Id | User | Host | db | Command | Time |
> *State * | *Info*
> | 21 | admin | server1:40898 | test | *Query* | 104 |
> Copying to tmp table | INSERT INTO test (SELECT ... ...
>
>
> May I know which commands to display similar current running
> commands/states under PostgreSQL please?


The nearest rough equivalent would be the contents of the system table
pg_catalog.pg_stat_activity.

This will only contain actual query information if the database is
configured to collect statistics on queries, so it's possible for the
field current_query to be left blank...
--
(format nil "~S@~S" "cbbrowne" "acm.org")
http://www.ntlug.org/~cbbrowne/sap.html
Rules of the Evil Overlord #78. "I will not tell my Legions of Terror
"And he must be taken alive!" The command will be: ``And try to take
him alive if it is reasonably practical.''"
<http://www.eviloverlord.com/>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 09:18 PM
Ying Lu
 
Posts: n/a
Default Re: which commands under PostgreSQL do the similar func


>>"show processlist" will display DB, command, time, State, etc under MySQL:
>>
>>| Id | User | Host | db | Command | Time |
>>*State * | *Info*
>>| 21 | admin | server1:40898 | test | *Query* | 104 |
>>Copying to tmp table | INSERT INTO test (SELECT ... ...
>>
>>
>>May I know which commands to display similar current running
>>commands/states under PostgreSQL please?
>>
>>

>
>You're looking for something like SELECT * FROM pg_stat_activity;
>

I tried this query. Under column "current_query", I always got: <command
string not enabled> but not the correct queries.

I searched the previous mailing list, it seems that I need also setup
stats_command_string = true in postgresql.conf to see the queries. May I
ask will if arise any performance issues please?

I'd love to get some info about setting up:

stats_block_level = true
stats_row_level = true


Thanks A LOT,
Emi


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:34 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com