Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use version checks to decide about RelationGetSmgr backporting #5416

Merged
merged 1 commit into from Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 0 additions & 12 deletions CMakeLists.txt
Expand Up @@ -504,18 +504,6 @@ if(NOT EXISTS ${PG_INCLUDEDIR}/pg_config.h)
)
endif()

# This is currently only available in snapshot branches so we cannot use the
# normal pg version check to determine availability.
if(EXISTS ${PG_INCLUDEDIR_SERVER}/utils/rel.h)
file(READ ${PG_INCLUDEDIR_SERVER}/utils/rel.h PG_UTILS_REL_H)
string(REGEX MATCH "RelationGetSmgr" PG_HAVE_RELATION_GET_SMGR
${PG_UTILS_REL_H})
endif()

if(PG_HAVE_RELATION_GET_SMGR)
add_compile_definitions(PG_HAVE_RELATION_GET_SMGR=1)
endif()

file(READ ${PG_INCLUDEDIR}/pg_config.h PG_CONFIG_H)
string(REGEX MATCH "#define USE_ASSERT_CHECKING 1" PG_USE_ASSERT_CHECKING
${PG_CONFIG_H})
Expand Down
5 changes: 2 additions & 3 deletions src/compat/compat.h
Expand Up @@ -759,8 +759,8 @@ pg_strtoint64(const char *str)
is_crosspart_update)
#endif

#if PG13_GE
#ifndef PG_HAVE_RELATION_GET_SMGR
#if (PG12 && PG_VERSION_NUM < 120014) || (PG13 && PG_VERSION_NUM < 130010) || \
(PG14 && PG_VERSION_NUM < 140007)
#include <storage/smgr.h>
/*
* RelationGetSmgr
Expand All @@ -787,6 +787,5 @@ RelationGetSmgr(Relation rel)
return rel->rd_smgr;
}
#endif
#endif

#endif /* TIMESCALEDB_COMPAT_H */