| From: | Alexander Kuzmenkov <akuzmenkov(at)tigerdata(dot)com> |
|---|---|
| To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | assertion failure with unique index + partitioning + join |
| Date: | 2026-06-15 15:39:01 |
| Message-ID: | CALzhyqwryL2QywgO03VQr_237Sq3MEVgTTT2_A9G3nGT5-SRZg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi hackers,
While I was running some random testing on the TimescaleDB extension, I
noticed that I can easily hit an assertion failure in plain Postgres
REL_18_STABLE. I haven't analyzed it at all, but thought I should report
this:
CREATE TABLE t (a bool UNIQUE) PARTITION BY LIST (a);
CREATE TABLE p PARTITION OF t DEFAULT;
SELECT
FROM (
SELECT *
FROM t
LEFT JOIN t r USING (a)
)
WHERE a
GROUP BY ();
TRAP: failed Assert("bms_is_member(i, root->outer_join_rels)"), File:
"../pg/src/backend/optimizer/path/equivclass.c", Line: 3631, PID: 1813021
Stack trace:
#6 0x000055d44911f565 in get_eclass_indexes_for_relids
(root=root(at)entry=0x55d45c0a2d58,
relids=relids(at)entry=0x55d45c0af3f0) at
../pg/src/backend/optimizer/path/equivclass.c:3631
#7 0x000055d44911f338 in get_common_eclass_indexes (root=0x55d45c0a2d58,
relids1=0x55d45c0a47e8, relids2=0x55d45c0af3f0) at
../pg/src/backend/optimizer/path/equivclass.c:3662
#8 generate_join_implied_equalities (root=root(at)entry=0x55d45c0a2d58,
join_relids=join_relids(at)entry=0x55d45c0af520,
outer_relids=outer_relids(at)entry=0x55d45c0af3f0,
inner_rel=inner_rel(at)entry=0x55d45c0a5c28,
sjinfo=sjinfo(at)entry=0x0) at
../pg/src/backend/optimizer/path/equivclass.c:1599
#9 0x000055d44917a42f in get_baserel_parampathinfo
(root=root(at)entry=0x55d45c0a2d58,
baserel=baserel(at)entry=0x55d45c0a5c28, required_outer=0x55d45c0af3f0) at
../pg/src/backend/optimizer/util/relnode.c:1590
#10 0x000055d44916d0ab in create_index_path (root=root(at)entry=0x55d45c0a2d58,
index=index(at)entry=0x55d45c0ad048, indexclauses=0x55d45c0af4b0,
indexorderbys=0x0, indexorderbycols=indexorderbycols(at)entry=0x0,
pathkeys=0x0, indexscandir=ForwardScanDirection, indexonly=<optimized out>,
required_outer=0x55d45c0af3f0, loop_count=<error reading variable: That
operation is not available on integers of more than 8 bytes.>,
loop_count(at)entry=1, partial_path=<optimized out>) at
../pg/src/backend/optimizer/util/pathnode.c:1070
#11 0x000055d449126dae in build_index_paths (root=root(at)entry=0x55d45c0a2d58,
rel=rel(at)entry=0x55d45c0a5c28, index=index(at)entry=0x55d45c0ad048,
clauses=clauses(at)entry=0x7ffc6f09da70, useful_predicate=false,
scantype=scantype(at)entry=ST_ANYSCAN, skip_nonnative_saop=0x7ffc6f09da37) at
../pg/src/backend/optimizer/path/indxpath.c:969
#12 0x000055d449123cc2 in get_index_paths (root=root(at)entry=0x55d45c0a2d58,
rel=rel(at)entry=0x55d45c0a5c28, index=0x6, index(at)entry=0x55d45c0ad048,
clauses=clauses(at)entry=0x7ffc6f09da70,
bitindexpaths=bitindexpaths(at)entry=0x7ffc6f09ddb0)
at ../pg/src/backend/optimizer/path/indxpath.c:728
#13 0x000055d449123700 in create_index_paths (root=0x55d45c0a2d58,
rel=0x55d45c0a5c28) at ../pg/src/backend/optimizer/path/indxpath.c:285
#14 0x000055d4491141ce in set_rel_pathlist (root=root(at)entry=0x55d45c0a2d58,
rel=rel(at)entry=0x55d45c0a5c28, rti=5, rte=0x55d45c0a5660) at
../pg/src/backend/optimizer/path/allpaths.c:499
#15 0x000055d449114053 in set_append_rel_pathlist (root=0x55d45c0a2d58,
rel=0x55d45c0a4cd0, rti=2, rte=0x55d45bff3dc8) at
../pg/src/backend/optimizer/path/allpaths.c:1290
#16 set_rel_pathlist (root=root(at)entry=0x55d45c0a2d58, rel=0x55d45c0a4cd0,
rti=rti(at)entry=2, rte=0x55d45bff3dc8) at
../pg/src/backend/optimizer/path/allpaths.c:479
#17 0x000055d44910fd69 in set_base_rel_pathlists (root=0x55d45c0a2d58) at
../pg/src/backend/optimizer/path/allpaths.c:351
#18 make_one_rel (root=root(at)entry=0x55d45c0a2d58,
joinlist=joinlist(at)entry=0x55d45c0ad6b8)
at ../pg/src/backend/optimizer/path/allpaths.c:221
#19 0x000055d449144f89 in query_planner (root=0x55d45c0a2d58,
qp_callback=<optimized out>, qp_extra=qp_extra(at)entry=0x7ffc6f09df48) at
../pg/src/backend/optimizer/plan/planmain.c:288
#20 0x000055d44914817e in grouping_planner (root=root(at)entry=0x55d45c0a2d58,
tuple_fraction=<optimized out>, tuple_fraction(at)entry=0,
setops=setops(at)entry=0x0)
at ../pg/src/backend/optimizer/plan/planner.c:1896
#21 0x000055d449146ae2 in subquery_planner (glob=glob(at)entry=0x55d45bfbc1e8,
parse=parse(at)entry=0x55d45bfbc2f8, parent_root=parent_root(at)entry=0x0,
hasRecursion=false, tuple_fraction=<error reading variable: That operation
is not available on integers of more than 8 bytes.>, setops=setops(at)entry=0x0)
at ../pg/src/backend/optimizer/plan/planner.c:1274
#22 0x000055d44914519a in standard_planner (parse=0x55d45bfbc2f8,
query_string=<optimized out>, cursorOptions=2048, boundParams=<optimized
out>) at ../pg/src/backend/optimizer/plan/planner.c:453
#23 0x000055d44914503e in planner (parse=0x1baa1d, parse(at)entry=0x55d45bfbc2f8,
query_string=0x1baa1d <error: Cannot access memory at address 0x1baa1d>,
query_string(at)entry=0x55d45bfbaba0 "SELECT", ' ' <repeats 91 times>, "\n
FROM (\n SELECT *", ' ' <repeats 79 times>..., cursorOptions=6,
cursorOptions(at)entry=2048, boundParams=0x7f05ac2969fc
<__GI___pthread_kill+300>, boundParams(at)entry=0x0) at
../pg/src/backend/optimizer/plan/planner.c:313
Best regards
Alexander Kuzmenkov
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | Etsuro Fujita | 2026-06-15 14:54:55 | Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table |