Rule to fill in value on column on insert - Mailing list pgsql-sql

From Bradley Kieser
Subject Rule to fill in value on column on insert
Date
Msg-id 3D046290.2060906@kieser.net
Whole thread Raw
Responses Re: Rule to fill in value on column on insert  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Re: Rule to fill in value on column on insert  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Joseph Syjuco
Date:
Subject: Re: arrays as pgsql function parameters
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Rule to fill in value on column on insert