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);
139 if (index->indisprimary && index->indisvalid)
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")));
#define PointerGetDatum(X)
#define TupleDescAttr(tupdesc, i)
StringInfo makeStringInfo(void)
int errcode(int sqlerrcode)
#define TRIGGER_FIRED_AFTER(event)
char * SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber)
#define appendStringInfoCharMacro(str, ch)
#define ObjectIdGetDatum(X)
PG_FUNCTION_INFO_V1(triggered_change_notification)
static void strcpy_quoted(StringInfo r, const char *s, const char q)
#define RelationGetRelationName(relation)
FormData_pg_attribute * Form_pg_attribute
FormData_pg_index * Form_pg_index
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define TRIGGER_FIRED_BY_DELETE(event)
Datum triggered_change_notification(PG_FUNCTION_ARGS)
void ReleaseSysCache(HeapTuple tuple)
#define ereport(elevel,...)
#define HeapTupleIsValid(tuple)
#define CALLED_AS_TRIGGER(fcinfo)
List * RelationGetIndexList(Relation relation)
void Async_Notify(const char *channel, const char *payload)
#define TRIGGER_FIRED_BY_INSERT(event)
int errmsg(const char *fmt,...)
void list_free(List *list)
#define TRIGGER_FIRED_FOR_ROW(event)
#define TRIGGER_FIRED_BY_UPDATE(event)