39 elog(
ERROR,
"insert_username: not fired by trigger manager");
42 elog(
ERROR,
"insert_username: must be fired for row");
45 elog(
ERROR,
"insert_username: must be fired before event");
53 elog(
ERROR,
"insert_username: cannot process DELETE events");
65 args = trigger->tgargs;
66 tupdesc = rel->rd_att;
72 (
errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
77 (
errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
78 errmsg(
"attribute \"%s\" of \"%s\" must be type TEXT",
#define CStringGetTextDatum(s)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
HeapTuple heap_modify_tuple_by_cols(HeapTuple tuple, TupleDesc tupleDesc, int nCols, const int *replCols, const Datum *replValues, const bool *replIsnull)
Datum insert_username(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(insert_username)
if(TABLE==NULL||TABLE_index==NULL)
void pfree(void *pointer)
char * GetUserNameFromId(Oid roleid, bool noerr)
static Datum PointerGetDatum(const void *X)
char * SPI_getrelname(Relation rel)
int SPI_fnumber(TupleDesc tupdesc, const char *fname)
Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber)
#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)