X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 93504475843 for ; Fri, 28 Feb 2003 21:00:06 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 31525-09 for ; Fri, 28 Feb 2003 21:00:02 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 0F173475461 for ; Fri, 28 Feb 2003 21:00:02 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 81E1CD60F; Fri, 28 Feb 2003 18:00:05 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 6E73A5C04; Fri, 28 Feb 2003 18:00:05 -0800 (PST) Date: Fri, 28 Feb 2003 18:00:05 -0800 (PST) From: Stephan Szabo To: Susan Hoddinott Cc: Subject: Re: Executing SQL commands via triggers without the use of In-Reply-To: <001501c2def2$fe2fe9c0$1f84fea9@oemcomputer> Message-ID: <20030228175804.N7046-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/642 X-Sequence-Number: 12040 On Fri, 28 Feb 2003, Susan Hoddinott wrote: > Having scoured the relevant documentation I cannot find anything which > indicates how I simply create a database trigger to insert into a > second table after insert on a first table, without the use of a > procedure. As I do not want return values etc. this seems like > overkill. Is it possible to create a trigger which executes SQL > directly without the need to create a procedure? If so, what is the > syntax? Not really... You'll need to wrap it in a simple function.