Received: from janeway.cistron.net (janeway.cistron.net [195.64.65.23]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0C7hYp16204 for ; Fri, 12 Jan 2001 02:43:35 -0500 (EST) (envelope-from jdassen@cistron-office.nl) Received: from odin (jdassen@odin.cistron-office.nl [195.64.65.236]) by janeway.cistron.net (8.9.3/8.9.3/Debian 8.9.3-6) with SMTP id IAA02017 for ; Fri, 12 Jan 2001 08:43:33 +0100 Received: by odin (sSMTP sendmail emulation); Fri, 12 Jan 2001 08:43:32 +0100 Date: Fri, 12 Jan 2001 08:43:32 +0100 From: "J.H.M. Dassen (Ray)" To: pgsql-sql Subject: Re: automated log-messages Message-ID: <20010112084332.A17096@cistron-office.nl> Mail-Followup-To: pgsql-sql References: <3A5EAB4E.DF530384@intra-muehlencord.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.12i In-Reply-To: <3A5EAB4E.DF530384@intra-muehlencord.de>; from jomu@uni-paderborn.de on Fri, Jan 12, 2001 at 07:59:26AM +0100 X-Archive-Number: 200101/115 X-Sequence-Number: 776 On Fri, Jan 12, 2001 at 07:59:26 +0100, Joern Muehlencord wrote: > I am trying to implement an automated log-message system for my > application. For example, if a new user is inserted to my table "auth", > I want to create a log message like: "user [name] added to system". Is > it possible to add this message with triggers or rules?! It can be done using a trigger procedure in Pl/pgSQL, using a "RAISE" statement; see http://postgresql.rmplc.co.uk/devel-corner/docs/postgres/plpgsql-description.htm#AEN6187 HTH, Ray -- "The proper place for a CAPSLOCK key is in a different hemisphere from you." Tom Christiansen in "Interface Zen", http://slashdot.org/article.pl?sid=99/11/30/0954216