DBA Hub

📋Steps in this guide1/1

Enable auditing for ddl/dml statement

-- Check auditing setting :

postgresql configurationintermediate
by PostgreSQL
20 views
1

Enable auditing for ddl/dml statement

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- Check auditing setting :
postgres=#
show log_statement;
log_statement
---------------
none
-- For logging all ddl activites:
postgres=#
alter system set log_statement=ddl;
ALTER SYSTEM
postgres=# select pg_reload_conf();
pg_reload_conf
----------------
t
-- For logging all DDL DML activities:
postgres=#
alter system set log_statement=mod;
ALTER SYSTEM
postgres=# select pg_reload_conf();
pg_reload_conf
----------------
t
-- For logging all statement( i.e ddl , dml and even select statements)
postgres=#
alter system set log_statement='all';
ALTER SYSTEM
postgres=# select pg_reload_conf();
pg_reload_conf
----------------
t

Comments (0)

Please to add comments

No comments yet. Be the first to comment!