Re: [PATCH] Remove Extra palloc Of raw_buf For Binary Format In COPY FROM

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Remove Extra palloc Of raw_buf For Binary Format In COPY FROM
Date: 2020-06-27 13:00:47
Message-ID: CALDaNm0-qoL9XokCQVV5dF67YsbaHnb6zGn-f5CZWx2f7xFmTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 27, 2020 at 9:23 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> Thanks Rushabh and Vignesh for the comments.
>
> >
> > One comment:
> > We could change below code:
> > + */
> > + if (!cstate->binary)
> > + cstate->raw_buf = (char *) palloc(RAW_BUF_SIZE + 1);
> > + else
> > + cstate->raw_buf = NULL;
> > to:
> > cstate->raw_buf = (cstate->binary) ? NULL : (char *) palloc(RAW_BUF_SIZE + 1);
> >
>
> Attached the patch with the above changes.

Changes look fine to me.

Regards,
Vignesh
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-06-27 14:56:46 Re: Fwd: PostgreSQL: WolfSSL support
Previous Message Bruce Momjian 2020-06-27 12:56:38 Re: Fwd: PostgreSQL: WolfSSL support