aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/tsvector_op.c6
-rw-r--r--src/pl/plpgsql/src/pl_exec.c4
-rw-r--r--src/pl/plpython/plpython.c1
-rw-r--r--src/test/regress/regress.c6
4 files changed, 8 insertions, 9 deletions
diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c
index 399fee85af8..769509772a1 100644
--- a/src/backend/utils/adt/tsvector_op.c
+++ b/src/backend/utils/adt/tsvector_op.c
@@ -1257,9 +1257,9 @@ tsvector_update_trigger(PG_FUNCTION_ARGS, bool config_column)
elog(ERROR, "tsvector_update_trigger: not fired by trigger manager");
trigdata = (TriggerData *) fcinfo->context;
- if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event))
- elog(ERROR, "tsvector_update_trigger: can't process STATEMENT events");
- if (TRIGGER_FIRED_AFTER(trigdata->tg_event))
+ if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))
+ elog(ERROR, "tsvector_update_trigger: must be fired for row");
+ if (!TRIGGER_FIRED_BEFORE(trigdata->tg_event))
elog(ERROR, "tsvector_update_trigger: must be fired BEFORE event");
if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event))
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 6601320de30..e2b5f77c9d9 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -526,7 +526,7 @@ plpgsql_exec_trigger(PLpgSQL_function *func,
rec_old->tupdesc = trigdata->tg_relation->rd_att;
rec_old->freetupdesc = false;
- if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event))
+ if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))
{
/*
* Per-statement triggers don't use OLD/NEW variables
@@ -715,7 +715,7 @@ plpgsql_exec_trigger(PLpgSQL_function *func,
* attributes don't have the correct atttypmod's length. It's up to the
* trigger's programmer to ensure that this doesn't happen. Jan
*/
- if (estate.retisnull || TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event))
+ if (estate.retisnull || !TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))
rettup = NULL;
else
{
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 6e35637daf2..4c53987fa4a 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -841,7 +841,6 @@ PLy_trigger_build_args(FunctionCallInfo fcinfo, PLyProcedure *proc, HeapTuple *r
Py_DECREF(plttableschema);
pfree(stroid);
-
if (TRIGGER_FIRED_BEFORE(tdata->tg_event))
pltwhen = PyString_FromString("BEFORE");
else if (TRIGGER_FIRED_AFTER(tdata->tg_event))
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index 8b0f9f14f35..8e4286a643b 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -487,9 +487,9 @@ ttdummy(PG_FUNCTION_ARGS)
if (!CALLED_AS_TRIGGER(fcinfo))
elog(ERROR, "ttdummy: not fired by trigger manager");
- if (TRIGGER_FIRED_FOR_STATEMENT(trigdata->tg_event))
- elog(ERROR, "ttdummy: cannot process STATEMENT events");
- if (TRIGGER_FIRED_AFTER(trigdata->tg_event))
+ if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))
+ elog(ERROR, "ttdummy: must be fired for row");
+ if (!TRIGGER_FIRED_BEFORE(trigdata->tg_event))
elog(ERROR, "ttdummy: must be fired before event");
if (TRIGGER_FIRED_BY_INSERT(trigdata->tg_event))
elog(ERROR, "ttdummy: cannot process INSERT event");