Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding trigger to user table #18

Open
joelbarnard opened this issue Oct 6, 2015 · 1 comment
Open

Adding trigger to user table #18

joelbarnard opened this issue Oct 6, 2015 · 1 comment

Comments

@joelbarnard
Copy link

Our schema has a "user" table, user is also a reserved word in Postgres.
When trying to enable auditing on this table, it throws an error.

I've tried every vairation of ', and " I can think of, including prefixing the schema.

Any ideas?

SELECT audit.audit_table('user');

NOTICE:  relation ""user"" does not exist, skipping
CONTEXT:  SQL statement "DROP TRIGGER IF EXISTS audit_trigger_row ON """user""""
PL/pgSQL function audit.audit_table(regclass,boolean,boolean,text[]) line 7 at EXECUTE statement
NOTICE:  relation ""user"" does not exist, skipping
CONTEXT:  SQL statement "DROP TRIGGER IF EXISTS audit_trigger_stm ON """user""""
PL/pgSQL function audit.audit_table(regclass,boolean,boolean,text[]) line 8 at EXECUTE statement
NOTICE:  CREATE TRIGGER audit_trigger_row AFTER INSERT OR UPDATE OR DELETE ON """user""" FOR EACH ROW EXECUTE PROCEDURE audit.if_modified_func('true');
ERROR:  relation ""user"" does not exist
CONTEXT:  SQL statement "CREATE TRIGGER audit_trigger_row AFTER INSERT OR UPDATE    OR DELETE ON """user""" FOR EACH ROW EXECUTE PROCEDURE audit.if_modified_func('true');"
PL/pgSQL function audit.audit_table(regclass,boolean,boolean,text[]) line 19 at EXECUTE statement
********** Error **********

ERROR: relation ""user"" does not exist
SQL state: 42P01
Context: SQL statement "CREATE TRIGGER audit_trigger_row AFTER INSERT OR UPDATE OR DELETE ON """user""" FOR EACH ROW EXECUTE PROCEDURE audit.if_modified_func('true');"
PL/pgSQL function audit.audit_table(regclass,boolean,boolean,text[]) line 19 at EXECUTE statement
@mikijov
Copy link
Contributor

mikijov commented Feb 20, 2016

I believe that my change in this pull request solves this problem.
Pull request: #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants