75 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
76 errmsg(
"triggered_change_notification: must be called as trigger")));
81 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
82 errmsg(
"triggered_change_notification: must be called after the change")));
87 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
88 errmsg(
"triggered_change_notification: must be called for each row")));
98 elog(
ERROR,
"triggered_change_notification: trigger fired by unrecognized operation");
106 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
107 errmsg(
"triggered_change_notification: must not be called with more than one parameter")));
112 channel = trigger->tgargs[0];
128 foreach(indexoidscan, indexoidlist)
136 elog(
ERROR,
"cache lookup failed for index %u", indexoid);
141 int indnkeyatts =
index->indnkeyatts;
153 for (
i = 0;
i < indnkeyatts;
i++)
155 int colno =
index->indkey.values[
i];
176 (
errcode(ERRCODE_E_R_I_E_TRIGGER_PROTOCOL_VIOLATED),
177 errmsg(
"triggered_change_notification: must be called on a table with a primary key")));
void Async_Notify(const char *channel, const char *payload)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
void list_free(List *list)
FormData_pg_attribute * Form_pg_attribute
FormData_pg_index * Form_pg_index
static Datum PointerGetDatum(const void *X)
static Datum ObjectIdGetDatum(Oid X)
#define RelationGetRelationName(relation)
List * RelationGetIndexList(Relation relation)
char * SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
StringInfo makeStringInfo(void)
#define appendStringInfoCharMacro(str, ch)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
static void strcpy_quoted(StringInfo r, const char *s, const char q)
Datum triggered_change_notification(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(triggered_change_notification)
#define TRIGGER_FIRED_BY_DELETE(event)
#define CALLED_AS_TRIGGER(fcinfo)
#define TRIGGER_FIRED_FOR_ROW(event)
#define TRIGGER_FIRED_AFTER(event)
#define TRIGGER_FIRED_BY_INSERT(event)
#define TRIGGER_FIRED_BY_UPDATE(event)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)