Re: is there a function in postgresql that can be used for retrieving deleted rows

Поиск
Список
Период
Сортировка
Искать
От
Basil Bourque
Тема
Re: is there a function in postgresql that can be used for retrieving deleted rows
Дата
Msg-id
B1698EC3-9109-4D08-A5E3-0E4B1722B4B2@me.com
Ответ на
Список
Дерево обсуждения
is there a function in postgresql that can be used for retrieving deleted rows "Charles Waweru" <cwaweru@systempartners.biz>
Re: is there a function in postgresql that can be used for retrieving deleted rows Pavel Stehule <pavel.stehule@gmail.com>
Re: is there a function in postgresql that can be used for retrieving deleted rows Basil Bourque <basil.list@me.com>
Re: is there a function in postgresql that can be used for retrieving deleted rows Steve Atkins <steve@blighty.com>
Re: is there a function in postgresql that can be used for retrieving deleted rows David Johnston <polobo@yahoo.com>
>> I am looking for a tool in the PostgreSQL database that can help to audit
>> fraudulent activities on a PostgreSQL database. Of particular interest is
>> how to retrieve say from a PostgreSQL sales database all the deleted rows.
>> 
> 
> you can use triggers
> 
> PostgreSQL has no other internal mechanism, but triggers and well
> access rights are enough for this purposes

I can't help with past forensics, but for the future…

My blog has a post showing a PL/pgSQL routine called from a table's trigger to record all Create, Update, and Delete actions. There is a tricky hack required to get around weakness in PL/pgSQL on order for the routine to work generically.

Automatically Record History of Field Changes in Postgres (Dynamic Triggers in PL/pgSQL)
http://crafted-software.blogspot.com/2011/05/hoorah-i-was-able-to-complete-my.html

Another idea: 
On some tables in some databases, I never delete records. I have a boolean column that marks if a row is in the imaginary garbage can, and thereafter ignored in all queries. Any true deletes can therefore trigger a "Red Alert".

--Basil Bourque
В списке pgsql-general по дате отправления
От: Sanjaya Kumar Patel
Дата:
Сообщение: Spam mails from my hotmail id
От: René Fournier
Дата:
FAQ