Return-Path: owner-postman 
Delivery-Date: Mon, 09 May 94 18:25:26 -0700
Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id QAA02367 for postgres-redist; Mon, 9 May 1994 16:01:52 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199405092301.QAA02367@nobozo.CS.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.149.14]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with ESMTP id QAA02355 for <postgres@postgres.Berkeley.EDU>; Mon, 9 May 1994 16:01:51 -0700
Received: from localhost (localhost [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.4/8.1B) with SMTP id QAA29200; Mon, 9 May 1994 16:01:46 -0700
Message-Id: <199405092301.QAA29200@faerie.CS.Berkeley.EDU>
X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
From: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
To: keen@ms.uky.edu
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: 'retrieve into' in a rule? 
Reply-To: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
In-reply-to: Your message of Mon, 9 May 1994 10:59:52 -0400 (EDT) 
	     <9405091459.aa05728@s.s.ms.uky.edu> 
Date: Mon, 09 May 94 16:01:46 -0700
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-redist@postgres.Berkeley.EDU
X-Mts: smtp
Resent-Date: Mon, 09 May 94 16:01:52 -0700
Resent-XMts: smtp

keen@ms.uky.edu writes:
> "define rule r5 is on 
> retrieve to emp.age where current.age ISNULL
>  do [retrieve into x (emp.all) where emp.dept= current.dept ] \g"
> but when I actually try to retrieve from emp, 
> "retrieve (emp.all) \g"
> I get a message that "type x already defined" 
> and no tuples are retrieved.

so is this rule run more than once?

you're using the tuple-level rule system, so if there is more
than one emp with null age, the rule will be fired more than
once.  of course, once the rule is fired, there's now an "x"
table and any following firings of the rule will blow out the 
whole query (because "x" already exists).

seems like you should probably append to x (if you can do so).
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki

===============================================================================
    To add/remove yourself from the POSTGRES mailing list: send mail with 
    the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

    If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
    a human will deal with it.  DO NOT post to the "postgres" mailing list.
===============================================================================

