Skip to content

asyncpg dialect improperly coerces the BigInteger type when passing it to the function polymorphic in its arguments #7814

Discussion options

You must be logged in to vote

Hi,

sqlalchemy tries to guess what type to use based on the in argument. since python has only one kind of integer, that's what guessed. You can specify a type on the function, doing select(func.pg_try_advisory_lock(lock_id_64bit, type_=BigInteger)

I think this is an expected behaviour, since pg_try_advisory_lock uses a generic function, so it has to guess the type from the arguments.

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
5 replies
@zzzeek
Comment options

@anentropic
Comment options

@CaselIT
Comment options

@anentropic
Comment options

@anentropic
Comment options

Answer selected by igoras1993
Comment options

You must be logged in to vote
3 replies
@zzzeek
Comment options

@CaselIT
Comment options

@igoras1993
Comment options

Comment options

You must be logged in to vote
1 reply
@zzzeek
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postgresql datatypes things to do with database types, like VARCHAR and others expected behavior that's how it's meant to work. consider the "documentation" label in addition
4 participants
Converted from issue

This discussion was converted from issue #7813 on March 11, 2022 14:07.