Skip to content

Commit 97f91e7

Browse files
author
Antonin Houska
committed
Allow the new table to have different data types from the source one.
1 parent d098f72 commit 97f91e7

3 files changed

Lines changed: 486 additions & 315 deletions

File tree

concurrent.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void apply_concurrent_changes(EState *estate, ModifyTableState *mtstate,
2828
Relation ident_index,
2929
TupleTableSlot *ind_slot,
3030
partitions_hash *partitions,
31-
TupleConversionMap *conv_map);
31+
TupleConversionMapExt *conv_map);
3232
static void find_tuple_in_partition(HeapTuple tup, Relation partition,
3333
partitions_hash *partitions,
3434
ScanKey key, int nkeys, ItemPointer ctid);
@@ -74,7 +74,7 @@ pg_rewrite_process_concurrent_changes(EState *estate,
7474
TupleTableSlot *ind_slot,
7575
LOCKMODE lock_held,
7676
partitions_hash *partitions,
77-
TupleConversionMap *conv_map,
77+
TupleConversionMapExt *conv_map,
7878
struct timeval *must_complete)
7979
{
8080
DecodingOutputState *dstate;
@@ -211,7 +211,7 @@ apply_concurrent_changes(EState *estate, ModifyTableState *mtstate,
211211
Relation ident_index,
212212
TupleTableSlot *ind_slot,
213213
partitions_hash *partitions,
214-
TupleConversionMap *conv_map)
214+
TupleConversionMapExt *conv_map)
215215
{
216216
TupleTableSlot *slot;
217217
BulkInsertState bistate_nonpart = NULL;
@@ -224,7 +224,9 @@ apply_concurrent_changes(EState *estate, ModifyTableState *mtstate,
224224
if (proute == NULL)
225225
bistate_nonpart = GetBulkInsertState();
226226

227-
/* TupleTableSlot is needed to pass the tuple to ExecInsertIndexTuples(). */
227+
/*
228+
* TupleTableSlot is needed to pass the tuple to ExecInsertIndexTuples().
229+
*/
228230
slot = MakeSingleTupleTableSlot(dstate->tupdesc, &TTSOpsHeapTuple);
229231

230232
/*
@@ -620,11 +622,11 @@ processing_time_elapsed(struct timeval *utmost)
620622
*/
621623
HeapTuple
622624
convert_tuple_for_dest_table(HeapTuple tuple,
623-
TupleConversionMap *conv_map)
625+
TupleConversionMapExt *conv_map)
624626
{
625627
HeapTuple orig = tuple;
626628

627-
tuple = execute_attr_map_tuple(tuple, conv_map);
629+
tuple = pg_rewrite_execute_attr_map_tuple(tuple, conv_map);
628630
pfree(orig);
629631

630632
return tuple;

0 commit comments

Comments
 (0)