CC=gcc
PGINC=/usr/include/postgresql
-CFLAGS=-I$(PGINC)
+PGVERSION=-DPG70
+#PGVERSION=-DPG71
+CFLAGS=-I$(PGINC) $(PGVERSION)
# If changed, also change postgresql.script
INSTALLDIR=../../../Mir/src
Datum dupecheck(PG_FUNCTION_ARGS)
{
+#ifdef PG71
TriggerData *trigdata = (TriggerData *) fcinfo->context;
+#else
+ TriggerData *trigdata = CurrentTrigerData;
+#endif
TupleDesc tupdesc;
HeapTuple rettuple;
bool isnull;
*rowstring,
*query;
-
/* Make sure trigdata is pointing at what I expect */
+#ifdef PG70
+ if (!CurrentTriggerData)
+#else
if (!CALLED_AS_TRIGGER(fcinfo))
+#endif
elog(ERROR, "dupecheck: not fired by trigger manager");
-
/* tuple to return to Executor */
if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event))
rettuple = trigdata->tg_newtuple;