Received: from oberon.dnai.com (oberon.dnai.com [207.181.194.97]) by hub.org (8.9.3/8.9.3) with ESMTP id AAA07995 for ; Sat, 14 Aug 1999 00:08:08 -0400 (EDT) (envelope-from mo@local2me.com) Received: from local2me.com (dnai-216-15-121-110.dialup.dnai.com [216.15.121.110]) by oberon.dnai.com (8.9.3/8.9.3) with ESMTP id VAA20421 for ; Fri, 13 Aug 1999 21:07:34 -0700 (PDT) Sender: michael@oberon.dnai.com Message-ID: <37B4EB04.876196CE@local2me.com> Date: Fri, 13 Aug 1999 21:05:24 -0700 From: Michael Olivier X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.2.5-22 i686) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-sql@postgreSQL.org" Subject: new.oid not working inside rule [repost] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I am reposting this because I haven't gotten an answer... is anyone successfully using new.oid within a rule to store the oid of an inserted row into another table? (See below) This is in 6.4.2-3. thanks, --Michael Michael Olivier wrote: > > 2. How can I get the oid of a record being inserted? Using new.oid > isn't getting it for me... the field in my changes table remains > blank... > > create rule users_add_rule as on insert to users do > insert into changes (table_name, change_time, ref_oid, type) > values ('users', 'now', new.oid, 'insert'); > > Getting some other field, like new.acctname, does work... > > Thanks, > Michael