From: | "Jonathan Ellis" <jellis(at)advocast(dot)com> |
---|---|
To: | <pgsql-bugs(at)postgresql(dot)org> |
Subject: | orphaned trigger |
Date: | 2001-05-16 21:19:05 |
Message-ID: | 008901c0de4d$d6f1e900$5a050a0a@devjellis |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
This is in 7.1.1:
I was playing around with a table called user_comments and then dropped it.
One of its columns referenced the user_id column of another table, users.
Now whenever I try to update users, I get results like this:
bf2-new=# update users set last_visit=sysdate() where user_id=4; ERROR:
Relation 'user_comments' does not exist
Somehow a constraint trigger that should have been dropped wasn't.
I looked at the dump file and this is the only reference to user_comments:
CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER UPDATE ON "users" NOT DEFERRABLE
INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_upd"
('<unnamed>', 'user_comments', 'users', 'UNSPECIFIED', 'user_id',
'user_id');
but I am not out of the woods here because it won't let me drop it:
bf2-new=# drop trigger RI_ConstraintTrigger_44349 on users; ERROR:
DropTrigger: there is no trigger ri_constrainttrigger_44349 on relation
users
It's in pg_trigger all right -- and with tgrelid = (select relfilenode from
pg_class where relname = 'users') -- but it won't drop. Would manually
removing it from pg_trigger cause Bad Things to happen?
-Jonathan
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2001-05-16 22:14:20 | Re: orphaned trigger |
Previous Message | Lamar Owen | 2001-05-16 20:40:16 | Re: 7.1 Upgrade Failure |