Received: from cortex.unice.fr (root@cortex.unice.fr [134.59.53.1]) by hub.org (8.8.8/8.7.5) with ESMTP id LAA22053 for ; Thu, 28 May 1998 11:07:56 -0400 (EDT) Received: from unice.fr (cortex.unice.fr [134.59.53.1]) by cortex.unice.fr (8.8.5/8.8.5) with ESMTP id QAA32156; Thu, 28 May 1998 16:55:52 +0200 Sender: jerome@cortex.unice.fr Message-ID: <356D7AF8.53B5376D@unice.fr> Date: Thu, 28 May 1998 14:55:52 +0000 From: Jerome ALET Reply-To: alet@unice.fr Organization: Faculte de Medecine de Nice X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 sparc) MIME-Version: 1.0 To: "Jackson, DeJuan" CC: pgsql-sql@postgresql.org Subject: Re: [SQL] nextval References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jackson, DeJuan wrote: > I wouldn't consider the results that Jerome is getting to be a bug. > What is happening is that the RULE is inserting the new value into every > row each time he inserts a new row. A test to verify that would be to > insert two rows then a select and see if the behavior is consistent with > your previous assumptions. OK, I'll try this tomorrow. I haven't tested this TEST :) but when I read the doc I understand (I'm not English nor American) that in the manual page: create rule rule_name as on event to object [where clause] do [instead] [action | nothing | [actions...]] the WHERE is optional and that in: new or current can appear instead of an instance variable whenever an instance variable is permissi- ble in SQL. The semantics of a rule is that at the time an individual instance is accessed, updated, inserted or deleted, there is a current instance (for retrieves, updates and deletes) and a new instance (for updates and appends). If the event specified in the on clause and the condition speci- fied in the where clause are true for the current instance, then the action part of the rule is executed. First, however, values from fields in the current instance and/or the new instance are substituted for: current.attribute-name new.attribute-name the rule should apply one tuple at a time. maybe I was misunderstanding the manual page. thanks all Jerome ALET - alet@unice.fr - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE