dbTalk Databases Forums  

what postgres proces is doing ?

comp.databases.postgresql comp.databases.postgresql


Discuss what postgres proces is doing ? in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pbr
 
Posts: n/a

Default what postgres proces is doing ? - 11-12-2006 , 12:43 PM






When I execute ps on my linux server I can see:
....
8021 ? S 2:51 \_ postgres: vt tdb 127.0.0.1(51399) idle
8037 ? S 9:35 \_ postgres: vt tdb 127.0.0.1(33643) idle
8038 ? S 9:35 \_ postgres: vt tdb 127.0.0.1(36490) idle
8629 ? S 110:02 \_ postgres: vt tdb 127.0.0.1(48856) idle
8630 ? R 213:59 \_ postgres: vt tdb 127.0.0.1(35397) SELECT
9051 ? S 8:28 \_ postgres: vt tdb 127.0.0.1(56341) idle
....

How can I determine what process 8630 is doing ? what SELECT

I've try loging statements but only finished queries has been loged.

Reply With Quote
  #2  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: what postgres proces is doing ? - 11-13-2006 , 03:27 AM






pbr <bez_maila (AT) onet (DOT) pl> wrote:
Quote:
When I execute ps on my linux server I can see:
...
8021 ? S 2:51 \_ postgres: vt tdb 127.0.0.1(51399) idle
8037 ? S 9:35 \_ postgres: vt tdb 127.0.0.1(33643) idle
8038 ? S 9:35 \_ postgres: vt tdb 127.0.0.1(36490) idle
8629 ? S 110:02 \_ postgres: vt tdb 127.0.0.1(48856) idle
8630 ? R 213:59 \_ postgres: vt tdb 127.0.0.1(35397) SELECT
9051 ? S 8:28 \_ postgres: vt tdb 127.0.0.1(56341) idle
...

How can I determine what process 8630 is doing ? what SELECT

I've try loging statements but only finished queries has been loged.
Have you tried:

SELECT current_query FROM pg_catalog.pg_stat_activity
WHERE procpid = 8630

Yours,
Laurenz Albe


Reply With Quote
  #3  
Old   
pbr
 
Posts: n/a

Default SOLVED: what postgres proces is doing ? - 11-13-2006 , 04:42 PM



Laurenz Albe wrote:

Quote:
Have you tried:

SELECT current_query FROM pg_catalog.pg_stat_activity
WHERE procpid = 8630

THX a lot ... problem solved

I had to set stats_command_string = on in postgresql.conf
and now yours solution works perfect.

PBR


Reply With Quote
  #4  
Old   
cienki_bolek
 
Posts: n/a

Default Re: what postgres proces is doing ? - 12-11-2006 , 09:42 AM



pbr napisał(a):
Quote:
When I execute ps on my linux server I can see:
...
8021 ? S 2:51 \_ postgres: vt tdb 127.0.0.1(51399) idle
8037 ? S 9:35 \_ postgres: vt tdb 127.0.0.1(33643) idle
8038 ? S 9:35 \_ postgres: vt tdb 127.0.0.1(36490) idle
8629 ? S 110:02 \_ postgres: vt tdb 127.0.0.1(48856) idle
8630 ? R 213:59 \_ postgres: vt tdb 127.0.0.1(35397) SELECT
9051 ? S 8:28 \_ postgres: vt tdb 127.0.0.1(56341) idle
...

How can I determine what process 8630 is doing ? what SELECT

I've try loging statements but only finished queries has been loged.
try pg_top


Reply With Quote
  #5  
Old   
Lew
 
Posts: n/a

Default Re: what postgres proces is doing ? - 12-11-2006 , 10:34 AM



Quote:
pbr napisaƂ(a):
When I execute ps on my linux server I can see:
...
8021 ? S 2:51 \_ postgres: vt tdb 127.0.0.1(51399) idle
8037 ? S 9:35 \_ postgres: vt tdb 127.0.0.1(33643) idle
8038 ? S 9:35 \_ postgres: vt tdb 127.0.0.1(36490) idle
8629 ? S 110:02 \_ postgres: vt tdb 127.0.0.1(48856) idle
8630 ? R 213:59 \_ postgres: vt tdb 127.0.0.1(35397) SELECT
9051 ? S 8:28 \_ postgres: vt tdb 127.0.0.1(56341) idle
...

How can I determine what process 8630 is doing ? what SELECT

cienki_bolek wrote:
try pg_top
Also, ps can be coerced into showing more of the command line:

ps -o "pid,cmd"

- Lew


Reply With Quote
  #6  
Old   
HansH
 
Posts: n/a

Default Re: what postgres proces is doing ? - 12-11-2006 , 11:30 AM



"Lew" <lew (AT) nowhere (DOT) com> schreef in bericht
news:mZCdnceNi-sIFeDYnZ2dnUVZ_oTinZ2d (AT) comcast (DOT) com...
Quote:
pbr napisal(a):
cienki_bolek wrote:
try pg_top

Also, ps can be coerced into showing more of the command line:
ps -o "pid,cmd"
The query is _not_ part of the command line.

Anyway, problem was already reported solved on 13 nov
Second message in thread gave a magic SQLstatement:
SELECT current_query FROM pg_catalog.pg_stat_activity
WHERE procpid = 8630
to list the longstanding _query_

HansH




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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.