First class support for psycopg2cffi
It'd be great if there was first class support for psycopg2cffi (the name is pretty straightforward :P), which is the best drive for PostgreSQL on PyPy. I suspect it basically just works; adding it to the test matrix is valuable.
Comments (11)
-
repo owner -
repo owner unless it imports as "psycopg2" by itself, then nothing needs to change.
-
reporter It imports as
psycopg2cffi
, there's a.compat()
method you can use for it to monkey patch its way to beingpsycopg2
, but I think it's better to discourage that. -
repo owner - changed milestone to 0.9.7
-
repo owner -
assigned issue to
- changed component to postgres
-
assigned issue to
-
repo owner - changed milestone to 0.9.8
-
repo owner - changed milestone to 0.9.7
-
repo owner - changed milestone to 0.9.8
-
repo owner - changed milestone to 1.0.xx
-
repo owner - changed status to resolved
- additional test adjustments for pypy / psycopg2cffi. This consists mainly of adjusting fixtures to ensure connections are closed explicitly. psycopg2cffi also handles unicode bind parameter names differently than psycopg2, and seems to possibly have a little less control over floating point values at least in one test which is marked as a "fail", though will see if it runs differently on linux than osx..
- changelog for psycopg2cffi, fixes
#3052
→ <<cset a826ff366bf9>>
-
In testing my app, I'm seeing ~2x slower performance (as timed with
@event.listens_for(Engine, 'before_cursor_execute')
methods) for queries, flushes and commits using pypy+sqlalchemy1.0+psycopg2cffi compared with cpython+sqlalchemy1.0+psycopg2. I'm guessing this has little to do with SQLAlchemy, though. - Log in to comment
OK well we can try it without any code changes first like this:
then to actually support it, we just need to add a psycopg2cffi.py file with pretty much a three line stub dialect, that subclasses PGDialect_psycopg2:
that would be it!