postgresql/src/backend
Tom Lane 2d7808e6fc Fix LIKE/regex optimization for indexscan with exact-match pattern.
Commit 85b7efa1c introduced support for LIKE with non-deterministic
collations.  By moving some conditionals around, it accidentally broke
the optimization for converting a LIKE or regex exact-match pattern
to an equality indexqual when the index collation doesn't match the
expression collation.  That should be allowed if the expression
collation is deterministic.  This patch re-introduces the optimization
for that common case.

One important beneficiary of this optimization is the "\d tablename"
command in psql.  Without this fix that will do a seqscan on pg_class
instead of an index point lookup.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Jelte Fennema-Nio <postgres@jeltef.nl>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/DHBQIZX8SZVI.ZX614ZMFL645@jeltef.nl
Backpatch-through: 18
2026-07-06 13:06:24 -04:00
..
access Remove replication slot advice from MultiXact wraparound hints 2026-07-03 11:16:34 +09:00
archive Don't include wait_event.h in pgstat.h 2026-03-06 16:24:58 +01:00
backup Clear base backup progress on backup failure 2026-07-01 23:04:18 +09:00
bootstrap Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
catalog Make property graph object descriptions better translatable 2026-07-03 23:46:19 +02:00
commands Fix properties orphaned by dropping a label 2026-07-05 13:51:32 +02:00
executor Allow logical replication conflicts to be logged to a table. 2026-07-02 08:26:07 +05:30
foreign Remove bits* typedefs. 2026-03-30 16:12:08 -05:00
jit Update JIT tuple deforming code for virtual generated columns 2026-06-19 15:26:18 +12:00
lib Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
libpq Warn on password auth with MD5-encrypted passwords 2026-07-01 20:57:28 +09:00
main Update copyright for 2026 2026-01-01 13:24:10 -05:00
nodes IS JSON/JSON(): Protect against expressions uncoercible to text 2026-06-11 16:17:58 +02:00
optimizer Forbid generated columns in FOR PORTION OF 2026-07-06 09:32:09 +02:00
parser Resolve unknown-type literals in GRAPH_TABLE COLUMNS 2026-07-03 17:10:42 +02:00
partitioning Prevent satisfies_hash_partition from crashing with VARIADIC NULL. 2026-07-06 12:51:29 -04:00
po Translation updates 2026-06-01 12:13:54 +02:00
port Use "grep -E" not "egrep". 2026-05-13 12:07:19 -04:00
postmaster Use placeholders and not GUC names in error message (autovacuum) 2026-06-30 16:16:56 +09:00
regex Harden our regex engine against integer overflow in size calculations. 2026-05-11 05:13:46 -07:00
replication Expand comment on the slot recheck in drop_local_obsolete_slots(). 2026-07-02 09:34:17 +05:30
rewrite Disallow renaming a rule to "_RETURN". 2026-07-04 11:34:26 -04:00
snowball Fix meson build of snowball code. 2026-01-05 16:51:36 -05:00
statistics Simplify some stats restore code with InputFunctionCallSafe() 2026-06-30 08:30:08 +09:00
storage Emit a warning when io_min_workers exceeds io_max_workers 2026-07-06 11:37:36 +09:00
tcop Add log_statement_max_length GUC to limit logged statement text 2026-07-03 08:47:18 +09:00
tsearch dict_synonym.c: remove incorrect outlen. 2026-06-08 11:47:53 -07:00
utils Fix LIKE/regex optimization for indexscan with exact-match pattern. 2026-07-06 13:06:24 -04:00
.gitignore
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile ssl: Serverside SNI support for libpq 2026-03-18 12:37:11 +01:00
meson.build Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
nls.mk Create a separate file listing backend types 2025-09-26 15:21:49 +02:00