Re: BUG #19632: RULE rewriting crashes with XX000 when RETURNING old/new references a system column

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: hackerzheng666(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19632: RULE rewriting crashes with XX000 when RETURNING old/new references a system column
Date: 2026-08-21 11:34:11
Message-ID: aog2yaY4DgZnQcIZ@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2026-Aug-19, PG Bug reporting form wrote:

> Reproducer:
>
> CREATE TABLE t (a int);
> INSERT INTO t VALUES (1);
> CREATE RULE t_del AS ON DELETE TO t
> DO INSTEAD UPDATE t SET a = -1 WHERE a = OLD.a RETURNING *;
>
> -- All of these crash with XX000:
> DELETE FROM t WHERE a = 1 RETURNING old.tableoid;
> -- ERROR: XX000: could not find replacement targetlist entry for attno -6

This is not a "crash". The server is still running, no process has been
restarted, so what you see here is an ordinary error with no further
interesting symptoms. This report is a bit alarmist.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Rachitskiy 2026-08-21 12:00:17 Re: BUG #19635: Missing entry in information_schema.sequences when creating a Tale with auto increment
Previous Message Ayush Tiwari 2026-08-21 10:15:14 Re: BUG #19631: currtid2() on a view with GROUP BY ctid crashes with XX000