pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
dropping constraints
3+ messages / 2 participants
[nested] [flat]

* dropping constraints
@ 2010-09-02 02:58  Kevin Kempter <cs_dba@consistentstate.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Kevin Kempter @ 2010-09-02 02:58 UTC (permalink / raw)
  To: pgsql-admin

Hi All;

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?

Thanks in advance



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

* Re: dropping constraints
@ 2010-09-02 03:20  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Kevin Kempter <cs_dba@consistentstate.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2010-09-02 03:20 UTC (permalink / raw)
  To: Kevin Kempter <cs_dba@consistentstate.com>; +Cc: 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



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

* Re: dropping constraints
@ 2010-09-02 03:24  Kevin Kempter <cs_dba@consistentstate.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Kevin Kempter @ 2010-09-02 03:24 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: 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

thanks



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


end of thread, other threads:[~2010-09-02 03:24 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-09-02 02:58 dropping constraints Kevin Kempter <cs_dba@consistentstate.com>
2010-09-02 03:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-09-02 03:24   ` Kevin Kempter <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