diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/spi/autoinc.c | 6 | ||||
-rw-r--r-- | contrib/spi/insert_username.c | 6 | ||||
-rw-r--r-- | contrib/spi/moddatetime.c | 8 | ||||
-rw-r--r-- | contrib/spi/refint.c | 8 | ||||
-rw-r--r-- | contrib/spi/timetravel.c | 6 |
5 files changed, 17 insertions, 17 deletions
diff --git a/contrib/spi/autoinc.c b/contrib/spi/autoinc.c index 4552fc3b59e..9b38493a332 100644 --- a/contrib/spi/autoinc.c +++ b/contrib/spi/autoinc.c @@ -35,10 +35,10 @@ autoinc(PG_FUNCTION_ARGS) if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */ elog(ERROR, "not fired by trigger manager"); - if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event)) + if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ - elog(ERROR, "cannot process STATEMENT events"); - if (TRIGGER_FIRED_AFTER(trigdata->tg_event)) + elog(ERROR, "must be fired for row"); + if (!TRIGGER_FIRED_BEFORE(trigdata->tg_event)) /* internal error */ elog(ERROR, "must be fired before event"); diff --git a/contrib/spi/insert_username.c b/contrib/spi/insert_username.c index da6764faf64..18a13344cf1 100644 --- a/contrib/spi/insert_username.c +++ b/contrib/spi/insert_username.c @@ -38,10 +38,10 @@ insert_username(PG_FUNCTION_ARGS) if (!CALLED_AS_TRIGGER(fcinfo)) /* internal error */ elog(ERROR, "insert_username: not fired by trigger manager"); - if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event)) + if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ - elog(ERROR, "insert_username: cannot process STATEMENT events"); - if (TRIGGER_FIRED_AFTER(trigdata->tg_event)) + elog(ERROR, "insert_username: must be fired for row"); + if (!TRIGGER_FIRED_BEFORE(trigdata->tg_event)) /* internal error */ elog(ERROR, "insert_username: must be fired before event"); diff --git a/contrib/spi/moddatetime.c b/contrib/spi/moddatetime.c index e90c0b5cc25..9a1addb78ad 100644 --- a/contrib/spi/moddatetime.c +++ b/contrib/spi/moddatetime.c @@ -43,17 +43,17 @@ moddatetime(PG_FUNCTION_ARGS) /* internal error */ elog(ERROR, "moddatetime: not fired by trigger manager"); - if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event)) + if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ - elog(ERROR, "moddatetime: cannot process STATEMENT events"); + elog(ERROR, "moddatetime: must be fired for row"); - if (TRIGGER_FIRED_AFTER(trigdata->tg_event)) + if (!TRIGGER_FIRED_BEFORE(trigdata->tg_event)) /* internal error */ elog(ERROR, "moddatetime: must be fired before event"); if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event)) /* internal error */ - elog(ERROR, "moddatetime: must be fired before event"); + elog(ERROR, "moddatetime: cannot process INSERT events"); else if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event)) rettuple = trigdata->tg_newtuple; else diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c index cbd08d491db..36f9ee421e7 100644 --- a/contrib/spi/refint.c +++ b/contrib/spi/refint.c @@ -79,9 +79,9 @@ check_primary_key(PG_FUNCTION_ARGS) elog(ERROR, "check_primary_key: not fired by trigger manager"); /* Should be called for ROW trigger */ - if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event)) + if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ - elog(ERROR, "check_primary_key: cannot process STATEMENT events"); + elog(ERROR, "check_primary_key: must be fired for row"); /* If INSERTion then must check Tuple to being inserted */ if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event)) @@ -279,9 +279,9 @@ check_foreign_key(PG_FUNCTION_ARGS) elog(ERROR, "check_foreign_key: not fired by trigger manager"); /* Should be called for ROW trigger */ - if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event)) + if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) /* internal error */ - elog(ERROR, "check_foreign_key: cannot process STATEMENT events"); + elog(ERROR, "check_foreign_key: must be fired for row"); /* Not should be called for INSERT */ if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event)) diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c index 8bae3131dcf..14621244a98 100644 --- a/contrib/spi/timetravel.c +++ b/contrib/spi/timetravel.c @@ -118,11 +118,11 @@ timetravel(PG_FUNCTION_ARGS) elog(ERROR, "timetravel: not fired by trigger manager"); /* Should be called for ROW trigger */ - if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event)) - elog(ERROR, "timetravel: cannot process STATEMENT events"); + if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event)) + elog(ERROR, "timetravel: must be fired for row"); /* Should be called BEFORE */ - if (TRIGGER_FIRED_AFTER(trigdata->tg_event)) + if (!TRIGGER_FIRED_BEFORE(trigdata->tg_event)) elog(ERROR, "timetravel: must be fired before event"); /* INSERT ? */ |