Support compilation and run tests on latest PG versions (#6711)

Postgres got minor updates this starts using the images with the latest
version for our tests.

These new Postgres versions caused a compilation issue in PG14 and PG13
due to some function being backported that we had already backported
ourselves. Due this backport being a static inline function it doesn't
matter who provides this and there will be no linkage errors when either
running old Citus packages on new PG versions or the other way around.
pull/6693/head
Jelte Fennema 2023-02-10 16:02:03 +01:00 committed by GitHub
parent dd51938f20
commit 3200187757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View File

@ -6,19 +6,19 @@ orbs:
parameters: parameters:
image_suffix: image_suffix:
type: string type: string
default: '-v9a494cd' default: '-vc4b1573'
pg13_version: pg13_version:
type: string type: string
default: '13.9' default: '13.10'
pg14_version: pg14_version:
type: string type: string
default: '14.6' default: '14.7'
pg15_version: pg15_version:
type: string type: string
default: '15.1' default: '15.2'
upgrade_pg_versions: upgrade_pg_versions:
type: string type: string
default: '13.9-14.6-15.1' default: '13.10-14.7-15.2'
style_checker_tools_version: style_checker_tools_version:
type: string type: string
default: '0.8.18' default: '0.8.18'

View File

@ -55,6 +55,14 @@ pg_strtoint64(char *s)
} }
/*
* RelationGetSmgr got backported in 13.10 and 14.7 so redefining it for any
* version higher causes compilation errors due to redefining of the function.
* We want to use it in all versions. So we backport it ourselves in earlier
* versions, and rely on the Postgres provided version in the later versions.
*/
#if PG_VERSION_NUM >= PG_VERSION_13 && PG_VERSION_NUM < 130010 \
|| PG_VERSION_NUM >= PG_VERSION_14 && PG_VERSION_NUM < 140007
static inline SMgrRelation static inline SMgrRelation
RelationGetSmgr(Relation rel) RelationGetSmgr(Relation rel)
{ {
@ -66,6 +74,9 @@ RelationGetSmgr(Relation rel)
} }
#endif
#define CREATE_SEQUENCE_COMMAND \ #define CREATE_SEQUENCE_COMMAND \
"CREATE SEQUENCE IF NOT EXISTS %s AS %s INCREMENT BY " INT64_FORMAT \ "CREATE SEQUENCE IF NOT EXISTS %s AS %s INCREMENT BY " INT64_FORMAT \
" MINVALUE " INT64_FORMAT " MAXVALUE " INT64_FORMAT \ " MINVALUE " INT64_FORMAT " MAXVALUE " INT64_FORMAT \