can i pass the transition tables to any function from hooks like ExecutorFinish?

Started by Onur ALTUNover 6 years ago1 messageshackers
Jump to latest
#1Onur ALTUN
onuraltun@hotmail.com

i want to audit dml changes to my audit table and i dont want to use trigger. i am trying to pass the transition table data to my function. (or another solution) i want to write an extension and my code is like above.

if (queryDesc->operation == CMD_INSERT) {
SPI_connect();

Oid argtypes[1] = { REGTYPEOID }; **//whatever**

SPI_execute_with_args("SELECT save_insert($1)", 1, argtypes, queryDesc->estate->es_tupleTable, NULL, true, 0);

SPI_finish();
}