break;
}
- /*
- * In UPDATE, no need to do anything if old and new keys are equal
- */
- if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event))
- {
- HeapTuple new_row = trigdata->tg_newtuple;
-
- if (ri_KeysEqual(pk_rel, old_row, new_row, riinfo, true))
- {
- heap_close(fk_rel, RowShareLock);
- return PointerGetDatum(NULL);
- }
- }
-
/*
* If another PK row now exists providing the old key values, we
* should not do anything. However, this check should only be
break;
}
- /*
- * No need to do anything if old and new keys are equal
- */
- if (ri_KeysEqual(pk_rel, old_row, new_row, riinfo, true))
- {
- heap_close(fk_rel, RowExclusiveLock);
- return PointerGetDatum(NULL);
- }
-
if (SPI_connect() != SPI_OK_CONNECT)
elog(ERROR, "SPI_connect failed");
break;
}
- /*
- * In UPDATE, no need to do anything if old and new keys are equal
- */
- if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event))
- {
- HeapTuple new_row = trigdata->tg_newtuple;
-
- if (ri_KeysEqual(pk_rel, old_row, new_row, riinfo, true))
- {
- heap_close(fk_rel, RowExclusiveLock);
- return PointerGetDatum(NULL);
- }
- }
-
if (SPI_connect() != SPI_OK_CONNECT)
elog(ERROR, "SPI_connect failed");
break;
}
- /*
- * In UPDATE, no need to do anything if old and new keys are equal
- */
- if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event))
- {
- HeapTuple new_row = trigdata->tg_newtuple;
-
- if (ri_KeysEqual(pk_rel, old_row, new_row, riinfo, true))
- {
- heap_close(fk_rel, RowExclusiveLock);
- return PointerGetDatum(NULL);
- }
- }
-
if (SPI_connect() != SPI_OK_CONNECT)
elog(ERROR, "SPI_connect failed");