in fdw/pxf_filter.c [41:187]
static bool SupportedOperatorTypeScalarArrayOpExpr(Oid type,
PxfFilterDesc *filter,
bool useOr);
static void ScalarConstToStr(Const *constval, StringInfo buf);
static void ListConstToStr(Const *constval, StringInfo buf);
static List *AppendAttrFromVar(Var *var, List *attrs);
static void AddExtraAndExpressionItems(List *expressionItems,
int extraAndOperatorsNum);
static List *GetAttrsFromExpr(Expr *expr, bool *expressionIsSupported);
/*
* All supported operators and their PXF operator codes.
* Note that it is OK to use hardcoded OIDs, since these are all pinned
* down system catalog operators.
* See pg_operator.h
*/
dbop_pxfop_map pxf_supported_opr_op_expr[] =
{
/* int2 */
{Int2EqualOperator /* int2eq */ , PXFOP_EQ},
{95 /* int2lt */ , PXFOP_LT},
{520 /* int2gt */ , PXFOP_GT},
{522 /* int2le */ , PXFOP_LE},
{524 /* int2ge */ , PXFOP_GE},
{519 /* int2ne */ , PXFOP_NE},
/* int4 */
{Int4EqualOperator /* int4eq */ , PXFOP_EQ},
{97 /* int4lt */ , PXFOP_LT},
{521 /* int4gt */ , PXFOP_GT},
{523 /* int4le */ , PXFOP_LE},
{525 /* int4ge */ , PXFOP_GE},
{518 /* int4lt */ , PXFOP_NE},
/* int8 */
{Int8EqualOperator /* int8eq */ , PXFOP_EQ},
{412 /* int8lt */ , PXFOP_LT},
{413 /* int8gt */ , PXFOP_GT},
{414 /* int8le */ , PXFOP_LE},
{415 /* int8ge */ , PXFOP_GE},
{411 /* int8lt */ , PXFOP_NE},
/* text */
{TextEqualOperator /* texteq */ , PXFOP_EQ},
{664 /* text_lt */ , PXFOP_LT},
{666 /* text_gt */ , PXFOP_GT},
{665 /* text_le */ , PXFOP_LE},
{667 /* text_ge */ , PXFOP_GE},
{531 /* textlt */ , PXFOP_NE},
{1209 /* textlike */ , PXFOP_LIKE},
/* int2 to int4 */
{Int24EqualOperator /* int24eq */ , PXFOP_EQ},
{534 /* int24lt */ , PXFOP_LT},
{536 /* int24gt */ , PXFOP_GT},
{540 /* int24le */ , PXFOP_LE},
{542 /* int24ge */ , PXFOP_GE},
{538 /* int24ne */ , PXFOP_NE},
/* int4 to int2 */
{Int42EqualOperator /* int42eq */ , PXFOP_EQ},
{535 /* int42lt */ , PXFOP_LT},
{537 /* int42gt */ , PXFOP_GT},
{541 /* int42le */ , PXFOP_LE},
{543 /* int42ge */ , PXFOP_GE},
{539 /* int42ne */ , PXFOP_NE},
/* int8 to int4 */
{Int84EqualOperator /* int84eq */ , PXFOP_EQ},
{418 /* int84lt */ , PXFOP_LT},
{419 /* int84gt */ , PXFOP_GT},
{420 /* int84le */ , PXFOP_LE},
{430 /* int84ge */ , PXFOP_GE},
{417 /* int84ne */ , PXFOP_NE},
/* int4 to int8 */
{Int48EqualOperator /* int48eq */ , PXFOP_EQ},
{37 /* int48lt */ , PXFOP_LT},
{76 /* int48gt */ , PXFOP_GT},
{80 /* int48le */ , PXFOP_LE},
{82 /* int48ge */ , PXFOP_GE},
{36 /* int48ne */ , PXFOP_NE},
/* int2 to int8 */
{Int28EqualOperator /* int28eq */ , PXFOP_EQ},
{1864 /* int28lt */ , PXFOP_LT},
{1865 /* int28gt */ , PXFOP_GT},
{1866 /* int28le */ , PXFOP_LE},
{1867 /* int28ge */ , PXFOP_GE},
{1863 /* int28ne */ , PXFOP_NE},
/* int8 to int2 */
{Int82EqualOperator /* int82eq */ , PXFOP_EQ},
{1870 /* int82lt */ , PXFOP_LT},
{1871 /* int82gt */ , PXFOP_GT},
{1872 /* int82le */ , PXFOP_LE},
{1873 /* int82ge */ , PXFOP_GE},
{1869 /* int82ne */ , PXFOP_NE},
/* date */
{DateEqualOperator /* date_eq */ , PXFOP_EQ},
{1095 /* date_lt */ , PXFOP_LT},
{1097 /* date_gt */ , PXFOP_GT},
{1096 /* date_le */ , PXFOP_LE},
{1098 /* date_ge */ , PXFOP_GE},
{1094 /* date_ne */ , PXFOP_NE},
/* timestamp */
{TimestampEqualOperator /* timestamp_eq */ , PXFOP_EQ},
{2062 /* timestamp_lt */ , PXFOP_LT},
{2064 /* timestamp_gt */ , PXFOP_GT},
{2063 /* timestamp_le */ , PXFOP_LE},
{2065 /* timestamp_ge */ , PXFOP_GE},
{2061 /* timestamp_ne */ , PXFOP_NE},
/* float8 */
{Float8EqualOperator /* float8eq */ , PXFOP_EQ},
{672 /* float8lt */ , PXFOP_LT},
{674 /* float8gt */ , PXFOP_GT},
{673 /* float8le */ , PXFOP_LE},
{675 /* float8ge */ , PXFOP_GE},
{671 /* float8ne */ , PXFOP_NE},
/* float48 */
{1120 /* float48eq */ , PXFOP_EQ},
{1122 /* float48lt */ , PXFOP_LT},
{1123 /* float48gt */ , PXFOP_GT},
{1124 /* float48le */ , PXFOP_LE},
{1125 /* float48ge */ , PXFOP_GE},
{1121 /* float48ne */ , PXFOP_NE},
/* boolean */
{BooleanEqualOperator /* booleq */ , PXFOP_EQ},
{58 /* boollt */ , PXFOP_LT},
{59 /* boolgt */ , PXFOP_GT},
{1694 /* boolle */ , PXFOP_LE},
{1695 /* boolge */ , PXFOP_GE},
{85 /* boolne */ , PXFOP_NE},
/* bpchar */
{BPCharEqualOperator /* bpchareq */ , PXFOP_EQ},
{1058 /* bpcharlt */ , PXFOP_LT},
{1060 /* bpchargt */ , PXFOP_GT},
{1059 /* bpcharle */ , PXFOP_LE},
{1061 /* bpcharge */ , PXFOP_GE},
{1057 /* bpcharne */ , PXFOP_NE},
};