Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 267267f

Browse filesBrowse files
author
Arseny Kositsyn
committed
[PGPRO-12159] Fixed test crashes on version 14 of PostgreSQL.
The crashes were due to the fact that the errdetail_relkind_not_supported() function is not defined on versions below 15. Tags: rum
1 parent e8789f1 commit 267267f
Copy full SHA for 267267f

File tree

Expand file treeCollapse file tree

1 file changed

+29
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+29
-0
lines changed

‎src/rum_debug_funcs.c

Copy file name to clipboardExpand all lines: src/rum_debug_funcs.c
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,12 +1575,41 @@ get_rel_from_name(text *relname)
15751575
relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname));
15761576
rel = relation_openrv(relrv, AccessShareLock);
15771577

1578+
#if PG_VERSION_NUM >= 150000
15781579
if (!RELKIND_HAS_STORAGE(rel->rd_rel->relkind))
15791580
ereport(ERROR,
15801581
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
15811582
errmsg("cannot get raw page from relation \"%s\"",
15821583
RelationGetRelationName(rel)),
15831584
errdetail_relkind_not_supported(rel->rd_rel->relkind)));
1585+
#else
1586+
/* Check that this relation has storage */
1587+
if (rel->rd_rel->relkind == RELKIND_VIEW)
1588+
ereport(ERROR,
1589+
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
1590+
errmsg("cannot get raw page from view \"%s\"",
1591+
RelationGetRelationName(rel))));
1592+
if (rel->rd_rel->relkind == RELKIND_COMPOSITE_TYPE)
1593+
ereport(ERROR,
1594+
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
1595+
errmsg("cannot get raw page from composite type \"%s\"",
1596+
RelationGetRelationName(rel))));
1597+
if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
1598+
ereport(ERROR,
1599+
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
1600+
errmsg("cannot get raw page from foreign table \"%s\"",
1601+
RelationGetRelationName(rel))));
1602+
if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
1603+
ereport(ERROR,
1604+
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
1605+
errmsg("cannot get raw page from partitioned table \"%s\"",
1606+
RelationGetRelationName(rel))));
1607+
if (rel->rd_rel->relkind == RELKIND_PARTITIONED_INDEX)
1608+
ereport(ERROR,
1609+
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
1610+
errmsg("cannot get raw page from partitioned index \"%s\"",
1611+
RelationGetRelationName(rel))));
1612+
#endif
15841613

15851614
/*
15861615
* Reject attempts to read non-local temporary relations; we would be

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.