Re: Recreating constraint triggers - Mailing list pgsql-general

From Tom Lane
Subject Re: Recreating constraint triggers
Date
Msg-id 22442.1283437389@sss.pgh.pa.us
Whole thread Raw
In response to Recreating constraint triggers  (Dan Herbert <dan@iugo.com.au>)
Responses Re: Recreating constraint triggers  (Dan Herbert <dan@iugo.com.au>)
List pgsql-general
Dan Herbert <dan@iugo.com.au> writes:
> select reltriggers from pg_class where relname='users';
>> Development db: 80
>> Live db: 2

Ouch.  Are you running Slony by any chance?  It's known to fool around
with reltriggers and sometimes mess it up.  However, if you're not
getting constant bleats like
    too many trigger records found for relation "users"
then the pg_trigger records must be gone too, which AFAIK Slony doesn't
do.  Do you have *any* idea what caused this?  Also, what PG version
are you running exactly?

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.

            regards, tom lane

pgsql-general by date:

Previous
From: Georgi Ivanov
Date:
Subject: Strange/random overload of the server
Next
From: Vick Khera
Date:
Subject: Re: coping with failing disks