Skip to content

Commit e7edc49

Browse files
authored
Quick adjusting for Postgres 15devel compatibility. (#838)
1 parent ec055df commit e7edc49

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/monitor/replication_state.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,15 @@ static bool IsReplicationStateName(char *name, ReplicationState replicationState
3939
Oid
4040
ReplicationStateTypeOid(void)
4141
{
42+
/* new String type in version 15devel */
43+
#if (PG_VERSION_NUM >= 150000)
44+
String *schemaName = makeString(AUTO_FAILOVER_SCHEMA_NAME);
45+
String *typeName = makeString(REPLICATION_STATE_TYPE_NAME);
46+
#else
4247
Value *schemaName = makeString(AUTO_FAILOVER_SCHEMA_NAME);
4348
Value *typeName = makeString(REPLICATION_STATE_TYPE_NAME);
49+
#endif
50+
4451
List *enumTypeNameList = list_make2(schemaName, typeName);
4552
TypeName *enumTypeName = makeTypeNameFromNameList(enumTypeNameList);
4653
Oid enumTypeOid = typenameTypeId(NULL, enumTypeName);

src/monitor/version_compat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#include "postgres.h"
1616

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

0 commit comments

Comments
 (0)