Can not pg_dumpall

Started by Somazx Interestingalmost 25 years ago6 messagesgeneral
Jump to latest
#1Somazx Interesting
somazx@home.com

Can anyone help me with this error message I get when I attempt to dump my
database?

[dfunct@localhost dfunct]$ pg_dumpall >
/home/dfunct/OnEd_backups/OnEd_Wednesday.sql
getTables(): SELECT (funcname) for trigger sa_eval_trigger_608 returned 0
tuples. Expected 1.
pg_dump failed on OnEd, exiting

Andy Koch.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Somazx Interesting (#1)
Re: Can not pg_dumpall

Somazx Interesting <somazx@home.com> writes:

getTables(): SELECT (funcname) for trigger sa_eval_trigger_608 returned 0
tuples. Expected 1.
pg_dump failed on OnEd, exiting

Kinda looks like you dropped some function that was still referenced by
a trigger. Better drop the trigger too.

regards, tom lane

#3Somazx Interesting
somazx@home.com
In reply to: Tom Lane (#2)
Re: Can not pg_dumpall

At 02:18 PM 6/8/2001 -0400, Tom Lane wrote:

Somazx Interesting <somazx@home.com> writes:

getTables(): SELECT (funcname) for trigger sa_eval_trigger_608 returned 0
tuples. Expected 1.
pg_dump failed on OnEd, exiting

Kinda looks like you dropped some function that was still referenced by
a trigger. Better drop the trigger too.

Taking that to mean, "try deleting that orphaned trigger" - but since I
don't know which table that trigger was on - I did it by deleting it
through pg_trigger, I now get somewhat worse errors:

getTables(): relation 'lessontable_548_118': 8 Triggers were expected, but
got 7

All the tables that use triggers and functions are expendable as they were
only tests - so I tried deleting them and I can't and get another error:

PostgreSQL said: ERROR: RelationBuildTriggers: 1 record(s) not found for
rel lessontable_548_118
Your query:

I think I've made quite the mess of things :)

I only care about the data in a few tables, which if I could pg_dump I
would just rebuild the database from the sql files and import the little
data that's valuable - (all of which doesn't use triggers or functions) -
but I can't even dump the data from non trigger/function using tables. It
gives this error again:

getTables(): relation 'lessontable_548_118': 8 Triggers were expected, but
got 7.

Andy "knows just enough to be dangerous" Koch.

#4Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Somazx Interesting (#3)
Re: Can not pg_dumpall

On Fri, 8 Jun 2001, Somazx Interesting wrote:

At 02:18 PM 6/8/2001 -0400, Tom Lane wrote:

Somazx Interesting <somazx@home.com> writes:

getTables(): SELECT (funcname) for trigger sa_eval_trigger_608 returned 0
tuples. Expected 1.
pg_dump failed on OnEd, exiting

Kinda looks like you dropped some function that was still referenced by
a trigger. Better drop the trigger too.

Taking that to mean, "try deleting that orphaned trigger" - but since I
don't know which table that trigger was on - I did it by deleting it
through pg_trigger, I now get somewhat worse errors:

getTables(): relation 'lessontable_548_118': 8 Triggers were expected, but
got 7

This is easy to fix, actually. You need to change reltriggers on the
pg_class row for lessontable_548_118 to match the number of triggers that
are really there (7).

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Somazx Interesting (#3)
Re: Can not pg_dumpall

Somazx Interesting <somazx@home.com> writes:

Taking that to mean, "try deleting that orphaned trigger" - but since I
don't know which table that trigger was on - I did it by deleting it
through pg_trigger, I now get somewhat worse errors:

getTables(): relation 'lessontable_548_118': 8 Triggers were expected, but
got 7

Now you know which table it was on ;-)

You can fix this by adjusting the reltriggers field of pg_class for that
table.

regards, tom lane

#6Somazx Interesting
somazx@home.com
In reply to: Stephan Szabo (#4)
Re: Can not pg_dumpall

At 01:30 PM 6/8/2001 -0700, you wrote:

At 02:18 PM 6/8/2001 -0400, Tom Lane wrote:

Somazx Interesting <somazx@home.com> writes:

getTables(): SELECT (funcname) for trigger sa_eval_trigger_608

returned 0

tuples. Expected 1.
pg_dump failed on OnEd, exiting

This is easy to fix, actually. You need to change reltriggers on the
pg_class row for lessontable_548_118 to match the number of triggers that
are really there (7).

Thanks. You've bailed me out once more. I was able to backup the data now -
and I can relax a little.

I was hoping that the problems preventing me from dropping those tables and
doing a pg_dump would resolve the slowness in the system in general
(especially dropping tables) - and it did!!

Does that make any sense though?

Andy.