Skip to content

Instantly share code, notes, and snippets.

@yaniv-aknin
Last active December 15, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaniv-aknin/5268812 to your computer and use it in GitHub Desktop.
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?
from os import environ
from sqlalchemy import create_engine
e = create_engine(environ['DATABASE_URL'],
connect_args={"application_name": "foo"})
e.connect()
psycopg2==2.4.5
SQLAlchemy==0.7.9
@yaniv-aknin
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment