Re: How to generate a WAL record spanning multiple WAL files? - Mailing list pgsql-hackers

From Andy Fan
Subject Re: How to generate a WAL record spanning multiple WAL files?
Date
Msg-id CAKU4AWpzjmusAnhF3o57__uws00RsvXRFC939Tb8RPMTD9WEBg@mail.gmail.com
Whole thread Raw
In response to Re: How to generate a WAL record spanning multiple WAL files?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: How to generate a WAL record spanning multiple WAL files?
List pgsql-hackers


On Wed, Apr 6, 2022 at 12:41 AM Robert Haas <robertmhaas@gmail.com> wrote:
On Tue, Apr 5, 2022 at 10:10 AM Andy Fan <zhihui.fan1213@gmail.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.


OK, Thanks for your confirmation!


--
Best Regards
Andy Fan

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: ExecRTCheckPerms() and many prunable partitions
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: API stability