diff --git a/src/backend/distributed/commands/create_distributed_table.c b/src/backend/distributed/commands/create_distributed_table.c index 8be8f96d0..7c229cc55 100644 --- a/src/backend/distributed/commands/create_distributed_table.c +++ b/src/backend/distributed/commands/create_distributed_table.c @@ -636,7 +636,8 @@ EnsureRelationCanBeDistributed(Oid relationId, Var *distributionColumn, if (distributionMethod == DISTRIBUTE_BY_HASH) { Oid hashSupportFunction = SupportFunctionForColumn(distributionColumn, - HASH_AM_OID, HASHPROC); + HASH_AM_OID, + HASHSTANDARD_PROC); if (hashSupportFunction == InvalidOid) { ereport(ERROR, (errcode(ERRCODE_UNDEFINED_FUNCTION), diff --git a/src/backend/distributed/worker/worker_partition_protocol.c b/src/backend/distributed/worker/worker_partition_protocol.c index fe859d874..38d3b2ac1 100644 --- a/src/backend/distributed/worker/worker_partition_protocol.c +++ b/src/backend/distributed/worker/worker_partition_protocol.c @@ -35,6 +35,7 @@ #include "distributed/resource_lock.h" #include "distributed/transmit.h" #include "distributed/worker_protocol.h" +#include "distributed/version_compat.h" #include "executor/spi.h" #include "mb/pg_wchar.h" #include "storage/lmgr.h" @@ -191,7 +192,7 @@ worker_hash_partition_table(PG_FUNCTION_ARGS) CheckCitusVersion(ERROR); /* use column's type information to get the hashing function */ - hashFunction = GetFunctionInfo(partitionColumnType, HASH_AM_OID, HASHPROC); + hashFunction = GetFunctionInfo(partitionColumnType, HASH_AM_OID, HASHSTANDARD_PROC); /* create hash partition context object */ partitionContext = palloc0(sizeof(HashPartitionContext)); diff --git a/src/include/distributed/version_compat.h b/src/include/distributed/version_compat.h index e939e30ad..e70674553 100644 --- a/src/include/distributed/version_compat.h +++ b/src/include/distributed/version_compat.h @@ -21,4 +21,13 @@ #endif +#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 110000) + +#include "access/hash.h" + +/* PostgreSQL 11 splits hash procs into "standard" and "extended" */ +#define HASHSTANDARD_PROC HASHPROC + +#endif + #endif /* VERSION_COMPAT_H */