Re: Adding ddl audit trigger

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Lawrence Cohan <LCohan(at)web(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:31:13
Message-ID: AANLkTik+WzY=GTWMuUc+YpYWg3ZN40CyDP4fQRQHJvDq@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

Responses

Browse pgsql-general by date

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