Skip to content

Commit cbf097f

Browse files
committed
Columnar temp tables cannot be accessed(#8235).
Fix PR comments.
1 parent 2863088 commit cbf097f

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/backend/columnar/columnar_metadata.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,9 +1323,9 @@ GetHighestUsedAddress(Relation rel)
13231323
* In case if relid hasn't been defined yet, we should use RelidByRelfilenumber
13241324
* to get correct relid value.
13251325
*
1326-
* Now it is basically used for temp rels, because since PG13 RelidByRelfilenumber
1327-
* skip temp relations and we should use alternative ways to get relid value in case
1328-
* of temp objects.
1326+
* Now it is basically used for temp rels, because since PG18(it was backpatched
1327+
* through PG13) RelidByRelfilenumber skip temp relations and we should use
1328+
* alternative ways to get relid value in case of temp objects.
13291329
*/
13301330
Oid
13311331
ColumnarRelationId(Oid relid, RelFileLocator relfilelocator)

src/backend/columnar/columnar_writer.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ struct ColumnarWriteState
4747
TupleDesc tupleDescriptor;
4848
FmgrInfo **comparisonFunctionArray;
4949
RelFileLocator relfilelocator;
50-
Oid temp_relid; /* We can't rely on RelidByRelfilenumber for temp tables since PG18.*/
50+
51+
/*
52+
* We can't rely on RelidByRelfilenumber for temp tables since
53+
* PG18(it was backpatched through PG13).
54+
*/
55+
Oid temp_relid;
5156

5257
MemoryContext stripeWriteContext;
5358
MemoryContext perTupleContext;

src/include/columnar/columnar.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
#define CITUS_COLUMNAR_INTERNAL_VERSION "11.1-0"
6666

6767
/*
68-
* We can't rely on RelidByRelfilenumber for temp tables since PG13, so we can use
69-
* this macro to define relid within relation in case of temp relations. Otherwise
70-
* RelidByRelfilenumber should be used.
68+
* We can't rely on RelidByRelfilenumber for temp tables since PG18(it was backpatched
69+
* through PG13), so we can use this macro to define relid within relation in case of
70+
* temp relations. Otherwise RelidByRelfilenumber should be used.
7171
*/
7272
#define RelationPrecomputeOid(a) (RelationUsesLocalBuffers(a) ? RelationGetRelid(a) : \
7373
InvalidOid)

0 commit comments

Comments
 (0)