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

Fix memory leak created by deferrable-index-constraints patches.

We need to free the OID list returned by ExecInsertIndexTuples to avoid
a query-lifespan memory leak.  When many rows require rechecking, this
can be a significant leak --- it's even more than the space used for the
queued trigger events.

Dean Rasheed
This commit is contained in:
Tom Lane
2010-01-31 18:15:39 +00:00
parent f13944e9c9
commit 034fffbf31
2 changed files with 8 additions and 2 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.321 2010/01/15 09:19:01 heikki Exp $
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.322 2010/01/31 18:15:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2172,6 +2172,8 @@ CopyFrom(CopyState cstate)
ExecARInsertTriggers(estate, resultRelInfo, tuple,
recheckIndexes);
list_free(recheckIndexes);
/*
* We count only tuples not suppressed by a BEFORE INSERT trigger;
* this is the same definition used by execMain.c for counting