-
Notifications
You must be signed in to change notification settings - Fork 54
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
Bug with cursor initialized from SQLalchemy on PGSpecial #138
Comments
Seems the error is thrown from psycopg package, but I am think the issue is calling from |
It seems that you are passing a psycopg 2 connection where a psycopg 3 one is expected. Maybe you upgraded the package, but not the dependencies. |
I cannot reproduce this issue with recent versions of everything: $ pip install sqlalchemy pgspecial
[...]
Successfully installed [...] pgspecial-2.1.1 psycopg-3.1.18 sqlalchemy-2.0.30 [...] Then, in a Python shell: >>> from sqlalchemy import create_engine
>>> from pgspecial.main import PGSpecial
>>> eng = create_engine("postgresql+psycopg://pgcli-dev:pgcli-dev@localhost/pgcli-dev").connect()
>>> pgspecial = PGSpecial()
>>> pgspecial.execute(eng.connection.cursor(), "\d")
[(None, <psycopg.Cursor [TUPLES_OK] [INTRANS] (host=localhost database=pgcli-dev) at 0x7f440080e770>, ['Schema', 'Name', 'Type', 'Owner'], 'SELECT 7')] Note that the connection string must start with |
Hello, I noticed one issue after upgrading pgspecial to 2.1.0.
The issue is I used sqlalchemy to construct my connection,
Following code works fine in pgspecial.2.0.1, but not 2.1.0 version
Way to reproduce the issue:
Trace
Versions:
Python 3.9
sqlalchemy-2.0.8
The text was updated successfully, but these errors were encountered: