X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ADEA9DB7DB for ; Sun, 20 Nov 2005 02:43:43 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 74472-06 for ; Sun, 20 Nov 2005 06:43:42 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7E56DDBC29 for ; Sun, 20 Nov 2005 02:43:40 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id C6FEC31059; Sun, 20 Nov 2005 07:43:39 +0100 (MET) From: "JuanCri" X-Newsgroups: pgsql.sql Subject: Re: Is it possible to redirect an update/insert/delete to a different table? Date: 19 Nov 2005 22:43:33 -0800 Organization: http://groups.google.com Lines: 15 Message-ID: <1132469013.246334.171700@g49g2000cwa.googlegroups.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g49g2000cwa.googlegroups.com; posting-host=201.215.213.22; posting-account=7tws-Q0AAADpX36azeU8JBvtMMi8oYJs To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/251 X-Sequence-Number: 23502 I don't know what do you mean... because if you want to insert to other table.. you can create a rule like this CREATE RULE myrule AS ON INSERT TO mytable DO INSTEAD INSERT INTO myothertable VALUES (NEW.col1, NEW.col2, NEW.col3); that will work for all inserts.. I think the problem will be the SELECT, right?... well.. that's solved if "mytable" is a view of SELECT * FROM myothertable.. Juan C. Olivares www.juancri.com