Re: Cleanup - Removal of unused function parameter from CopyReadBinaryAttribute - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Cleanup - Removal of unused function parameter from CopyReadBinaryAttribute
Date
Msg-id CALj2ACUv1+DpKEuRAryTMPjqOidjgGFGA4QQB_ZYFuJef8ap_Q@mail.gmail.com
Whole thread Raw
In response to Cleanup - Removal of unused function parameter from CopyReadBinaryAttribute  (vignesh C <vignesh21@gmail.com>)
Responses Re: Cleanup - Removal of unused function parameter fromCopyReadBinaryAttribute  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
On Thu, Jun 18, 2020 at 7:01 PM vignesh C <vignesh21@gmail.com> wrote:
>
> Hi,
>
> While checking copy from code I found that the function parameter
> column_no is not used in CopyReadBinaryAttribute. I felt this could be
> removed.
> Attached patch contains the changes for the same.
> Thoughts?
>

I don't see any problem in removing this extra parameter.

However another thought, can it be used to report a bit meaningful
error for field size < 0 check?

if (fld_size < 0)
        ereport(ERROR,
                (errcode(ERRCODE_BAD_COPY_FILE_FORMAT),
                 errmsg("invalid field size for column %d", column_no)));

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Missing HashAgg EXPLAIN ANALYZE details for parallel plans
Next
From: "Winfield, Steven"
Date:
Subject: Mark btree_gist functions as PARALLEL SAFE