]> 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:13 +0000 (11:48 -0500)
commit315bcfeee0a438e687529435a68ea6e809950a45
tree102b2b4658c2a9327b6a1456ed0a8b296ece1300
parentf128d0c5266f72b15a806e547d79fb3f78e1573f
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
(cherry picked from commit a88f89849e303ab441082de788545ee8a698dc2e)
doc/build/changelog/unreleased_20/13059.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/json.py
test/dialect/postgresql/test_types.py