Обсуждение: vacuum error

Поиск
Список
Период
Сортировка

vacuum error

От
"Zhang, Anna"
Дата:
Hi,
I got an error when vacuum database, see below:

$vacuumdb xdap
ERROR: RelationBuildTriggers: 2 record(s) not found for rel domain.

I deleted triggers that referenced domain before vacuum, is this the cause?
How can I fix it? or It doesn't bother, It's ok to ignore such error?

Thanks in advance!

Anna Zhang

Re: vacuum error

От
Stephan Szabo
Дата:
On Fri, 8 Mar 2002, Zhang, Anna wrote:

> Hi,
> I got an error when vacuum database, see below:
>
> $vacuumdb xdap
> ERROR: RelationBuildTriggers: 2 record(s) not found for rel domain.
>
> I deleted triggers that referenced domain before vacuum, is this the cause?
> How can I fix it? or It doesn't bother, It's ok to ignore such error?

It will be a problem. Update the pg_class row associated with domain to
fix the value of reltriggers, something like:
update pg_class set reltriggers=(select count(*) from pg_trigger
 where tgrelid=pg_class.oid) where relname='domain';



Re: vacuum error

От
"Zhang, Anna"
Дата:
Thanks Stephan! your suggestion works. I just wonder that if dropping
triggers caused such problem, this might be a postgres bug.

Anna Zhang

-----Original Message-----
From: Stephan Szabo [mailto:sszabo@megazone23.bigpanda.com]
Sent: Friday, March 08, 2002 1:02 PM
To: Zhang, Anna
Cc: 'pgsql-admin@postgresql.org'
Subject: Re: [ADMIN] vacuum error



On Fri, 8 Mar 2002, Zhang, Anna wrote:

> Hi,
> I got an error when vacuum database, see below:
>
> $vacuumdb xdap
> ERROR: RelationBuildTriggers: 2 record(s) not found for rel domain.
>
> I deleted triggers that referenced domain before vacuum, is this the
cause?
> How can I fix it? or It doesn't bother, It's ok to ignore such error?

It will be a problem. Update the pg_class row associated with domain to
fix the value of reltriggers, something like:
update pg_class set reltriggers=(select count(*) from pg_trigger
 where tgrelid=pg_class.oid) where relname='domain';

Re: vacuum error

От
Stephan Szabo
Дата:
On Fri, 8 Mar 2002, Zhang, Anna wrote:

> Thanks Stephan! your suggestion works. I just wonder that if dropping
> triggers caused such problem, this might be a postgres bug.

Did you drop them or did you delete from pg_trigger? AFAIK this only
happens with the latter (which isn't meant as normal behavior).


Re: vacuum error

От
Tom Lane
Дата:
"Zhang, Anna" <azhang@verisign.com> writes:
> ERROR: RelationBuildTriggers: 2 record(s) not found for rel domain.

> I deleted triggers that referenced domain before vacuum, is this the cause?

If you deleted them via "delete from pg_trigger" and not by DROP
TRIGGER, then yes.

You'll need to manually fix the value of pg_class.reltriggers for that
table.

            regards, tom lane