Skip to content

Commit a2bd027

Browse files
Do not execute insert audit on delete query
1 parent 0e51d87 commit a2bd027

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/audit.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ create or replace function update_audit_log_objects()
9393
if
9494
old_data != new_data
9595
or (old_data is null and new_data is not null)
96-
or (new_data is null and old_data is not null)
96+
or (new_data is null and old_data is not null and TG_OP != 'DELETE')
9797
then
9898
insert into audit_log_objects (identity, operation, table_name, row_id, column_name, old_data, new_data)
9999
values (session_identity, TG_OP, table_name, NEW.row_id, colname, old_data, new_data);

0 commit comments

Comments
 (0)