MCPcopy Create free account
hub / github.com/documentdb/documentdb / command_insert_txn_proc

Function command_insert_txn_proc

pg_documentdb/src/commands/insert.c:217–233  ·  view source on GitHub ↗

* command_insert_txn_proc handles the insert command invocation through a PostgreSQL procedure. * this function behaves the same way as command_insert. */

Source from the content-addressed store, hash-verified

215 * this function behaves the same way as command_insert.
216 */
217Datum
218command_insert_txn_proc(PG_FUNCTION_ARGS)
219{
220 ReportFeatureUsage(FEATURE_COMMAND_INSERT);
221
222 bool isTopLevel = true;
223 if (IsInTransactionBlock(isTopLevel))
224 {
225 ereport(ERROR, (errcode(ERRCODE_DOCUMENTDB_OPERATIONNOTSUPPORTEDINTRANSACTION),
226 errmsg("the insert procedure cannot be used in transactions."
227 " Please use the insert function instead")));
228 }
229
230 /* Use function context as a stable memory context to store errors across transaction aborts */
231 PG_RETURN_DATUM(CommandInsertCore(fcinfo, WriteMode_Txn_Proc,
232 fcinfo->flinfo->fn_mcxt));
233}
234
235
236/*

Callers

nothing calls this directly

Calls 2

ReportFeatureUsageFunction · 0.85
CommandInsertCoreFunction · 0.85

Tested by

no test coverage detected