bool isGreenplumDbHashable(Oid typid) { /* we can hash all arrays */ if (typeIsArrayType(typid)) return true; /* * if this type is a domain type, get its base type. */ if (get_typtype(typid) == 'd') typid = getBaseType(typid); switch(typid) { case INT2OID: case INT4OID: case INT8OID: case FLOAT4OID: case FLOAT8OID: case NUMERICOID: case CHAROID: case BPCHAROID: case TEXTOID: case VARCHAROID: case BYTEAOID: case NAMEOID: case OIDOID: case TIDOID: case REGPROCOID: case REGPROCEDUREOID: case REGOPEROID: case REGOPERATOROID: case REGCLASSOID: case REGTYPEOID: case TIMESTAMPOID: case TIMESTAMPTZOID: case DATEOID: case TIMEOID: case TIMETZOID: case INTERVALOID: case ABSTIMEOID: case RELTIMEOID: case TINTERVALOID: case INETOID: case CIDROID: case MACADDROID: case BITOID: case VARBITOID: case BOOLOID: case ACLITEMOID: case ANYARRAYOID: case INT2VECTOROID: case OIDVECTOROID: case CASHOID: return true; default: return false; } }
bool isGreenplumDbHashable(Oid typid) { /* we can hash all arrays */ if (typeIsArrayType(typid)) return true; /* if this type is a domain type, get its base type */ if (get_typtype(typid) == 'd') typid = getBaseType(typid); /* we can hash all enums */ if (typeIsEnumType(typid)) return true; /* * NB: Every GPDB-hashable datatype must also be mergejoinable, i.e. * must have a B-tree operator family. There is a sanity check for * that in the opr_sanity_gp regression test. If you modify the list * below, please also update the list in opr_sanity_gp! */ switch(typid) { case INT2OID: case INT4OID: case INT8OID: case FLOAT4OID: case FLOAT8OID: case NUMERICOID: case CHAROID: case BPCHAROID: case TEXTOID: case VARCHAROID: case BYTEAOID: case NAMEOID: case OIDOID: case TIDOID: case REGPROCOID: case REGPROCEDUREOID: case REGOPEROID: case REGOPERATOROID: case REGCLASSOID: case REGTYPEOID: case TIMESTAMPOID: case TIMESTAMPTZOID: case DATEOID: case TIMEOID: case TIMETZOID: case INTERVALOID: case ABSTIMEOID: case RELTIMEOID: case TINTERVALOID: case INETOID: case CIDROID: case MACADDROID: case BITOID: case VARBITOID: case BOOLOID: case ANYARRAYOID: case OIDVECTOROID: case CASHOID: case UUIDOID: case COMPLEXOID: return true; default: return false; } }