Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

Next:From: Michael FuhrDate: 2005-04-25 15:35:34
Subject: Re: audit information
Previous:From: John DeSoiDate: 2005-04-25 00:20:26
Subject: Re: download

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group