Need Help and suggestion.

From: "Artistic-HO- IT-Department" <amedp(at)fascom(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Need Help and suggestion.
Date: 2004-12-01 07:56:35
Message-ID: 200412011256.AA196149506@fsg6.fascom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I have a user table in which number of users are created in a database rather creating postgresql user. We are having only one database user, through which we connect database.

I have make a simple table into database and fire a triggers on add, edit and delete data alongwith userid and action performed.

At the time of add entry into table my trigger is fired and it saved data into another table called audit table. My userid is saved into audit table because trigger is fired after insert row and my table is having userid column in it. Edit trigger is also fired correctly.

But But But the problem is that at the time of deletion of data, my deleted row is added into audit table having last userid that is saved last.

Like Mr. A add intry into table and data is copied into audit table.
Mr. B edit entry into table and data is copied into audit table.
Mr. C delete entry into table but it add data into audit table that Mr. B delete it(As it was the person who edit last). It saved the whole row that was deleted.

I think i have cleared out my point where i m facing problem. If not then

""""How can i make trigger on database that will add userid into audit table that Mr. C has deleted the entry."""""

Further, According to my company policy this must be done through trigger. Other alternative are not allowded like I can add entry into audit table by clicking delete button saving Mr.C as userid.

Hoping to receiving a quick response from you.

Thanking You

Anand Karia
Software Engineer.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-12-01 08:02:41 Re: [HACKERS] Adding Reply-To: <listname> to Lists configuration ...
Previous Message Tino Wildenhain 2004-12-01 06:20:39 Re: change natural column order