SQLAlchemy: engine, connection and session difference

I use SQLAlchemy and there are at least three entities: engine, session and connection, which have execute method, so if I e.g. want to select all records from table I can do this engine.execute(select([table])).fetchall() and this connection.execute(select([table])).fetchall() and even this session.execute(select([table])).fetchall() – the results will be the same. As I understand it, if someone uses … Read more

DatabaseError: current transaction is aborted, commands ignored until end of transaction block?

I got a lot of errors with the message : “DatabaseError: current transaction is aborted, commands ignored until end of transaction block” after changed from python-psycopg to python-psycopg2 as Django project’s database engine. The code remains the same, just don’t know where those errors are from. 21 Answers 21

How to install psycopg2 with “pip” on Python?

I’m using virtualenv and I need to install “psycopg2”. I have done the following: pip install http://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 And I have the following messages: Downloading/unpacking http://pypi.python.org/packages/source/p/psycopg2/psycopg2 -2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 Downloading psycopg2-2.4.tar.gz (607Kb): 607Kb downloaded Running setup.py egg_info for package from http://pypi.python.org/packages/sou rce/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 Error: pg_config executable not found. Please add the directory containing pg_config to the PATH or specify … Read more

pg_config executable not found

I am having trouble installing psycopg2. I get the following error when I try to pip install psycopg2: Error: pg_config executable not found. Please add the directory containing pg_config to the PATH or specify the full executable path with the option: python setup.py build_ext –pg-config /path/to/pg_config build … or with the pg_config option in ‘setup.cfg’. … Read more