mirror of https://github.com/citusdata/citus.git
Handle HASHPROC changes
PostgreSQL 11 now has "standard" and "extended" (64-bit) versions of hash functions.pull/1633/head
parent
b4474fc0b0
commit
bbc15e0598
|
@ -636,7 +636,8 @@ EnsureRelationCanBeDistributed(Oid relationId, Var *distributionColumn,
|
||||||
if (distributionMethod == DISTRIBUTE_BY_HASH)
|
if (distributionMethod == DISTRIBUTE_BY_HASH)
|
||||||
{
|
{
|
||||||
Oid hashSupportFunction = SupportFunctionForColumn(distributionColumn,
|
Oid hashSupportFunction = SupportFunctionForColumn(distributionColumn,
|
||||||
HASH_AM_OID, HASHPROC);
|
HASH_AM_OID,
|
||||||
|
HASHSTANDARD_PROC);
|
||||||
if (hashSupportFunction == InvalidOid)
|
if (hashSupportFunction == InvalidOid)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errcode(ERRCODE_UNDEFINED_FUNCTION),
|
ereport(ERROR, (errcode(ERRCODE_UNDEFINED_FUNCTION),
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "distributed/resource_lock.h"
|
#include "distributed/resource_lock.h"
|
||||||
#include "distributed/transmit.h"
|
#include "distributed/transmit.h"
|
||||||
#include "distributed/worker_protocol.h"
|
#include "distributed/worker_protocol.h"
|
||||||
|
#include "distributed/version_compat.h"
|
||||||
#include "executor/spi.h"
|
#include "executor/spi.h"
|
||||||
#include "mb/pg_wchar.h"
|
#include "mb/pg_wchar.h"
|
||||||
#include "storage/lmgr.h"
|
#include "storage/lmgr.h"
|
||||||
|
@ -191,7 +192,7 @@ worker_hash_partition_table(PG_FUNCTION_ARGS)
|
||||||
CheckCitusVersion(ERROR);
|
CheckCitusVersion(ERROR);
|
||||||
|
|
||||||
/* use column's type information to get the hashing function */
|
/* 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 */
|
/* create hash partition context object */
|
||||||
partitionContext = palloc0(sizeof(HashPartitionContext));
|
partitionContext = palloc0(sizeof(HashPartitionContext));
|
||||||
|
|
|
@ -21,4 +21,13 @@
|
||||||
|
|
||||||
#endif
|
#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 */
|
#endif /* VERSION_COMPAT_H */
|
||||||
|
|
Loading…
Reference in New Issue