agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: hackerzheng666@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19632: RULE rewriting crashes with XX000 when RETURNING old/new references a system column
Date: Fri, 21 Aug 2026 13:34:11 +0200
Message-ID: <aog2yaY4DgZnQcIZ@alvherre.pgsql> (raw)
In-Reply-To: <19632-9155d9baec763c8c@postgresql.org>

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/






view thread (9+ messages)

Message-ID: <aog2yaY4DgZnQcIZ@alvherre.pgsql>
Permalink:  ../aog2yaY4DgZnQcIZ@alvherre.pgsql/
Also on:    postgresql.org/message-id/aog2yaY4DgZnQcIZ@alvherre.pgsql

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@kurilemu.de, hackerzheng666@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19632: RULE rewriting crashes with XX000 when RETURNING old/new references a system column
  In-Reply-To: <aog2yaY4DgZnQcIZ@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox