Skip to content

Commit 3eecf44

Browse files
author
Jan Was
committed
fixes 2ndQuadrant#9: use quote_ident for table name in the audit_table func
1 parent d256c1c commit 3eecf44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

audit.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ DECLARE
186186
_q_txt text;
187187
_ignored_cols_snip text = '';
188188
BEGIN
189-
EXECUTE 'DROP TRIGGER IF EXISTS audit_trigger_row ON ' || target_table;
190-
EXECUTE 'DROP TRIGGER IF EXISTS audit_trigger_stm ON ' || target_table;
189+
EXECUTE 'DROP TRIGGER IF EXISTS audit_trigger_row ON ' || quote_ident(target_table);
190+
EXECUTE 'DROP TRIGGER IF EXISTS audit_trigger_stm ON ' || quote_ident(target_table);
191191

192192
IF audit_rows THEN
193193
IF array_length(ignored_cols,1) > 0 THEN
194194
_ignored_cols_snip = ', ' || quote_literal(ignored_cols);
195195
END IF;
196196
_q_txt = 'CREATE TRIGGER audit_trigger_row AFTER INSERT OR UPDATE OR DELETE ON ' ||
197-
target_table ||
197+
quote_ident(target_table) ||
198198
' FOR EACH ROW EXECUTE PROCEDURE audit.if_modified_func(' ||
199199
quote_literal(audit_query_text) || _ignored_cols_snip || ');';
200200
RAISE NOTICE '%',_q_txt;

0 commit comments

Comments
 (0)