pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jerry Sievers <jerry@jerrysievers.com>
To: pgsql-admin@postgresql.org
Subject: Manual sys catalog constraint setup to avoid downtime?
Date: 07 Nov 2006 11:05:38 -0500
Message-ID: <m3lkmnfdil.fsf@homie.jerrysievers.com> (raw)

Admins; this is (I assume) a not uncommon scenario).

Suppose you are managing a BIG ugly DB that's in 24x7 production and
desperately in need of constraints of all types.

(Of course, you inherited this piece of crap and the irresponsible
designers are long gone :-)

You have verified that the application now honors the new constraints
because on your R&D DBs, the constraints are in place and no
constraint violations are occuring.

You can't however get business to sign off on proper constraint
addition via ALTER TABLE because the tables are huge and this locks
out concurrent activity for several hours.

My question;

Have any of you setup the constraints by doing manual catalog updates
and later (or maybe never),  gone back and cleaned up the
non-conforming data using small batch updates or deletes?

Frobing of pg_constraint and pg_depend (at least) would be required.

I'm wondering what non-obvious pitfalls exist here?

Comments?

-- 
-------------------------------------------------------------------------------
Jerry Sievers   305 854-3001 (home)     Production Database Administrator
                305 321-1144 (mobil	WWW E-Commerce Consultant



view thread (4+ messages)  latest in thread

Message-ID: <m3lkmnfdil.fsf@homie.jerrysievers.com>
Permalink:  ../m3lkmnfdil.fsf@homie.jerrysievers.com/
Also on:    postgresql.org/message-id/m3lkmnfdil.fsf@homie.jerrysievers.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jerry@jerrysievers.com
  Subject: Re: Manual sys catalog constraint setup to avoid downtime?
  In-Reply-To: <m3lkmnfdil.fsf@homie.jerrysievers.com>
  References: <m3lkmnfdil.fsf@homie.jerrysievers.com>

* 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