You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when using SQLAlchemy with asyncpg and the autoload_with option while trying to load table metadata. The problem occurs because PostgreSQL's oid type is treated as a signed 32-bit integer (int32) by asyncpg, which leads to a DataError when the OID value exceeds the maximum range of int32 (2,147,483,647).
Steps to Reproduce
Create a PostgreSQL table with an OID that exceeds the int32 range. For example, an OID like 3195477613.
Use SQLAlchemy to define the table with autoload_with to load metadata:
Describe the bug
I encountered an issue when using SQLAlchemy with asyncpg and the autoload_with option while trying to load table metadata. The problem occurs because PostgreSQL's oid type is treated as a signed 32-bit integer (int32) by asyncpg, which leads to a DataError when the OID value exceeds the maximum range of int32 (2,147,483,647).
Steps to Reproduce
Observed Behavior
The following exception is raised during metadata loading:
Expected Behavior
The autoload_with option should correctly handle OID values, even if they exceed the int32 range.
asyncpg/SQLAlchemy Version in Use
asyncpg 0.30.0
sqlalchemy 1.4.54
Database Vendor and Major Version
PostgreSQL 14
Python Version
3.13
Operating system
Linux
The text was updated successfully, but these errors were encountered: