Last active
December 15, 2015 13:39
-
-
Save yaniv-aknin/5268812 to your computer and use it in GitHub Desktop.
This code snippet works fine on my development box (OSX 10.7.5, postgres 9.1.4, Postgres.App 1.0 (11), libpq 0.5.4), works fine from my development box against my Heroku shared database, but breaks with an `(OperationalError) invalid connection option "application_name"` when ran on Heroku. Any explanations?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import environ | |
from sqlalchemy import create_engine | |
e = create_engine(environ['DATABASE_URL'], | |
connect_args={"application_name": "foo"}) | |
e.connect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psycopg2==2.4.5 | |
SQLAlchemy==0.7.9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also this StackOverflow question/answer with @zzzeek.
Also, note that on Heroku, libpq is at 0.5.2, where's on my laptop it's 0.5.4.