mydb=> create table roid (roid oid, rtext text);
CREATE
mydb=> create table rtext ( rtext text );
CREATE
mydb=> create rule roidset as on insert to rtext do insert into roid values ( new.oid, new.rtext );
CREATE
mydb=> insert into rtext values('text1');
INSERT 17681 1
mydb=> insert into rtext values('text2');
INSERT 17683 1
mydb=> insert into rtext values('text3');
INSERT 17685 1
mydb=> select oid,* from rtext;
  oid|rtext
-----+-----
17681|text1
17683|text2
17685|text3
(3 rows)

mydb=> select oid,* from roid;
  oid|roid|rtext
-----+----+-----
17680|    |text1
17682|    |text2
17684|    |text3
(3 rows)


Wed, 13 Oct 1999 18:50:40 +0100
=?iso-8859-2?Q?Daniel_P=E9der?= <dpeder@infoset.cz>
the oid is uknown during execution of rule..insert ? (psql ver 6.5.2)