Function not working check_foreign_key().

From: Luke Tudor - RSG <ltt(at)pml(dot)ac(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Function not working check_foreign_key().
Date: 2001-04-04 14:40:05
Message-ID: 3ACB3245.DF3091EC@unixmail.npm.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Dear Postgres Team,

I have now spent a number of months, working on a postgres problem that
I have encountered.
Finding a solution to my problem is fairly important, as it holds all
information for the company. I would be extremely grateful if anyone who
has been in a similar position, and has any ideas if they could share
them with me!

The problem started one day months ago when suddenly, pg_dump stopped
working! I don't have an explanation as to why, because Im not sure what
changed. Anyway;

I started getting the error message 'getTables(): relation 'genuser':
cannot find function with oid 773217 for trigger check_user'.

Well, after some helpful information from Tom, I now understand Oid's
and how to look them up. When I searched the pg_proc table, I found that
there is an entry for check_foreign_key with that oid. It also provides
me with the probin as '/users/pgsql/postgres/lib/refint.so'.

The trigger check_user does indeed call the check_foreign_key function,
and if the trigger is dropped, the pg_dump program continues backing up
until it reaches another trigger referencing the check_foreign_key
function.

As far as I can tell, if the file '/users/pgsql/postgres/lib/refint.so'
exists (which it does), and there is an entry for the function in
pg_proc, why is there a problem with the trigger/function?

Re-creating the database is not a possibility because it's massive, and
the data is extremely important. I need to some how reinstall or make
check_foreign_key work again.

What could have gone wrong? and how should I go about fixing the
problem? Should I try just replacing the
'/users/rsg8/pgsql/postgres/lib/refint.so' file? I don't mind deleting
and recreating the triggers, but without fixing the function, this won't
help.

Any help appreciated.
Many Thanks
Luke.

Extra Information:

This is how I am calling pg_dump;

pg_dump -u -f rsgbase.backup rsgbase

rsgbase = database name, rsgbase.backup = backup of database (to
create)

I then enter username and password.
---
The erroneous trigger code (it has been working, but this is how it was
created along time ago)

CREATE TRIGGER check_user ON genUser
ON DELETE FOR EACH ROW
EXECUTE PROCEDURE
check_foreign_key (1,'cascade','userid','webuser','userid');
---

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Rob Patience 2001-04-04 17:15:46 Postgresql.7.0.3
Previous Message Chris Smith 2001-04-04 07:25:12 Re: Replicated PostgreSQL-Databases