X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 19965D1B52F for ; Sun, 14 Sep 2003 01:14:17 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 14877-08 for ; Sat, 13 Sep 2003 22:13:48 -0300 (ADT) Received: from web21401.mail.yahoo.com (web21401.mail.yahoo.com [216.136.232.71]) by svr1.postgresql.org (Postfix) with SMTP id C9835D1B526 for ; Sat, 13 Sep 2003 22:13:43 -0300 (ADT) Message-ID: <20030914011347.60690.qmail@web21401.mail.yahoo.com> Received: from [64.81.205.234] by web21401.mail.yahoo.com via HTTP; Sat, 13 Sep 2003 18:13:47 PDT Date: Sat, 13 Sep 2003 18:13:47 -0700 (PDT) From: ow Subject: A generic trigger? To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/113 X-Sequence-Number: 15091 Hi, Am looking for a way to minimize the amount of fuctions that support triggers. E.g., there's "company" and "company_backup" tables. Update trigger on the "company" table will put a record in the "company_backup" table whenever "company" record is updated. The problem is that there's quite a few other tables for which similar backup logic has to be done (e.g. "custormer" and "customer_backup", etc). The backup logic is the same, only structure of the tables changes. Is there a way to write a generic trigger/function that would deal with backup regardless of the table structure? Thanks in advance. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com