5983a4c - Introduce CompactAttribute array in TupleDesc

m3hm3t/pg18_support
Mehmet Yilmaz 2025-05-09 12:31:19 +00:00
parent dfe5ae1e7a
commit 7e553fe7db
2 changed files with 19 additions and 6 deletions

View File

@ -645,10 +645,10 @@ SaveStripeSkipList(RelFileLocator relfilelocator, uint64 stripe,
{ {
values[Anum_columnar_chunk_minimum_value - 1] = values[Anum_columnar_chunk_minimum_value - 1] =
PointerGetDatum(DatumToBytea(chunk->minimumValue, PointerGetDatum(DatumToBytea(chunk->minimumValue,
&tupleDescriptor->attrs[columnIndex])); Attr(tupleDescriptor, columnIndex)));
values[Anum_columnar_chunk_maximum_value - 1] = values[Anum_columnar_chunk_maximum_value - 1] =
PointerGetDatum(DatumToBytea(chunk->maximumValue, PointerGetDatum(DatumToBytea(chunk->maximumValue,
&tupleDescriptor->attrs[columnIndex])); Attr(tupleDescriptor, columnIndex)));
} }
else else
{ {
@ -803,9 +803,9 @@ ReadStripeSkipList(RelFileLocator relfilelocator, uint64 stripe,
datumArray[Anum_columnar_chunk_maximum_value - 1]); datumArray[Anum_columnar_chunk_maximum_value - 1]);
chunk->minimumValue = chunk->minimumValue =
ByteaToDatum(minValue, &tupleDescriptor->attrs[columnIndex]); ByteaToDatum(minValue, Attr(tupleDescriptor, columnIndex));
chunk->maximumValue = chunk->maximumValue =
ByteaToDatum(maxValue, &tupleDescriptor->attrs[columnIndex]); ByteaToDatum(maxValue, Attr(tupleDescriptor, columnIndex));
chunk->hasMinMax = true; chunk->hasMinMax = true;
} }

View File

@ -9,14 +9,27 @@
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#ifndef COLUMNAR_COMPAT_H #ifndef COLUMNAR_VERSION_COMPAT_H
#define COLUMNAR_COMPAT_H #define COLUMNAR_VERSION_COMPAT_H
#include "pg_version_constants.h" #include "pg_version_constants.h"
/* for PG_VERSION_NUM and TupleDescAttr() */
#include "postgres.h"
#include "access/htup_details.h"
#define ACLCHECK_OBJECT_TABLE OBJECT_TABLE #define ACLCHECK_OBJECT_TABLE OBJECT_TABLE
#define ExplainPropertyLong(qlabel, value, es) \ #define ExplainPropertyLong(qlabel, value, es) \
ExplainPropertyInteger(qlabel, NULL, value, es) ExplainPropertyInteger(qlabel, NULL, value, es)
/* tuple-descriptor attributes moved in PostgreSQL 18: */
#if PG_VERSION_NUM >= 180000
# define Attr(tupdesc, colno) TupleDescAttr((tupdesc), (colno))
#else
# define Attr(tupdesc, colno) ((tupdesc)->attrs[(colno)])
#endif
#endif /* COLUMNAR_COMPAT_H */ #endif /* COLUMNAR_COMPAT_H */