Re: Dead code with short varlenas in toast_save_datum() - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Dead code with short varlenas in toast_save_datum()
Date
Msg-id aJKwTiTnB7XLxxZP@paquier.xyz
Whole thread Raw
In response to Re: Dead code with short varlenas in toast_save_datum()  (Nikhil Kumar Veldanda <veldanda.nikhilkumar17@gmail.com>)
Responses Re: Dead code with short varlenas in toast_save_datum()
List pgsql-hackers
On Tue, Aug 05, 2025 at 10:26:03AM -0700, Nikhil Kumar Veldanda wrote:
> This code path is currently not covered by tests. It can be exercised
> with the following SQL pattern
>
> CREATE TABLE temp_tbl (a text, b text);
> ALTER TABLE temp_tbl SET (toast_tuple_target = 128);
> ALTER TABLE temp_tbl ALTER COLUMN a SET STORAGE EXTERNAL;
> ALTER TABLE temp_tbl ALTER COLUMN b SET STORAGE EXTERNAL;
> INSERT INTO temp_tbl values(repeat('a', 4000), repeat('a', 120));

Ah, thanks, nice one.  I did not consider the trick of using two
attributes to bypass the check when externalizing the tuple.  I'll go
add a test in strings.sql among these lines, with some TOAST slice
scans based on substr().
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Test to dump and restore objects left behind by regression
Next
From: Ajin Cherian
Date:
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance