Re: [PATCH v1] Avoid deforming unused trailing columns in COPY TO

From: Tomás Senart <ts(at)perfloop(dot)ai>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH v1] Avoid deforming unused trailing columns in COPY TO
Date: 2026-11-18 20:52:48
Message-ID: CAEEBa3VSjzn-3QzJMhyKm3b5r3CXG9+AYV4RGOWxZdp=k+E=Qg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Chao,

Thanks for the review. Both points are right, and v2 attached does both.

1. max_attnum is now an AttrNumber placed after the two bool fields,
so it fits in the existing padding and CopyToStateData does not grow.
2. The slot_getsomeattrs() call in the else branch is gone.
CopyOneRowTo() already deforms the needed prefix, so that branch now
only sets copyslot = slot.

With assertions enabled, the regress suite (243 tests) and the
subscription TAP tests, including 031_column_list, pass. The code
change is otherwise the same as v1.

Regards,
Tomás

Attachment Content-Type Size
v2-0001-Avoid-deforming-unused-trailing-columns-in-COPY-T.patch text/x-patch 2.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2026-11-18 21:38:11 Re: [BUG / PATCH] PG19: VACUUM misestimates reltuples (often 0) after on-access VM setting
Previous Message Zsolt Parragi 2026-11-18 20:50:36 Long reloption values are truncated by pg_dump and pg_get_indexdef()