X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1DE33476350 for ; Wed, 26 Mar 2003 18:04:48 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 8682A47634E for ; Wed, 26 Mar 2003 18:04:47 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 674AC43A611; Wed, 26 Mar 2003 18:04:47 -0500 (EST) From: "fabio" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Executing SQL commands via triggers without the use of procedures Date: Thu, 27 Mar 2003 00:04:48 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 21 Message-ID: References: <001501c2def2$fe2fe9c0$1f84fea9@oemcomputer> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 X-Complaints-To: usenet@news.hub.org User-Agent: Pan/0.13.4 (She had eyes like strange sins. (Debian GNU/Linux)) To: pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-12.9 required=5.0 tests=BAYES_10,QUOTE_TWICE_1,REFERENCES,USER_AGENT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/601 X-Sequence-Number: 12639 >=20 > Having scoured the relevant documentation I cannot find anything which in= di=3D > cates how I simply create a database trigger to insert into a second tabl= e =3D > after insert on a first table, without the use of a procedure. As I do n= ot=3D > want return values etc. this seems like overkill. Is it possible to cre= at=3D > e a trigger which executes SQL directly without the need to create a proc= ed=3D > ure? If so, what is the syntax? >=20 hello! I had the same problem, is possible to solve it with a rules but depend. In my db i used a trigger because,i have multiple insert in cascade and the rules dont handle this=20 manual for trigger procedure: http://www.postgresql.org/docs/view.php?version=3D7.3&idoc=3D1&file=3Dplpgs= ql-trigger.html trigger vs rules http://www.postgresql.org/docs/view.php?version=3D7.3&idoc=3D1&file=3Drules= -triggers.html fabio