Pg18 Recursive Crash

Paul Ramsey <pramsey@cleverelephant.ca>

From: Paul Ramsey <pramsey@cleverelephant.ca>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-12-16T17:50:39Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Optimize grouping equality checks with virtual slots

  2. Fix Assert failure in WITH RECURSIVE UNION queries

  3. Fix incorrect slot type in BuildTupleHashTableExt

Apologies if this is already reported, but there’s a crasher in recursive queries at the head of the current development that happened to be exercised by our regression suite. Here is a core-only reproduction.

CREATE TABLE foo (id integer, x integer, y integer);
INSERT INTO foo VALUES (1, 0, 1);
INSERT INTO foo VALUES (2, 1, 2);
INSERT INTO foo VALUES (3, 2, 3);

WITH RECURSIVE path (id, x, y) AS (
    SELECT id, x, y FROM foo WHERE id = 1
    UNION
    SELECT foo.id, foo.x, foo.y
    FROM path, foo
    WHERE path.y = foo.x
)
SELECT 'crash', id, x, y FROM path;


Thanks!
ATB,
P