postgres_fdw: Remove duplicate code in DML execution callback functions.

Etsuro Fujita <efujita@postgresql.org>

Commit: 6c61d7c5935793e218d2335ac540a2cea7eacdce
Author: Etsuro Fujita <efujita@postgresql.org>
Date: 2019-01-17T05:37:33Z
Releases: 12.0
postgres_fdw: Remove duplicate code in DML execution callback functions.

postgresExecForeignInsert(), postgresExecForeignUpdate(), and
postgresExecForeignDelete() are coded almost identically, except that
postgresExecForeignInsert() does not need CTID.  Extract that code into
a separate function and use it in all the three function implementations.

Author: Ashutosh Bapat
Reviewed-By: Michael Paquier
Discussion: https://postgr.es/m/CAFjFpRcz8yoY7cBTYofcrCLwjaDeCcGKyTUivUbRiA57y3v-bw%40mail.gmail.com

Files

PathChange+/−
contrib/postgres_fdw/postgres_fdw.c modified +103 −180

Discussion