Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c9f26d7

Browse files
committed
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.
1 parent 609fee4 commit c9f26d7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/backend/commands/copy.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.133 2001/01/29 00:39:20 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.134 2001/03/14 21:47:50 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -877,12 +877,12 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp,
877877

878878
if (!skip_tuple)
879879
{
880+
ExecStoreTuple(tuple, slot, InvalidBuffer, false);
881+
880882
/* ----------------
881883
* Check the constraints of the tuple
882884
* ----------------
883885
*/
884-
ExecStoreTuple(tuple, slot, InvalidBuffer, false);
885-
886886
if (rel->rd_att->constr)
887887
ExecConstraints("CopyFrom", resultRelInfo, slot, estate);
888888

@@ -896,8 +896,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp,
896896
ExecInsertIndexTuples(slot, &(tuple->t_self), estate, false);
897897

898898
/* AFTER ROW INSERT Triggers */
899-
if (rel->trigdesc &&
900-
rel->trigdesc->n_after_row[TRIGGER_EVENT_INSERT] > 0)
899+
if (rel->trigdesc)
901900
ExecARInsertTriggers(estate, rel, tuple);
902901
}
903902

0 commit comments

Comments
 (0)