38 elog(
ERROR,
"not fired by trigger manager");
44 elog(
ERROR,
"must be fired before event");
52 elog(
ERROR,
"cannot process DELETE events");
60 if (nargs <= 0 || nargs % 2 != 0)
62 elog(
ERROR,
"autoinc (%s): even number gt 0 of arguments was expected",
relname);
64 args = trigger->tgargs;
65 tupdesc = rel->rd_att;
67 chattrs = (
int *)
palloc(nargs / 2 *
sizeof(
int));
69 newnulls = (
bool *)
palloc(nargs / 2 *
sizeof(
bool));
71 for (
i = 0;
i < nargs;)
79 (
errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
80 errmsg(
"\"%s\" has no attribute \"%s\"",
85 (
errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
86 errmsg(
"attribute \"%s\" of \"%s\" must be type INT4",
91 if (!isnull &&
val != 0)
98 chattrs[chnattrs] =
attnum;
108 newnulls[chnattrs] =
false;
#define CStringGetTextDatum(s)
Datum nextval(PG_FUNCTION_ARGS)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define DatumGetTextPP(X)
#define DirectFunctionCall1(func, arg1)
HeapTuple heap_modify_tuple_by_cols(HeapTuple tuple, TupleDesc tupleDesc, int nCols, const int *replCols, const Datum *replValues, const bool *replIsnull)
if(TABLE==NULL||TABLE_index==NULL)
void pfree(void *pointer)
static int64 DatumGetInt64(Datum X)
static Datum PointerGetDatum(const void *X)
static Datum Int32GetDatum(int32 X)
static int32 DatumGetInt32(Datum X)
char * SPI_getrelname(Relation rel)
int SPI_fnumber(TupleDesc tupdesc, const char *fname)
Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber)
Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull)
#define TRIGGER_FIRED_BEFORE(event)
#define CALLED_AS_TRIGGER(fcinfo)
#define TRIGGER_FIRED_FOR_ROW(event)
#define TRIGGER_FIRED_BY_INSERT(event)
#define TRIGGER_FIRED_BY_UPDATE(event)