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

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, Sergei Kornilov <sk(at)zsrv(dot)org>, Nikita Malakhov <hukutoc(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value
Date: 2024-03-12 08:51:19
Message-ID: 20240312155119.9341cfd76f2732ac93ecb6a4@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 9 Mar 2024 08:50:28 -0600
Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:

> On Sat, Mar 09, 2024 at 11:57:18AM +0900, Yugo NAGATA wrote:
> > On Fri, 8 Mar 2024 16:17:58 -0600
> > Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
> >> Is this guaranteed to be TOASTed for all possible page sizes?
> >
> > Should we use block_size?
> >
> > SHOW block_size \gset
> > INSERT INTO test_chunk_id(v1,v2)
> > VALUES (repeat('x', 1), repeat('x', (:block_size / 4)));
> >
> > I think this will work in various page sizes.
>
> WFM
>
> > +SHOW block_size; \gset
> > + block_size
> > +------------
> > + 8192
> > +(1 row)
>
> I think we need to remove the ';' so that the output of the query is not
> saved in the ".out" file. With that change, this test passes when Postgres
> is built with --with-blocksize=32. However, many other unrelated tests
> begin failing, so I guess this fix isn't tremendously important.

I rewrote the patch to use current_setting('block_size') instead of SHOW
and \gset as other tests do. Although some tests are failing with block_size=32,
I wonder it is a bit better to use "block_size" instead of the constant
to make the test more general to some extent.

Regards,
Yugo Nagata

>
> --
> Nathan Bossart
> Amazon Web Services: https://aws.amazon.com

--
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v9-0001-Add-pg_column_toast_chunk_id-function.patch text/x-diff 6.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2024-03-12 08:51:34 Re: Statistics Import and Export
Previous Message Heikki Linnakangas 2024-03-12 08:49:31 Re: Disconnect if socket cannot be put into non-blocking mode