Closed dbevacqua closed 5 years ago
This fix allows setting audit trigger on schema-qualified tables not on the search path, e.g.
select audit.audit_table('some_schema.some_table'::regclass) select audit.audit_table('some_schema."some table"'::regclass)
select audit.audit_table('some_schema.some_table'::regclass)
select audit.audit_table('some_schema."some table"'::regclass)
Without it, the whole object name is quote_ident-ed, resulting in errors like:
quote_ident
ERROR: relation "some_schema.some_table" does not exist
The cast from regclass -> text takes care of quoting...
regclass
text
venue=> CREATE SCHEMA test_schema; CREATE SCHEMA venue=> CREATE TABLE test_schema."test table"(); CREATE TABLE venue=> SELECT 'test_schema."test table"'::regclass::text; -[ RECORD 1 ]------------------ text | test_schema."test table" (1 row)
so the quote_ident can simply be removed.
:-) just like previous pull request #20.
Addressed by another PR
This fix allows setting audit trigger on schema-qualified tables not on the search path, e.g.
select audit.audit_table('some_schema.some_table'::regclass)
select audit.audit_table('some_schema."some table"'::regclass)
Without it, the whole object name is
quote_ident
-ed, resulting in errors like:ERROR: relation "some_schema.some_table" does not exist
The cast from
regclass
->text
takes care of quoting...so the quote_ident can simply be removed.