From: Ross J. Reedstrom <reedstrm@rice.edu>
To: pgsql-admin@postgresql.org
Subject: Re: ALTER TABLE <name> ADD COLUMN Hangs
Date: Wed, 21 Apr 2010 22:43:17 -0500
Message-ID: <20100422034317.GA3902@rice.edu> (raw)
In-Reply-To: <68B59BEDCD36854AADBDF17E91B2937A01A4DC6236@EXCHMAIL.staff.internode.com.au>
References: <68B59BEDCD36854AADBDF17E91B2937A01A4DC6236@EXCHMAIL.staff.internode.com.au>
On Thu, Apr 22, 2010 at 11:47:34AM +0930, Samuel Stearns wrote:
> Howdy,
>
> I'm running in an 8.3.3 environment. What could cause, or how can I diagnose, why an 'ALTER TABLE <name> ADD COLUMN' statement runs for hours eventually locking users out and requiring to be killed in the end?
>
ALTER TABLE commands require an exclusive lock on the table. I'm
guessing you've got a long-running transaction ahead of the ALTER TABLE.
take a look at pg_stat_activity, in particular 'waiting' and pg_locks.
Ross
--
Ross Reedstrom, Ph.D. reedstrm@rice.edu
Systems Engineer & Admin, Research Scientist phone: 713-348-6166
The Connexions Project http://cnx.org fax: 713-348-3665
Rice University MS-375, Houston, TX 77005
GPG Key fingerprint = F023 82C8 9B0E 2CC6 0D8E F888 D3AE 810E 88F0 BEDE
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: reedstrm@rice.edu
Subject: Re: ALTER TABLE <name> ADD COLUMN Hangs
In-Reply-To: <20100422034317.GA3902@rice.edu>
* 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