MCPcopy Create free account
hub / github.com/apache/cloudberry / postgresExecForeignBatchInsert

Function postgresExecForeignBatchInsert

contrib/postgres_fdw/postgres_fdw.c:1988–2011  ·  view source on GitHub ↗

* postgresExecForeignBatchInsert * Insert multiple rows into a foreign table */

Source from the content-addressed store, hash-verified

1986 * Insert multiple rows into a foreign table
1987 */
1988static TupleTableSlot **
1989postgresExecForeignBatchInsert(EState *estate,
1990 ResultRelInfo *resultRelInfo,
1991 TupleTableSlot **slots,
1992 TupleTableSlot **planSlots,
1993 int *numSlots)
1994{
1995 PgFdwModifyState *fmstate = (PgFdwModifyState *) resultRelInfo->ri_FdwState;
1996 TupleTableSlot **rslot;
1997
1998 /*
1999 * If the fmstate has aux_fmstate set, use the aux_fmstate (see
2000 * postgresBeginForeignInsert())
2001 */
2002 if (fmstate->aux_fmstate)
2003 resultRelInfo->ri_FdwState = fmstate->aux_fmstate;
2004 rslot = execute_foreign_modify(estate, resultRelInfo, CMD_INSERT,
2005 slots, planSlots, numSlots);
2006 /* Revert that change */
2007 if (fmstate->aux_fmstate)
2008 resultRelInfo->ri_FdwState = fmstate;
2009
2010 return rslot;
2011}
2012
2013/*
2014 * postgresGetForeignModifyBatchSize

Callers

nothing calls this directly

Calls 1

execute_foreign_modifyFunction · 0.85

Tested by

no test coverage detected