05.04.2026 11:00, Alexander Lakhin wrote:
> I and SQLsmith have discovered one more anomaly (reproduced starting from
> e0e4c132e):
> load 'test_plan_advice';
> select object_type from
> (select object_type from information_schema.element_types limit 1),
> lateral
> (select sum(1) over (partition by a) from generate_series(1, 2) g(a) where false);
>
> triggers an internal error:
> ERROR: XX000: no rtoffset for plan unnamed_subquery
> LOCATION: pgpa_plan_walker, pgpa_walker.c:110
And another error, which might be interesting to you:
CREATE EXTENSION tsm_system_time;
CREATE TABLE t(i int);
SELECT 1 FROM (SELECT i FROM t TABLESAMPLE system_time (1000)), LATERAL (SELECT i LIMIT 1);
ERROR: XX000: plan node has no RTIs: 378
LOCATION: pgpa_build_scan, pgpa_scan.c:200
Best regards,
Alexander