Re: [GENERAL] Adding ddl audit trigger

2011-01-28 Thread Kenneth Buckler
You just need to log DDL, correct? Why not just edit postgres.conf and set log_statement to 'ddl'. See http://www.postgresql.org/docs/9.0/static/runtime-config-logging.html If you need to include username, database, etc, take a look at log_line_prefix on the same page. Ken On Wed, Jan 26, 2011

Re: [GENERAL] Adding ddl audit trigger

2011-01-27 Thread Lawrence Cohan
We'll do that - thanks again. -Original Message- From: Scott Marlowe [mailto:scott.marl...@gmail.com] Sent: January-27-11 3:58 PM To: Lawrence Cohan Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Adding ddl audit trigger On Thu, Jan 27, 2011 at 1:47 PM, Lawrence Cohan

Re: [GENERAL] Adding ddl audit trigger

2011-01-27 Thread Scott Marlowe
On Thu, Jan 27, 2011 at 1:47 PM, Lawrence Cohan wrote: > 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. Sounds like you need a process to scrub logs and ship them o

Re: [GENERAL] Adding ddl audit trigger

2011-01-27 Thread Lawrence Cohan
...@gmail.com] Sent: January-27-11 3:31 PM To: Lawrence Cohan Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Adding ddl audit trigger On Wed, Jan 26, 2011 at 2:29 PM, Lawrence Cohan wrote: > Trying to get some DDL auditing in a development environment by adding > triggers to pg_proc, pg

Re: [GENERAL] Adding ddl audit trigger

2011-01-27 Thread Scott Marlowe
On Wed, Jan 26, 2011 at 2:29 PM, Lawrence Cohan 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

Re: [GENERAL] Adding ddl audit trigger

2011-01-27 Thread Chris Browne
guilla...@lelarge.info (Guillaume Lelarge) writes: > Le 26/01/2011 23:13, Tom Lane a écrit : >> Guillaume Lelarge writes: >>> Le 26/01/2011 22:29, Lawrence Cohan a écrit : All I need is to at least be able and save a userid(current_user), >>> timestamp, action, and the name of the object and

Re: [GENERAL] Adding ddl audit trigger

2011-01-27 Thread Lawrence Cohan
@postgresql.org Subject: Re: [GENERAL] Adding ddl audit trigger Le 26/01/2011 23:13, Tom Lane a écrit : > Guillaume Lelarge writes: >> Le 26/01/2011 22:29, Lawrence Cohan a écrit : >>> All I need is to at least be able and save a userid(current_user), >>> timestamp, action, and the

Re: [GENERAL] Adding ddl audit trigger

2011-01-26 Thread Pavel Stehule
Hello 2011/1/26 El Co : > 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 ac

Re: [GENERAL] Adding ddl audit trigger

2011-01-26 Thread Guillaume Lelarge
Le 26/01/2011 23:13, Tom Lane a écrit : > Guillaume Lelarge writes: >> Le 26/01/2011 22:29, Lawrence Cohan a écrit : >>> 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 th

Re: [GENERAL] Adding ddl audit trigger

2011-01-26 Thread Tom Lane
Guillaume Lelarge writes: > Le 26/01/2011 22:29, Lawrence Cohan a écrit : >> 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. > Nope, sorry. You can't add

Re: [GENERAL] Adding ddl audit trigger

2011-01-26 Thread Guillaume Lelarge
Le 26/01/2011 22:29, Lawrence Cohan a écrit : > 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 ther

[GENERAL] Adding ddl audit trigger

2011-01-26 Thread Lawrence Cohan
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 ne

[GENERAL] Adding ddl audit trigger

2011-01-26 Thread El Co
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