mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Revert: Let table AM insertion methods control index insertion
This commit reverts b1484a3f19
per review by Andres Freund.
Discussion: https://postgr.es/m/20240410165236.rwyrny7ihi4ddxw4%40awork3.anarazel.de
This commit is contained in:
@@ -509,7 +509,6 @@ ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
|
||||
if (!skip_tuple)
|
||||
{
|
||||
List *recheckIndexes = NIL;
|
||||
bool insertIndexes;
|
||||
|
||||
/* Compute stored generated columns */
|
||||
if (rel->rd_att->constr &&
|
||||
@@ -524,10 +523,9 @@ ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
|
||||
ExecPartitionCheck(resultRelInfo, slot, estate, true);
|
||||
|
||||
/* OK, store the tuple and create index entries for it */
|
||||
simple_table_tuple_insert(resultRelInfo->ri_RelationDesc, slot,
|
||||
&insertIndexes);
|
||||
simple_table_tuple_insert(resultRelInfo->ri_RelationDesc, slot);
|
||||
|
||||
if (insertIndexes && resultRelInfo->ri_NumIndices > 0)
|
||||
if (resultRelInfo->ri_NumIndices > 0)
|
||||
recheckIndexes = ExecInsertIndexTuples(resultRelInfo,
|
||||
slot, estate, false, false,
|
||||
NULL, NIL, false);
|
||||
|
@@ -1135,15 +1135,13 @@ ExecInsert(ModifyTableContext *context,
|
||||
}
|
||||
else
|
||||
{
|
||||
bool insertIndexes;
|
||||
|
||||
/* insert the tuple normally */
|
||||
slot = table_tuple_insert(resultRelationDesc, slot,
|
||||
estate->es_output_cid,
|
||||
0, NULL, &insertIndexes);
|
||||
0, NULL);
|
||||
|
||||
/* insert index entries for tuple */
|
||||
if (insertIndexes && resultRelInfo->ri_NumIndices > 0)
|
||||
if (resultRelInfo->ri_NumIndices > 0)
|
||||
recheckIndexes = ExecInsertIndexTuples(resultRelInfo,
|
||||
slot, estate, false,
|
||||
false, NULL, NIL,
|
||||
|
Reference in New Issue
Block a user