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

Adding ddl audit trigger

From: Lawrence Cohan <LCohan(at)web(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Adding ddl audit trigger
Date: 2011-01-26 21:29:22
Message-ID: 965AA5440EAC094E9F722519E285ACED725C0B98CB@WWCEXCHANGE.web.web.com (view raw or flat)
Thread:
Lists: pgsql-general
Trying to get some DDL auditing in a development environment by adding triggers to pg_proc, pg_class,pg_type,pg_trigger and getting the following error:

ERROR: permission denied: "pg_proc" is a system catalog
SQL state: 42501

Is there any way to achieve DDL auditing in Postgres and trace any new/dropped/changed object into a table?
All I need is to at least be able and save a userid(current_user), timestamp, action, and the name of the object and this could be done easily by adding triggers to these pg catalogs.

________________________________
Attention:
The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy any copies.

Responses

pgsql-general by date

Next:From: El CoDate: 2011-01-26 21:30:28
Subject: Adding ddl audit trigger
Previous:From: Tom LaneDate: 2011-01-26 20:31:11
Subject: Re: Getting the name of the timezone, adjusted for daylight saving

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