Received: from orion.SAPserv.Hamburg.dsh.de (Tpolaris2.sapham.debis.de [53.2.131.8]) by hub.org (8.9.3/8.9.3) with SMTP id EAA32757 for ; Mon, 16 Aug 1999 04:15:57 -0400 (EDT) (envelope-from wieck@debis.com) Received: by orion.SAPserv.Hamburg.dsh.de for pgsql-sql@postgreSQL.org id m11GHqN-0003kLC; Mon, 16 Aug 99 10:10 MET DST Message-Id: From: wieck@debis.com (Jan Wieck) Subject: Re: [SQL] new.oid not working inside rule [repost] To: mo@local2me.com (Michael Olivier) Date: Mon, 16 Aug 1999 10:10:11 +0200 (MET DST) Cc: pgsql-sql@postgreSQL.org Reply-To: jwieck@debis.com (Jan Wieck) In-Reply-To: <37B4EB04.876196CE@local2me.com> from "Michael Olivier" at Aug 13, 99 09:05:24 pm X-Mailer: ELM [version 2.4 PL25] Content-Type: text > > 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. It cannot work - sorry. This is because of the way rules are executed. If you have a rule on INSERT, this rules action is executed prior to the INSERT itself and will do mainly the same scans to collect the data that will be inserted (in the case of INSERT...SELECT...). At this time, the OID's which will later get assigned aren't known. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #========================================= wieck@debis.com (Jan Wieck) #