]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fixed JSONB path_match and path_exists operators to use correct type coercion
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 31 Dec 2025 20:48:44 +0000 (15:48 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 1 Jan 2026 16:48:51 +0000 (11:48 -0500)
commit39d31c5ea095577147a474be89e5d754a67aa514
treea42b7868b721f7916ba7d5b91bd38cfd67165660
parent0a1be6dcfab7b17613835248a368e6b822a53319
Fixed JSONB path_match and path_exists operators to use correct type coercion

Fixed issue where PostgreSQL JSONB operators
:meth:`_postgresql.JSONB.Comparator.path_match` and
:meth:`_postgresql.JSONB.Comparator.path_exists` were applying incorrect
``VARCHAR`` casts to the right-hand side operand when used with newer
PostgreSQL drivers such as psycopg. The operators now indicate the
right-hand type as ``JSONPATH``, which currently results in no casting
taking place, but is also compatible with explicit casts if the
implementation were require it at a later point.

Fixes: #13059
Change-Id: I8e1a58361456f7efabf4940339cb5ce2c5a1d5f9
doc/build/changelog/unreleased_20/13059.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/json.py
test/dialect/postgresql/test_types.py