From: wieck@debis.com
To: mo@local2me.com
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] new.oid not working inside rule [repost]
Date: Mon, 16 Aug 1999 10:10:11 +0200 (MET DST)
Message-ID: <m11GHqN-0003kLC@orion.SAPserv.Hamburg.dsh.de> (raw)
In-Reply-To: <37B4EB04.876196CE@local2me.com>
>
> 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) #
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: wieck@debis.com, mo@local2me.com
Subject: Re: [SQL] new.oid not working inside rule [repost]
In-Reply-To: <m11GHqN-0003kLC@orion.SAPserv.Hamburg.dsh.de>
References: <37B4EB04.876196CE@local2me.com> <m11GHqN-0003kLC@orion.SAPserv.Hamburg.dsh.de>
* 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