Re: Adding ddl audit trigger

From: Lawrence Cohan <LCohan(at)web(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Adding ddl audit trigger
Date: 2011-01-27 20:47:11
Message-ID: 965AA5440EAC094E9F722519E285ACED725C0B992A@WWCEXCHANGE.web.web.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

That should do it for our dev environment however on production systems it would be a little bit harder (quite a few hops/approval/restore) to get to and grep the log files.

Many thanks for the suggestion,
Lawrence Cohan.

-----Original Message-----
From: Scott Marlowe [mailto:scott(dot)marlowe(at)gmail(dot)com]
Sent: January-27-11 3:31 PM
To: Lawrence Cohan
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Adding ddl audit trigger

On Wed, Jan 26, 2011 at 2:29 PM, Lawrence Cohan <LCohan(at)web(dot)com> wrote:
> 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:

Yep, can't do it just yet. For now you've got

log_statement='ddl';

which can be set by user, db, or for the whole cluster in postgresql.conf.

You can use the log_line_prefix to see what user did what to which
database. Then you can just grep for alter / create / drop etc. and
see what's happened. not as slick or elegant as ddl triggers, but at
least it's there.

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jon Hoffman 2011-01-27 20:57:32 Re: resizing a varchar column on 8.3.8
Previous Message Scott Marlowe 2011-01-27 20:39:56 Re: resizing a varchar column on 8.3.8