We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent6e155ce commitc16f746Copy full SHA for c16f746
src/partition_filter.c
@@ -929,7 +929,19 @@ partition_filter_exec(CustomScanState *node)
929
if (rri_holder->tuple_map||
930
(!junkfilter&&
931
(state->command_type==CMD_INSERT||state->command_type==CMD_UPDATE)&&
932
- (slot->tts_tupleDescriptor->natts>rri->ri_RelationDesc->rd_att->natts/* extra fields */)))
+ (slot->tts_tupleDescriptor->natts>rri->ri_RelationDesc->rd_att->natts/* extra fields */
933
+#ifPG_VERSION_NUM<120000
934
+/*
935
+ * If we have a regular physical tuple 'slot->tts_tuple' and
936
+ * it's locally palloc'd => we will use this tuple in
937
+ * ExecMaterializeSlot() instead of materialize the slot, so
938
+ * need to check number of attributes for this tuple:
939
+ */
940
+|| (slot->tts_tuple&&slot->tts_shouldFree&&
941
+HeapTupleHeaderGetNatts(slot->tts_tuple->t_data)>
942
+rri->ri_RelationDesc->rd_att->natts/* extra fields */)
943
+#endif
944
+ )))
945
{
946
#ifPG_VERSION_NUM<120000
947
HeapTuplehtup_old,