Skip to content

Commit

Permalink
Quick adjusting for Postgres 15devel compatibility. (#838)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimCitus committed Nov 26, 2021
1 parent ec055df commit e7edc49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/monitor/replication_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ static bool IsReplicationStateName(char *name, ReplicationState replicationState
Oid
ReplicationStateTypeOid(void)
{
/* new String type in version 15devel */
#if (PG_VERSION_NUM >= 150000)
String *schemaName = makeString(AUTO_FAILOVER_SCHEMA_NAME);
String *typeName = makeString(REPLICATION_STATE_TYPE_NAME);
#else
Value *schemaName = makeString(AUTO_FAILOVER_SCHEMA_NAME);
Value *typeName = makeString(REPLICATION_STATE_TYPE_NAME);
#endif

List *enumTypeNameList = list_make2(schemaName, typeName);
TypeName *enumTypeName = makeTypeNameFromNameList(enumTypeNameList);
Oid enumTypeOid = typenameTypeId(NULL, enumTypeName);
Expand Down
4 changes: 2 additions & 2 deletions src/monitor/version_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "postgres.h"

/* we support Postgres versions 10, 11, 12, 13, and 14. */
#if (PG_VERSION_NUM < 100000 || PG_VERSION_NUM >= 150000)
/* we support Postgres versions 10, 11, 12, 13, and 14. And 15devel. */
#if (PG_VERSION_NUM < 100000 || PG_VERSION_NUM >= 160000)
#error "Unknown or unsupported postgresql version"
#endif

Expand Down

0 comments on commit e7edc49

Please sign in to comment.