Re: pg_dump aborts with triggers error - Mailing list pgsql-admin

From Tom Lane
Subject Re: pg_dump aborts with triggers error
Date
Msg-id 8263.1449113775@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump aborts with triggers error  (Tim White <tim.white2005@gmail.com>)
List pgsql-admin
Tim White <tim.white2005@gmail.com> writes:
> My pg_dump is failing.

> PostgreSQL 8.3.7, compiled by gcc (unable to upgrade on this system)

I trust you're aware that this version is several years past its
five-year support lifespan.  Please consider upgrading soon.

> pg_dump: reading triggers for table "gtrk"
> pg_dump: expected -31896 triggers on table "gtrk" but found 0

Ouch.  Don't ordinary queries/updates on this table fail with comparable
complaints?

What this evidently means is that pg_class.reltriggers contains -31896
in the row for gtrk, when it should contain 0 (or, if not that, surely
something nonnegative, to wit the count of related entries in pg_trigger).

I'd try "select * from pg_class where relname = 'gtrk'" and look to see if
any of the other columns are obviously insane.  If not, you might be able
to skate by with manually UPDATE'ing that column to zero (as a superuser).
But it's fairly uncommon for just one field in a table to randomly change
to something else.  The odds are that there's more corruption elsewhere,
and that thought should scare you.

BTW, the last release in the 8.3 series was 8.3.23.  Whether or not you
feel you can cope with updating to a new major-release series right now,
continuing to run 8.3.7 with data that is valuable to you is simply
irresponsible.  Reasons why can be found in the release notes:

http://www.postgresql.org/docs/8.3/static/release.html

            regards, tom lane


pgsql-admin by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Major version upgrades + Replication
Next
From: Sumeet Shukla
Date:
Subject: Re: Find if a function is being referenced in another function in the database