1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Clean up inefficiency in ExecRelCheck, and cause it to do the right

thing when there are multiple result relations.  Formerly, during
something like 'UPDATE foo*', foo's constraints and *only* foo's
constraints would be applied to all foo's children.  Wrong-o ...
This commit is contained in:
Tom Lane
2000-08-06 04:26:40 +00:00
parent 925418d2fa
commit 8ae23135bc
4 changed files with 80 additions and 139 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.119 2000/07/14 22:17:42 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.120 2000/08/06 04:26:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -827,9 +827,10 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp,
* Check the constraints of the tuple
* ----------------
*/
ExecStoreTuple(tuple, slot, InvalidBuffer, false);
if (rel->rd_att->constr)
ExecConstraints("CopyFrom", rel, tuple, estate);
ExecConstraints("CopyFrom", rel, slot, estate);
/* ----------------
* OK, store the tuple and create index entries for it
@ -838,10 +839,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp,
heap_insert(rel, tuple);
if (relationInfo->ri_NumIndices > 0)
{
ExecStoreTuple(tuple, slot, InvalidBuffer, false);
ExecInsertIndexTuples(slot, &(tuple->t_self), estate, false);
}
/* AFTER ROW INSERT Triggers */
if (rel->trigdesc &&