From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig Ringer <ringerc@ringerc.id.au>
Cc: Greg Williamson <gwilliamson39@yahoo.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Question about ALTER TABLE DROP CONSTRAINT on 9.1 -- psql crashes
Date: Fri, 10 Aug 2012 00:20:48 -0400
Message-ID: <13011.1344572448@sss.pgh.pa.us> (raw)
In-Reply-To: <502470E8.4010807@ringerc.id.au>
References: <1344557082.43876.YahooMailNeo@web125906.mail.ne1.yahoo.com>
<8579.1344557984@sss.pgh.pa.us>
<1344558910.70207.YahooMailNeo@web125906.mail.ne1.yahoo.com>
<1344562260.90632.YahooMailNeo@web125901.mail.ne1.yahoo.com>
<10482.1344564417@sss.pgh.pa.us>
<502470E8.4010807@ringerc.id.au>
Craig Ringer <ringerc@ringerc.id.au> writes:
> On 08/10/2012 10:06 AM, Tom Lane wrote:
>> That sure sounds like the source of your problem. It might be sane if
>> it killed only processes that *had been idle* for at least three
>> seconds, but I'm not sure there is any easy way to determine that ...
> wouldn't:
> select * from pg_stat_activity
> where current_query = '<IDLE> in transaction'
> AND query_start < current_timestamp - INTERVAL '3 seconds';
> do it?
No, that would find sessions that were idle and whose last command
started at least 3 seconds ago. But it might have completed only
microseconds ago. The symptoms Greg is describing are consistent
with this kill script running during a short interval between his
index-build command and his COMMIT.
As of 9.2 there's a "state_change" timestamp column in pg_stat_activity
that would provide a safer check, but it's not in existing releases ...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, ringerc@ringerc.id.au, gwilliamson39@yahoo.com
Subject: Re: Question about ALTER TABLE DROP CONSTRAINT on 9.1 -- psql crashes
In-Reply-To: <13011.1344572448@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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