Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f4ICjBA35949 for ; Fri, 18 May 2001 08:45:11 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from c014.sfo.cp.net (c014-h017.c014.sfo.cp.net [209.228.12.81]) by postgresql.org (8.11.3/8.11.1) with SMTP id f4GHTxA89623 for ; Wed, 16 May 2001 13:29:59 -0400 (EDT) (envelope-from ramirez@lwbeyond.net) Received: (cpmta 12225 invoked from network); 16 May 2001 10:29:58 -0700 Received: from ool-18bd2f47.dyn.optonline.net (HELO lwbeyond.net) (24.189.47.71) by smtp.flashcom.net (209.228.12.81) with SMTP; 16 May 2001 10:29:58 -0700 X-Sent: 16 May 2001 17:29:58 GMT Message-ID: <3B02B940.B00267E7@lwbeyond.net> Date: Wed, 16 May 2001 13:30:40 -0400 From: "Edwin S. Ramirez" X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Help! Record logging Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200105/193 X-Sequence-Number: 3010 Hello, I would like to setup a trigger to keep track of all changes done onto the records of paticular tables. Basically, there would be two identical tables such as, 'medications' and 'medications_log', when a user inserts, updates or deletes a record I would like a copy to be inserted into the log table. I already have audit information in the medications table, so I only need to be able to copy the record over to the log table. The only other difficulty is how do I let the trigger know the ID of the user deleting the record? Thanks, Edwin S. Ramirez