RE: POC: postgres_fdw insert batching - Mailing list pgsql-hackers

From tsunakawa.takay@fujitsu.com
Subject RE: POC: postgres_fdw insert batching
Date
Msg-id TYAPR01MB299078E548D696A3D5CD197AFEA30@TYAPR01MB2990.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: POC: postgres_fdw insert batching  (Zhihong Yu <zyu@yugabyte.com>)
List pgsql-hackers
Tomas-san, Zhihong-san,

From: Zhihong Yu <zyu@yugabyte.com> 
> +           if (batch_size <= 0)
> +               ereport(ERROR,
> +                       (errcode(ERRCODE_SYNTAX_ERROR),
> +                        errmsg("%s requires a non-negative integer value",
> 
> It seems the message doesn't match the check w.r.t. the batch size of 0.

Ah, "non-negative" should be "positive".  The message for the existing fetch_size should be fixed too.  Tomas-san,
couldyou include this as well?  I'm sorry to trouble you.
 


> +   int         numInserted = numSlots;
> 
> Since numInserted is filled by ExecForeignBatchInsert(), the initialization can be done with 0.

No, the code is correct, since the batch function requires the number of rows to insert as input.


Regards
Takayuki Tsunakawa


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Paint some PG_USED_FOR_ASSERTS_ONLY in inline functions of ilist.h and bufpage.h
Next
From: Tomas Vondra
Date:
Subject: Re: PoC/WIP: Extended statistics on expressions