Closed matsimko closed 1 year ago
This would be an SQLAlchemy issue. asyncpg
relies on PostgreSQL argument introspection, so if Postgres determines it's a text argument, then it must be a text argument. Explicitly casting arguments is a good practice in any case.
Yes, turns out SQLAlchemy fixed this in version 2.0.13 by adding casts.
I have a table called
attachment
which contains aBYTEA
column calleddata
.Inserting a single row succeeds:
Inserting more than one row fails:
The problem can be avoided by explicitly casting to
BYTEA
:However, I cannot do that because I am using SQLAlchemy, which generates these statements.