postgresql/src/backend
Tom Lane bf5b13a8a0 Clean up match_orclause_to_indexcol().
Remove bogus stripping of RelabelTypes: that can result in building
an output SAOP tree with incorrect exposed exprType for the operands,
which might confuse polymorphic operators.  Moreover it demonstrably
prevents folding some OR-trees to SAOPs when the RHS expressions
have different base types that were coerced to the same type by
RelabelTypes.

Reduce prohibition on type_is_rowtype to just disallow type RECORD.
We need that because otherwise we would happily fold multiple RECORD
Consts into a RECORDARRAY Const even if they aren't the same record
type.  (We could allow that perhaps, if we checked that they all have
the same typmod, but the case doesn't seem worth that much effort.)
However, there is no reason at all to disallow the transformation
for named composite types, nor domains over them: as long as we can
find a suitable array type we're good.

Remove some assertions that seem rather out of place (it's not
this code's duty to verify that the RestrictInfo structure is
sane).  Rewrite some comments.

The issues with RelabelType stripping seem severe enough to
back-patch this into v18 where the code was introduced.

Author: Tender Wang <tndrwang@gmail.com>
Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAHewXN=aH7GQBk4fXU-WaEeVmQWUmBAeNyBfJ3VKzPphyPKUkQ@mail.gmail.com
Backpatch-through: 18
2025-11-17 13:55:26 -05:00
..
access Limit the size of TID lists during parallel GIN build 2025-11-04 18:47:14 +01:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Use XLOG_CONTROL_FILE macro consistently for control file name. 2025-04-07 09:27:33 +09:00
bootstrap Remove unnecessary (char *) casts [mem] 2025-02-12 08:50:13 +01:00
catalog Fix StatisticsObjIsVisibleExt() for pg_temp. 2025-09-29 11:15:47 -07:00
commands Add note about CreateStatistics()'s selective use of check_rights. 2025-11-14 13:20:09 -06:00
executor Fix Assert failure in EXPLAIN ANALYZE MERGE with a concurrent update. 2025-11-16 22:15:10 +00:00
foreign Track the number of presorted outer pathkeys in MergePath 2025-05-08 18:21:32 +09:00
jit jit: Fix accidentally-harmless type confusion 2025-11-04 20:03:54 -05:00
lib Correct list of files in src/backend/lib/README 2025-06-27 09:31:23 +09:00
libpq Fix build breakage on Solaris-alikes with late-model GCC. 2025-07-23 15:44:29 -04:00
main Avoid possible crash within libsanitizer. 2025-11-05 11:09:30 -05:00
nodes Fix internal error from CollateExpr in SQL/JSON DEFAULT expressions 2025-10-09 01:07:52 -04:00
optimizer Clean up match_orclause_to_indexcol(). 2025-11-17 13:55:26 -05:00
parser Error message stylistic correction 2025-11-04 12:25:14 +01:00
partitioning Fix bug in cbc127917 to handle nested Append correctly 2025-02-25 09:24:42 +09:00
po Translation updates 2025-11-10 12:58:04 +01:00
port Don't treat EINVAL from semget() as a hard failure. 2025-08-13 11:59:47 -04:00
postmaster Fix snapshot handling bug in recent BRIN fix 2025-11-04 20:31:43 +01:00
regex Another unintentional behavior change in commit e9931bfb75. 2025-04-16 16:49:42 -07:00
replication Fix regression with slot invalidation checks 2025-10-30 13:13:31 +09:00
rewrite Fix comments for ChangeVarNodes() and related functions 2025-11-05 12:31:33 +09:00
snowball Use PG_MODULE_MAGIC_EXT in our installable shared libraries. 2025-03-26 11:11:02 -04:00
statistics Fix lookups in pg_{clear,restore}_{attribute,relation}_stats(). 2025-10-15 12:47:33 -05:00
storage Teach DSM registry to ERROR if attaching to an uninitialized entry. 2025-11-12 14:30:11 -06:00
tcop Check for CREATE privilege on the schema in CREATE STATISTICS. 2025-11-10 09:00:00 -06:00
tsearch Clear errno before calling strtol() in spell.c. 2025-03-08 11:24:25 -05:00
utils Mention md5 deprecation in postgresql.conf.sample 2025-11-17 12:18:18 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile aio: Add liburing dependency 2025-03-26 19:45:32 -04:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls.mk Return yyparse() result not via global variable 2025-01-24 06:55:39 +01:00