> 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!