Received: from dv.kp.dlr.de (dv.kp.dlr.de [129.247.97.1]) by hub.org (8.10.1/8.10.1) with ESMTP id e7IBLPm40981 for ; Fri, 18 Aug 2000 07:21:25 -0400 (EDT) Received: from sea-gw.sea.com (yyy.kp.dlr.de [129.247.113.223]) by dv.kp.dlr.de (8.10.1/8.10.1) with ESMTP id e7IBLMU63878 for ; Fri, 18 Aug 2000 13:21:23 +0200 Received: from joebox.sea-gmbh.com (joebox.sea.com [192.168.0.20]) by sea-gw.sea.com (8.7.4/8.7.1) with ESMTP id NAA19679 for ; Fri, 18 Aug 2000 13:21:21 +0200 Message-Id: <4.3.2.7.0.20000818131223.00af3890@192.168.0.1> X-Sender: joe@192.168.0.1 X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Fri, 18 Aug 2000 13:21:21 +0200 To: pgsql-sql@postgresql.org From: Joerg Hessdoerfer Subject: Re: Continuous inserts... In-Reply-To: <399D16B3.1E74DB8B@faroenet.fo> References: <4.3.2.7.0.20000817162006.00af3db0@192.168.0.1> <4.3.2.7.0.20000818095440.00af6770@192.168.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Archive-Number: 200008/173 Hi! At 11:57 18.08.00 +0100, you wrote: >I'm not familiar with rules. Could you please post the SQL for creating >the rule >that you've created? Here we go (if memory serves ;-) create table a ( num int4, name text ); create table b ( num int4, name text ); rule to insert into b instead of a: CREATE RULE redirect AS ON insert TO a DO INSTEAD insert into b values ( new.num, new.name ); ... the INSTEAD is important! BTW: is it really necessary to list all fields in the instead part? Anyone? when finished vacuuming a, do a DROP RULE redirect; of course, when you have more/other fields in your table, you need to change rule's definition. Hope this helps, Joerg +------**** Science & Engineering Applications GmbH ****------+ | | | Joerg Hessdoerfer | | Leading SW developer Phone: +49 (0)2203-962211 | | S.E.A GmbH Fax: -962212 | | D-51147 Koeln Internet: joerg.hessdoerfer@sea-gmbh.com | | http://www.sea-gmbh.com | +---------------------------------------------------------------+