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

pg_audit_log will not work on heroku #11

Open
danielgrippi opened this issue Nov 18, 2014 · 2 comments
Open

pg_audit_log will not work on heroku #11

danielgrippi opened this issue Nov 18, 2014 · 2 comments

Comments

@danielgrippi
Copy link
Contributor

1/ Either call out that this line won't work on heroku:

CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;

2/ Create a workaround (plpgsql is enabled by default on postgres 9.3, which is the version running on heroku).

@amarshall
Copy link
Contributor

For reference, what’s the exact error you get?

@danielgrippi
Copy link
Contributor Author

@amarshall unfortunately, I don't have the exact output, but I can specify the reason:

Since heroku doesn't give its users superuser access to their postgres instances, it's impossible for someone to run a CREATE OR REPLACE PROCEDURAL LANGUAGE command via psql. The function in function.rb will abort at the first line of the SQL setup.

My workaround was to remove the line, as there's no need to ensure plpgsql is present, because it is by default on 9.3.

One solution would be wrapping this line in a BEGIN; EXCEPTION; block. Another would be to remove the line entirely, which would drop support for postgres 8.x versions (seems a bit heavy handed). Thoughts?

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