pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
finding the procpid (or pid) for a prepared transaction
4+ messages / 2 participants
[nested] [flat]

* finding the procpid (or pid) for a prepared transaction
@ 2011-02-18 02:10  CS DBA <cs_dba@consistentstate.com>
  0 siblings, 1 reply; 4+ messages in thread

From: CS DBA @ 2011-02-18 02:10 UTC (permalink / raw)
  To: pgsql-admin

Hi All;

I have several prepared tx which are running for a long long time. I 
want to kill 'em but I dont know the process id. I can get the xid via 
pg_prepared_xacts.transaction however the tx's have no locks thus no 
corresponding pg_locks row.  Anyone know how I can get a procpid based 
on a tx id?


Thanks in advance...




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: finding the procpid (or pid) for a prepared transaction
@ 2011-02-18 02:19  Tom Lane <tgl@sss.pgh.pa.us>
  parent: CS DBA <cs_dba@consistentstate.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2011-02-18 02:19 UTC (permalink / raw)
  To: CS DBA <cs_dba@consistentstate.com>; +Cc: pgsql-admin

CS DBA <cs_dba@consistentstate.com> writes:
> I have several prepared tx which are running for a long long time. I 
> want to kill 'em but I dont know the process id.

If they're prepared, they're *not* running, and they don't have a
process id.  They're just going to sit there until you do COMMIT
PREPARED or ROLLBACK PREPARED.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: finding the procpid (or pid) for a prepared transaction
@ 2011-02-18 02:48  CS DBA <cs_dba@consistentstate.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: CS DBA @ 2011-02-18 02:48 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

On 02/17/2011 07:19 PM, Tom Lane wrote:
> CS DBA<cs_dba@consistentstate.com>  writes:
>> I have several prepared tx which are running for a long long time. I
>> want to kill 'em but I dont know the process id.
> If they're prepared, they're *not* running, and they don't have a
> process id.  They're just going to sit there until you do COMMIT
> PREPARED or ROLLBACK PREPARED.
>
> 			regards, tom lane

aah, makes sense Thanks.

So, for future reference.. if I prepare a tx, and then execute the 
prepared stmt, is there a way to associate the xid from a prepared txn 
(pg_prepared_xacts) with the row in pg_stat_activity showing the 
executing prepared stmt (within the current prepared txn)?  or is there 
a way to see the text of a currently prepared txn so I can look for the 
statement being executed in pg_stat_activity?






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: finding the procpid (or pid) for a prepared transaction
@ 2011-02-18 02:51  CS DBA <cs_dba@consistentstate.com>
  parent: CS DBA <cs_dba@consistentstate.com>
  0 siblings, 0 replies; 4+ messages in thread

From: CS DBA @ 2011-02-18 02:51 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

On 02/17/2011 07:48 PM, CS DBA wrote:
> On 02/17/2011 07:19 PM, Tom Lane wrote:
>> CS DBA<cs_dba@consistentstate.com>  writes:
>>> I have several prepared tx which are running for a long long time. I
>>> want to kill 'em but I dont know the process id.
>> If they're prepared, they're *not* running, and they don't have a
>> process id.  They're just going to sit there until you do COMMIT
>> PREPARED or ROLLBACK PREPARED.
>>
>>             regards, tom lane
>
> aah, makes sense Thanks.
>
> So, for future reference.. if I prepare a tx, and then execute the 
> prepared stmt, is there a way to associate the xid from a prepared txn 
> (pg_prepared_xacts) with the row in pg_stat_activity showing the 
> executing prepared stmt (within the current prepared txn)?  or is 
> there a way to see the text of a currently prepared txn so I can look 
> for the statement being executed in pg_stat_activity?
>
>
>


nevermind.... sorry I'm confusing prepared txn's with prepared stmts.


-- 
---------------------------------------------
Kevin Kempter       -       Constent State
A PostgreSQL Professional Services Company
           www.consistentstate.com
---------------------------------------------




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2011-02-18 02:51 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-02-18 02:10 finding the procpid (or pid) for a prepared transaction CS DBA <cs_dba@consistentstate.com>
2011-02-18 02:19 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-02-18 02:48   ` CS DBA <cs_dba@consistentstate.com>
2011-02-18 02:51     ` CS DBA <cs_dba@consistentstate.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