Return-Path: postman 
Delivery-Date: Mon, 30 Aug 93 08:58:50 PDT
Return-Path: postman
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA14895; Mon, 30 Aug 93 08:44:12 -0700
Resent-From: postman (POSTGRES mailing list)
Resent-Message-Id: <9308301544.AA14895@postgres.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: aoki@postgres.Berkeley.EDU
Received: from faerie.CS.Berkeley.EDU by postgres.Berkeley.EDU (5.61/1.29)
	id AA14887; Mon, 30 Aug 93 08:44:06 -0700
Received: from localhost (localhost [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.1C/8.1B) with SMTP id IAA10781; Mon, 30 Aug 1993 08:54:16 -0700
Message-Id: <199308301554.IAA10781@faerie.CS.Berkeley.EDU>
From: aoki@postgres.berkeley.edu (Paul M. Aoki)
To: Kent Archie <kca@iwtqg.att.com>
Cc: postgres@postgres.berkeley.edu (Postgres Mailing List)
Subject: Re: error in rules? 
In-Reply-To: Your message of Sun, 29 Aug 93 23:50:21 CDT 
	     <9308300455.AA03428@ucbvax.Berkeley.EDU> 
Date: Mon, 30 Aug 93 08:54:16 -0700
X-Sender: aoki@postgres.Berkeley.EDU
X-Mts: smtp
Resent-To: postgres-dist
Resent-Date: Mon, 30 Aug 93 08:44:11 PDT

Kent Archie <kca@iwtqg.Berkeley.EDU> writes:
> I attempt to remove the rule and re-do it but:
> ginko>monitor -c"remove rule addfile2" amt
> WARN:Aug 29 23:36:14:prs2GetRuleEventRel: class 20816 not found

i've seen this happen when i've destroyed a class before cleaning all
of the rules out.

something like the following should clean up the dead rule info in
the catalogs:

delete pg_prs2plans where pg_prs2plans.prs2ruleid = pg_prs2rule.oid 
        and pg_prs2rule.prs2eventrel = "20816"::oid\g
delete pg_prs2rule where pg_prs2rule.prs2eventrel = "20816"::oid\g
delete pg_prs2stub where pg_prs2stub.prs2relid = "20816"::oid\g

the system should probably be smarter and nuke all rules defined on
a class before nuking the class.  in general the system does not try
hard to ensure that you are not leaving dangling references in the
system catalogs when you blow things away (classes, types, etc.).
it assumes you are going to do that -- there are some circularities
involved...
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki
