Re: Recreating constraint triggers

From: Dan Herbert <dan(at)iugo(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Recreating constraint triggers
Date: 2010-09-03 00:33:46
Message-ID: AANLkTinfgyc94zvHu7VK3V_2aC1nH8ED6AbPAw3wbjzw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Ouch.  Are you running Slony by any chance?

Nope, just a stock install. Both servers are running CentOS.

> Do you have *any* idea what caused this?

Nothing definitive unfortunately. Looking back through SVN logs for
code updates there was mention of disabling triggers to perform a
large delete from the user and user_profile tables (all but ~20
records out of ~1.2 million; required a complex subquery which exceed
stack limit) much earlier this year. Perhaps it is related, although,
disabling triggers wouldn't remove them entirely from the database,
would it?

> Also, what PG version are you running exactly?

Dev: 8.1.11
Live: 8.1.21

> As far as getting out of it is concerned, I'd be inclined to do a
> "pg_dump -s" from the devel DB, manually extract all the
> alter-add-constraint commands, and replay them into the live DB,
> after having gotten rid of any duplicates of constraints that are
> still there.

I suspected as much... There are 368 constraints in the older dev db,
and 147 in the live one. All but 9 on the live one are primary keys.
Would it be prudent to only add constraints for the foreign keys? I'm
a little hesitant to drop primary keys on a production database, even
if only for a few minutes.

Thanks for your response!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-09-03 03:15:40 Re: Connection question
Previous Message Phil Jackson 2010-09-02 21:12:31 Problems with ODBC Driver