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 265ADD7117 for ; Thu, 13 Oct 2005 01:28:20 -0300 (ADT) 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 82065-07 for ; Thu, 13 Oct 2005 04:28:15 +0000 (GMT) Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by svr1.postgresql.org (Postfix) with ESMTP id B5450D8315 for ; Thu, 13 Oct 2005 01:28:10 -0300 (ADT) Received: from [192.168.1.11] ([68.239.78.187]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IOA00L1372KQ1A0@vms046.mailsrvcs.net> for pgsql-sql@postgresql.org; Wed, 12 Oct 2005 23:28:10 -0500 (CDT) Date: Thu, 13 Oct 2005 00:29:10 -0400 From: Ferindo Middleton Jr Subject: UPDATE Trigger on multiple tables To: pgsql-sql@postgresql.org Reply-To: fmiddleton@verizon.net Message-id: <434DE296.8060203@verizon.net> Organization: Sleek Collar MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit User-Agent: Thunderbird 1.4 (Windows/20050908) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.342 required=5 tests=[AWL=-0.408, DNS_FROM_RFC_ABUSE=0.374, DNS_FROM_RFC_POST=1.376] X-Spam-Level: * X-Archive-Number: 200510/130 X-Sequence-Number: 22983 Is it possible to have a single trigger on multiple tables simultaneously? Example: CREATE TRIGGER emp_cust_stamp BEFORE INSERT OR UPDATE ON employees, customers FOR EACH ROW EXECUTE PROCEDURE last_updated_stamp(); I tried something like the above but get an error message at the comma. I tried using the keyword AND as well. I couldn't find anything on this in the docs. I have many different tables in my databases which all have a "last_updated" field and it seems less tedious to be able to enforce updating this trigger database-wide using just one trigger. Is it possible? Ferindo