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

Function postgresExecForeignInsert

contrib/postgres_fdw/postgres_fdw.c:1959–1982  ·  view source on GitHub ↗

* postgresExecForeignInsert * Insert one row into a foreign table */

Source from the content-addressed store, hash-verified

1957 * Insert one row into a foreign table
1958 */
1959static TupleTableSlot *
1960postgresExecForeignInsert(EState *estate,
1961 ResultRelInfo *resultRelInfo,
1962 TupleTableSlot *slot,
1963 TupleTableSlot *planSlot)
1964{
1965 PgFdwModifyState *fmstate = (PgFdwModifyState *) resultRelInfo->ri_FdwState;
1966 TupleTableSlot **rslot;
1967 int numSlots = 1;
1968
1969 /*
1970 * If the fmstate has aux_fmstate set, use the aux_fmstate (see
1971 * postgresBeginForeignInsert())
1972 */
1973 if (fmstate->aux_fmstate)
1974 resultRelInfo->ri_FdwState = fmstate->aux_fmstate;
1975 rslot = execute_foreign_modify(estate, resultRelInfo, CMD_INSERT,
1976 &slot, &planSlot, &numSlots);
1977 /* Revert that change */
1978 if (fmstate->aux_fmstate)
1979 resultRelInfo->ri_FdwState = fmstate;
1980
1981 return rslot ? *rslot : NULL;
1982}
1983
1984/*
1985 * postgresExecForeignBatchInsert

Callers

nothing calls this directly

Calls 1

execute_foreign_modifyFunction · 0.85

Tested by

no test coverage detected