Re: [SQL] new.oid not working inside rule [repost]

From: wieck(at)debis(dot)com (Jan Wieck)
To: mo(at)local2me(dot)com (Michael Olivier)
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] new.oid not working inside rule [repost]
Date: 1999-08-16 08:10:11
Message-ID: m11GHqN-0003kLC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> 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(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stuart Rison 1999-08-16 08:59:21 Re: [SQL] Anyone recognise this error from PL/pgSQL?
Previous Message Matthew Hagerty 1999-08-16 02:58:36 Stepping through a table.