From: | Daniel Péder <dpeder(at)infoset(dot)cz> |
---|---|
To: | "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>, "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org> |
Subject: | the oid is uknown during execution of rule..insert ? (psql ver 6.5.2) |
Date: | 1999-10-13 17:50:40 |
Message-ID: | 01BF15AB.D9AF52C0@Dan |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-sql |
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)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Meskes | 1999-10-13 18:21:40 | The new globe |
Previous Message | Peter Eisentraut | 1999-10-13 17:37:10 | Re: [HACKERS] psql Week 2 |
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Péder | 1999-10-13 19:22:43 | big advance for replication - if the record could update itself using rules... |
Previous Message | Ottawa Online Digital Development | 1999-10-13 17:11:12 | (no subject) |