diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-14 21:47:50 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-03-14 21:47:50 +0000 |
commit | c9f26d7af6537a332daf834c523d2de0c0390d65 (patch) | |
tree | cf9c066fe831a86ace7f91c35dc493292bb13fb0 /src | |
parent | 609fee47179aa4c8f7c93e7829658f114ceadd25 (diff) | |
download | postgresql-c9f26d7af6537a332daf834c523d2de0c0390d65.tar.gz postgresql-c9f26d7af6537a332daf834c523d2de0c0390d65.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/copy.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 7d0352506ca..b518ef572e1 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -7,7 +7,7 @@ * * * 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, if (!skip_tuple) { + ExecStoreTuple(tuple, slot, InvalidBuffer, false); + /* ---------------- * Check the constraints of the tuple * ---------------- */ - ExecStoreTuple(tuple, slot, InvalidBuffer, false); - if (rel->rd_att->constr) ExecConstraints("CopyFrom", resultRelInfo, slot, estate); @@ -896,8 +896,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, ExecInsertIndexTuples(slot, &(tuple->t_self), estate, false); /* AFTER ROW INSERT Triggers */ - if (rel->trigdesc && - rel->trigdesc->n_after_row[TRIGGER_EVENT_INSERT] > 0) + if (rel->trigdesc) ExecARInsertTriggers(estate, rel, tuple); } |