Re: Fix bug of COPY TO support partition table

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: Chao Li <li.evan.chao@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, Masahiko Sawada <sawada.mshk@gmail.com>, jian he <jian.universality@gmail.com>
Date: 2026-05-14T16:25:11Z
Lists: pgsql-hackers
On Thu, May 14, 2026 at 7:00 PM Chao Li <li.evan.chao@gmail.com> wrote:
> As shown above, COPY incorrectly outputs all NULLs.

Good catch!

> The fix is straightforward, just reverse the order of `rel` and `root_rel` when calling `build_attrmap_by_name_if_req()`. After the fix, COPY works correctly:

Thanks for the patch! It looks good to me.

Regards,

-- 
Fujii Masao