From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Kempter <cs_dba@consistentstate.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: dropping constraints
Date: Wed, 01 Sep 2010 23:20:35 -0400
Message-ID: <12512.1283397635@sss.pgh.pa.us> (raw)
In-Reply-To: <201009012058.05142.cs_dba@consistentstate.com>
References: <201009012058.05142.cs_dba@consistentstate.com>
Kevin Kempter <cs_dba@consistentstate.com> writes:
> we have a few not null constraints we want to drop on very large tables.
> Unfortunately the drop's are taking hours. Is there a way to drop a not null
> constraint via the system catalogs?
Dropping a NOT NULL constraint is a trivial operation. The problem is
probably that you are blocked waiting to get a lock on the table.
Look for idle-in-transaction sessions that are holding locks on the
target table.
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, cs_dba@consistentstate.com
Subject: Re: dropping constraints
In-Reply-To: <12512.1283397635@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