audit information

From: "Keith Worthington" <keithw(at)narrowpathinc(dot)com>
To: "PostgreSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: audit information
Date: 2005-04-25 14:41:09
Message-ID: 20050425142755.M22743@narrowpathinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

I need to add an audit trail to my application. I thought that I would add
the user id and timestamp to the tables where I need to track 'last modified
by...'. Currently there is a table tbl_employee that I would like to be able
to cross reference to in order to obtain the user's real name when necessary.

MYDB=# \d peachtree.tbl_employee
Table "peachtree.tbl_employee"
Column | Type | Modifiers
----------------+-----------------------+-----------
id | character varying(20) | not null
first_name | character varying(15) | not null
middle_initial | character(1) |
last_name | character varying(20) | not null
inactive | boolean | not null
email | character varying(64) |
Indexes:
"tbl_employee_pkey" PRIMARY KEY, btree (id)

Is there a way to obtain the postgres user id or must I store the output of
session_user in the tables?

Are there some existing functions and or tools for implementing audit trails?

What technique do most people use for this type of functionality?

Your input is appreciated.

Kind Regards,
Keith

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-04-25 15:35:34 Re: audit information
Previous Message John DeSoi 2005-04-25 00:20:26 Re: download