pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Olivier <mo@local2me.com>
To: pgsql-sql@postgreSQL.org <pgsql-sql@postgreSQL.org>
Subject: new.oid not working inside rule [repost]
Date: Fri, 13 Aug 1999 21:05:24 -0700
Message-ID: <37B4EB04.876196CE@local2me.com> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <37B4EB04.876196CE@local2me.com>
Permalink:  ../37B4EB04.876196CE@local2me.com/
Also on:    postgresql.org/message-id/37B4EB04.876196CE@local2me.com

 · 

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 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: mo@local2me.com
  Subject: Re: new.oid not working inside rule [repost]
  In-Reply-To: <37B4EB04.876196CE@local2me.com>
  References: <37B4EB04.876196CE@local2me.com>

* 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