Commit c9f26d7a authored by Tom Lane's avatar Tom Lane

COPY should handle after-insert triggers the same as execMain.c does.

I'm not sure that it's really necessary to save insert events when there
are only after update or delete triggers, but certainly it's wrong for
COPY to behave differently from an INSERT query.
parent 609fee47
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.133 2001/01/29 00:39:20 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.134 2001/03/14 21:47:50 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -877,12 +877,12 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, ...@@ -877,12 +877,12 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp,
if (!skip_tuple) if (!skip_tuple)
{ {
ExecStoreTuple(tuple, slot, InvalidBuffer, false);
/* ---------------- /* ----------------
* Check the constraints of the tuple * Check the constraints of the tuple
* ---------------- * ----------------
*/ */
ExecStoreTuple(tuple, slot, InvalidBuffer, false);
if (rel->rd_att->constr) if (rel->rd_att->constr)
ExecConstraints("CopyFrom", resultRelInfo, slot, estate); ExecConstraints("CopyFrom", resultRelInfo, slot, estate);
...@@ -896,8 +896,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, ...@@ -896,8 +896,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp,
ExecInsertIndexTuples(slot, &(tuple->t_self), estate, false); ExecInsertIndexTuples(slot, &(tuple->t_self), estate, false);
/* AFTER ROW INSERT Triggers */ /* AFTER ROW INSERT Triggers */
if (rel->trigdesc && if (rel->trigdesc)
rel->trigdesc->n_after_row[TRIGGER_EVENT_INSERT] > 0)
ExecARInsertTriggers(estate, rel, tuple); ExecARInsertTriggers(estate, rel, tuple);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment