* postgresExecForeignInsert * Insert one row into a foreign table */
| 1957 | * Insert one row into a foreign table |
| 1958 | */ |
| 1959 | static TupleTableSlot * |
| 1960 | postgresExecForeignInsert(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 |
nothing calls this directly
no test coverage detected