Columnar temp tables cannot be accessed(#8235).

Fix PR comments.
pull/8309/head
Maksim Melnikov 2025-11-06 17:14:56 +03:00
parent 2863088836
commit cbf097ffd0
3 changed files with 12 additions and 7 deletions

View File

@ -1323,9 +1323,9 @@ GetHighestUsedAddress(Relation rel)
* In case if relid hasn't been defined yet, we should use RelidByRelfilenumber * In case if relid hasn't been defined yet, we should use RelidByRelfilenumber
* to get correct relid value. * to get correct relid value.
* *
* Now it is basically used for temp rels, because since PG13 RelidByRelfilenumber * Now it is basically used for temp rels, because since PG18(it was backpatched
* skip temp relations and we should use alternative ways to get relid value in case * through PG13) RelidByRelfilenumber skip temp relations and we should use
* of temp objects. * alternative ways to get relid value in case of temp objects.
*/ */
Oid Oid
ColumnarRelationId(Oid relid, RelFileLocator relfilelocator) ColumnarRelationId(Oid relid, RelFileLocator relfilelocator)

View File

@ -47,7 +47,12 @@ struct ColumnarWriteState
TupleDesc tupleDescriptor; TupleDesc tupleDescriptor;
FmgrInfo **comparisonFunctionArray; FmgrInfo **comparisonFunctionArray;
RelFileLocator relfilelocator; RelFileLocator relfilelocator;
Oid temp_relid; /* We can't rely on RelidByRelfilenumber for temp tables since PG18.*/
/*
* We can't rely on RelidByRelfilenumber for temp tables since
* PG18(it was backpatched through PG13).
*/
Oid temp_relid;
MemoryContext stripeWriteContext; MemoryContext stripeWriteContext;
MemoryContext perTupleContext; MemoryContext perTupleContext;

View File

@ -65,9 +65,9 @@
#define CITUS_COLUMNAR_INTERNAL_VERSION "11.1-0" #define CITUS_COLUMNAR_INTERNAL_VERSION "11.1-0"
/* /*
* We can't rely on RelidByRelfilenumber for temp tables since PG13, so we can use * We can't rely on RelidByRelfilenumber for temp tables since PG18(it was backpatched
* this macro to define relid within relation in case of temp relations. Otherwise * through PG13), so we can use this macro to define relid within relation in case of
* RelidByRelfilenumber should be used. * temp relations. Otherwise RelidByRelfilenumber should be used.
*/ */
#define RelationPrecomputeOid(a) (RelationUsesLocalBuffers(a) ? RelationGetRelid(a) : \ #define RelationPrecomputeOid(a) (RelationUsesLocalBuffers(a) ? RelationGetRelid(a) : \
InvalidOid) InvalidOid)