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
Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: local
Python version: 3.11
Platform: Windows
Do you use pgbouncer?: No
Did you install asyncpg with pip?: Yes
If you built asyncpg locally, which version of Cython did you use?: N/A
Can the issue be reproduced under both asyncio and uvloop?: yes
I am using asyncpg as the driver for SQLAlchemy.
class Table(Base):
__tablename__ = 'table'
interval: Mapped[timedelta]
session.add(Table(interval='1 min'))
With the above code, it throws this error: sqlalchemy.exc.DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.DataError'>: invalid input for query argument $9: '1 min' ('str' object has no attribute 'days')
However, Postgresql accepts '1 min' as a value to an interval column. Why is asyncpg forbidding str even though Postgresql accepts it in this case?
The text was updated successfully, but these errors were encountered:
the issue with a local PostgreSQL install?: local
uvloop?: yes
I am using asyncpg as the driver for SQLAlchemy.
With the above code, it throws this error:
sqlalchemy.exc.DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.DataError'>: invalid input for query argument $9: '1 min' ('str' object has no attribute 'days')
However, Postgresql accepts
'1 min'
as a value to an interval column. Why is asyncpg forbidding str even though Postgresql accepts it in this case?The text was updated successfully, but these errors were encountered: