pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jerome ALET <alet@unice.fr>
To: Jackson, DeJuan <djackson@cpsgroup.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] nextval
Date: Thu, 28 May 1998 14:55:52 +0000
Message-ID: <356D7AF8.53B5376D@unice.fr> (raw)
References: <F10BB1FAF801D111829B0060971D839F2AAE70@cpsmail>

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



view thread (9+ messages)  latest in thread

Message-ID: <356D7AF8.53B5376D@unice.fr>
Permalink:  ../356D7AF8.53B5376D@unice.fr/
Also on:    postgresql.org/message-id/356D7AF8.53B5376D@unice.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alet@unice.fr, djackson@cpsgroup.com
  Subject: Re: [SQL] nextval
  In-Reply-To: <356D7AF8.53B5376D@unice.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox