Re: dropping constraints - Mailing list pgsql-admin

From Tom Lane
Subject Re: dropping constraints
Date
Msg-id 12512.1283397635@sss.pgh.pa.us
Whole thread Raw
In response to dropping constraints  (Kevin Kempter <cs_dba@consistentstate.com>)
Responses Re: dropping constraints  (Kevin Kempter <cs_dba@consistentstate.com>)
List pgsql-admin
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

pgsql-admin by date:

Previous
From: Kevin Kempter
Date:
Subject: dropping constraints
Next
From: Kevin Kempter
Date:
Subject: Re: dropping constraints