Re: Fdw batch insert error out when set batch_size > 65535 - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: Fdw batch insert error out when set batch_size > 65535
Date
Msg-id fe6cea83-b378-dce0-0506-03ff9a1a581d@enterprisedb.com
Whole thread Raw
In response to RE: Fdw batch insert error out when set batch_size > 65535  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Responses Re: Fdw batch insert error out when set batch_size > 65535
List pgsql-hackers
Hi,

I took at this patch today. I did some minor changes, mostly:

1) change the code limiting batch_size from

    if (fmstate->p_nums > 0 &&
       (batch_size * fmstate->p_nums > PQ_QUERY_PARAM_MAX_LIMIT))
    {
        batch_size = PQ_QUERY_PARAM_MAX_LIMIT / fmstate->p_nums;
    }

to

    if (fmstate && fmstate->p_nums > 0)
        batch_size = Min(batch_size,
                         PQ_QUERY_PARAM_MAX_LIMIT / fmstate->p_nums);

which I think is somewhat clearer / more common patter.


2) I've reworded the docs a bit, splitting the single para into two. I
think this makes it clearer.


Attached is a patch doing this. Please check the commit message etc.
Barring objections I'll get it committed in a couple days.



regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Reducing memory consumption for pending inval messages
Next
From: Tomas Vondra
Date:
Subject: Re: list of extended statistics on psql (\dX)