Re: de-deduplicate code in DML execution hooks in postgres_fdw

Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>

From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: Michael Paquier <michael@paquier.xyz>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-01-17T05:44:25Z
Lists: pgsql-hackers
(2019/01/16 20:30), Etsuro Fujita wrote:
> (2019/01/16 15:54), Michael Paquier wrote:
>> On Wed, Jan 16, 2019 at 02:59:15PM +0900, Etsuro Fujita wrote:
>>> If there are no objections, I'll commit that version of the patch.
>>
>> I think that you could use PgFdwModifyState for the second argument of
>> execute_foreign_modify instead of ResultRelInfo.
>
> Yeah, that is another option, but my favorite would be to use
> ResultRelInfo, as in the original patch by Ashutosh, because that makes
> it possible to write postgresExecForeignInsert,
> postgresExecForeignUpdate, and postgresExecForeignDelete as a single line.
>
>> Except of that nit,
>> it looks fine to me, thanks for taking care of it.
>
> Great! Thanks for the review!

Pushed.  I left that argument alone.  I think we can change it later, if 
necessary :).

Best regards,
Etsuro Fujita



Commits

  1. postgres_fdw: Remove duplicate code in DML execution callback functions.