Re: How to generate a WAL record spanning multiple WAL files?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: How to generate a WAL record spanning multiple WAL files?
Date: 2022-04-05 16:40:52
Message-ID: CA+TgmoY0PMy-h4SSr3LU=YhbeD05VY+x=f=KeQtt-Sa0A5ZATA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 5, 2022 at 10:10 AM Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> wrote:
>> > I wanted to have a WAL record spanning multiple WAL files of size, say
>> > 16MB. I'm wondering if the Full Page Images (FPIs) of a TOAST table
>> > would help here. Please let me know if there's any way to generate
>> > such large WAL records.
>>
>> It's easier to use pg_logical_emit_message().
>
> Not sure I understand the question correctly here. What if I use the below code
> where the len might be very large? like 64MB.
>
> XLogBeginInsert();
> XLogRegisterData((char *)&xl_append, sizeof(xl_cstore_append));
> XLogRegisterData((char *)data, len);
>
> XLogInsert(..);

Well, that's how to do it from C. And pg_logical_emit_message() is how
to do it from SQL.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Imseih (AWS), Sami 2022-04-05 16:42:28 Re: Add index scan progress to pg_stat_progress_vacuum
Previous Message Robert Haas 2022-04-05 16:38:04 Re: Improve documentation for pg_upgrade, standbys and rsync