Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0DD53475A83 for ; Mon, 10 Jun 2002 04:28:47 -0400 (EDT) Received: from dev.kieser.demon.co.uk (kieser.demon.co.uk [62.49.6.72]) by postgresql.org (Postfix) with ESMTP id 292E8475E19 for ; Mon, 10 Jun 2002 04:25:52 -0400 (EDT) Received: from kieser.net (localhost.localdomain [127.0.0.1]) by dev.kieser.demon.co.uk (Postfix) with ESMTP id B00792DE40 for ; Mon, 10 Jun 2002 09:25:52 +0100 (BST) Message-ID: <3D046290.2060906@kieser.net> Date: Mon, 10 Jun 2002 09:25:52 +0100 From: Bradley Kieser Organization: Kieser.net User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Rule to fill in value on column on insert Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200206/102 X-Sequence-Number: 8067 How do I create a rule that will set a column to a particular value upon insert? It's for use within an audit trail and we want to prevent any possibility of some rogue code setting it to an incorrect value (it's a time stamp) so we don't want to use default values. In general, though, it would be handy to know how to do this as there are many uses for it! Thanks, Brad