BUG #19470: PostgreSQL backend aborts (assert failure) when a prepared statement returns a composite type cast t

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: haogangmao(at)gmail(dot)com
Subject: BUG #19470: PostgreSQL backend aborts (assert failure) when a prepared statement returns a composite type cast t
Date: 2026-04-29 11:27:19
Message-ID: 19470-0a344a5b356fc1a8@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19470
Logged by: HaoGang Mao
Email address: haogangmao(at)gmail(dot)com
PostgreSQL version: 18.3
Operating system: Linux
Description:

Reproduction steps (minimal):
BEGIN;
CREATE TYPE foo AS (a int, b text);
PREPARE p AS SELECT CAST(ROW(1, 'hello') AS foo)::text;
EXECUTE p;
ALTER TYPE foo ALTER ATTRIBUTE a TYPE VARCHAR(100);
EXECUTE p;
COMMIT;

Expected: Error message (type modified while a prepared plan / expression is
active)
Actual: Server connection dropped; backend aborts with SIGABRT due to
assertion failure

Server log (trimmed):
TRAP: failed Assert("false"), File: "heaptuple.c", Line: 1417, PID: <pid>
... heap_deform_tuple()

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gary Clarke 2026-04-29 12:00:28 Interval unit format bug
Previous Message Siddharth Kothari 2026-04-29 06:54:21 Fix size estimation for parallel B-Tree scans with skip arrays