agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Antonin Houska <ah@cybertec.at>
To: shihao zhong <zhong950419@gmail.com>
Cc: Alvaro Herrera <alvherre@kurilemu.de>
Cc: Fujii Masao <masao.fujii@gmail.com>
Cc: Radim Marek <radim@boringsql.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: REPACK (CONCURRENTLY) might keep dropped-column data
Date: Tue, 06 Oct 2026 09:35:13 +0200
Message-ID: <12438.1791272113@localhost> (raw)
In-Reply-To: <CAGRkXqTxse0sTb43z3kFAHDrffjkamHkFGfoLEtwRkr_QfDGGg@mail.gmail.com>
References: <CAHGQGwG9bHxhs4Nj+9avSjSGh0vdYNQgEuz+pmJ-H5be6tEBTw@mail.gmail.com>
	<asOEsmPw75ifqMua@alvherre.pgsql>
	<CAGRkXqTxse0sTb43z3kFAHDrffjkamHkFGfoLEtwRkr_QfDGGg@mail.gmail.com>

shihao zhong <zhong950419@gmail.com> wrote:

> A replayed INSERT can carry a dropped column's value too, and that
> path still stores it.
> 
> A BEFORE INSERT trigger that returns a copy of
> an existing row does it:
> 
> r := (SELECT t FROM demo t WHERE id = 1);
> r.id := NEW.id;
> RETURN r;
> 
> So does an UPDATE that moves the row to another partition while the
> trigger returns OLD. COPY, MERGE and INSERT ON CONFLICT go the same
> way.


> It can also make REPACK fail. If the columns that are left need no
> TOAST table, the new heap has none, and on master I get:
> 
> ERROR:  row is too big: size 16424, maximum size 8160

Can you please be more specific about this? I don't understand why the new
heap has no TOAST relation in such a case. Perhaps a bug in see
heapam_relation_needs_toast_table()? I'm not sure it should return here,
regardless the tuple size.

	if (!has_toastable_attrs)
		return false;			/* nothing to toast? */


> 0001 clears dropped columns in restore_tuple(), so every kind of
> change is covered, and the block added to prepare_concurrent_update()
> is no longer needed.

Is this needed even for DELETE?

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com






view thread (14+ messages)  latest in thread

Message-ID: <12438.1791272113@localhost>
Permalink:  ../12438.1791272113@localhost/
Also on:    postgresql.org/message-id/12438.1791272113@localhost

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-hackers@postgresql.org
  Cc: ah@cybertec.at, zhong950419@gmail.com, alvherre@kurilemu.de, masao.fujii@gmail.com, radim@boringsql.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: REPACK (CONCURRENTLY) might keep dropped-column data
  In-Reply-To: <12438.1791272113@localhost>

* 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