Re: Avoid unnecessary StringInfo allocation in tablesync COPY buffer

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, ZizhuanLiu X-MAN <44973863(at)qq(dot)com>, Denis Smirnov <darthunix(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Subject: Re: Avoid unnecessary StringInfo allocation in tablesync COPY buffer
Date: 2026-11-24 20:39:51
Message-ID: awX12Ekot9Z2PX1u@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-Nov-23, Álvaro Herrera wrote:

> I agree that there are more important things to fix. I thought using a
> read-only StringInfo and getting rid of the global wasn't a completely
> bad idea. I was reading this patch thinking it could be a quick push,
> but I realized that it's not trivial to see from eyeballing alone that
> we don't call walrcv_receive() one more time before consuming the whole
> buffer (which libpqrcv_receive warns against). Admittedly, the same can
> be said of the original code, so this is not a new concern. Maybe a few
> extra comments would make this business clearer.

I pushed this after all, thanks.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Los minutos y los segundos son mercadería de la ciudad, donde un infeliz se
afana por no perder ni siquiera un segundo y no advierte que obrando de ese
modo pierde una vida." ("La vuelta de Don Camilo", G. Guareschi)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-11-24 22:10:26 Should we skip foreign key checks in binary upgrade mode?
Previous Message Tomas Vondra 2026-11-24 20:11:07 Re: Parallel INSERT SELECT take 2