Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: Sergei Kornilov <sk@zsrv.org>
Cc: Yugo NAGATA <nagata@sraoss.co.jp>, Nikita Malakhov <hukutoc@gmail.com>, pgsql-hackers@postgresql.org
Date: 2023-11-06T00:00:00Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add pg_column_toast_chunk_id().

minor doc issues.
Returns the chunk id of the TOASTed value, or NULL if the value is not TOASTed.
Should it be "chunk_id"?

you may place it after pg_create_logical_replication_slot entry to
make it look like alphabetical order.

There is no test. maybe we can add following to src/test/regress/sql/misc.sql
create table val(t text);
INSERT into val(t) SELECT string_agg(
  chr((ascii('B') + round(random() * 25)) :: integer),'')
FROM generate_series(1,2500);
select pg_column_toast_chunk_id(t) is  not null from val;
drop table val;