diff --git a/Makefile b/Makefile index ea6fe9b..4329a94 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ ########################################################################## MODULE_big = odbc_fdw -OBJS = odbc_fdw.o +OBJS = odbc_fdw.o deparse.o EXTENSION = odbc_fdw DATA = odbc_fdw--0.5.2.sql \ @@ -26,7 +26,7 @@ DATA = odbc_fdw--0.5.2.sql \ odbc_fdw--0.5.0--0.5.1.sql \ odbc_fdw--0.5.1--0.5.2.sql -REGRESS = postgresql/char postgresql/date postgresql/delete postgresql/float4 postgresql/float8 postgresql/insert postgresql/int4 postgresql/int8 postgresql/select postgresql/timestamp postgresql/update postgresql/ported_postgres_fdw +REGRESS = postgresql/new_test postgresql/char postgresql/date postgresql/delete postgresql/float4 postgresql/float8 postgresql/insert postgresql/int4 postgresql/int8 postgresql/select postgresql/timestamp postgresql/update postgresql/ported_postgres_fdw mysql/new_test mysql/char mysql/date mysql/delete mysql/float4 mysql/float8 mysql/insert mysql/int4 mysql/int8 mysql/select mysql/timestamp mysql/update mysql/ported_postgres_fdw SHLIB_LINK = -lodbc diff --git a/README.md b/README.md index fd2796f..8136720 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,61 @@ make sudo make install ``` +Feature +------- +#### Write-able FDW +The existing odbc FDWs are only read-only, this version provides the write capability. +The user can now issue an insert, update, and delete statement for the foreign tables using the odbc_fdw. + +#### WHERE clause push-down +The odbc_fdw will push-down the foreign table where clause to the foreign server. +The where condition on the foreign table will be executed on the foreign server, +hence there will be fewer rows to bring across to PostgreSQL. +This is a performance feature. + +#### Column push-down +The existing odbc FDWs are fetching all the columns from the target foreign table. +The latest version does the column push-down and only brings back the columns +that are part of the select target list. +This is a performance feature. + +#### Aggregate function push-down +List of aggregate functions push-down: +``` + avg, bit_and, bit_or, count, max, min, stddev_pop, stddev_samp, sum, var_pop, var_samp, + sum(DISTINCT), avg(DISTINCT), max(DISTINCT), min(DISTINCT), count(DISTINCT) +``` + +#### Function push-down +The function can be push-down in WHERE clauses. +List of builtin functions of PostgreSQL can be pushed-down: + - Flow Control Functions: + ``` + nullif + ``` + - Numeric functions: + ``` + abs, acos, asin, atan, atan2, ceil, ceiling, cos, cot, degrees, div, exp, floor, ln, log, log10, mod, + pow, power, radians, round, sign, sin, sqrt, tan, + ``` + - String functions: + ``` + ascii, bit_length, char_length, character_length, concat, concat_ws, left, length, lower, lpad, + octet_length, repeat, replace, reverse, right, rpad, position, regexp_replace, substr, substring, + upper, + ``` + - For `bit_length`: postgre's core will optimize `bit_length(str)` to `octet_length(str) * 8` and push it down to remote server. + - Date and Time functions + ``` + date + ``` + - Explicit cast functions: + | Postgres explicit cast | ODBC coressponding syntax | + |----------|:-------------| + |col::float4|CAST(col AS real)| + |col::date|CAST(col AS date)| + |col::time|CAST(col AS time)| + Usage ----- @@ -201,33 +256,68 @@ LIMITATIONS PostgreSQL ([NAMEDATALEN](https://www.postgresql.org/docs/9.5/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)) * Only the following column types are currently fully suported: -type | select | insert/update/delete ------------------|--------|------- -SQL_CHAR | x | - -SQL_WCHAR | x | - -SQL_VARCHAR | x | x -SQL_WVARCHAR | x | - -SQL_LONGVARCHAR | x | - -SQL_WLONGVARCHAR | x | - -SQL_DECIMAL | x | - -SQL_NUMERIC | x | x -SQL_INTEGER | x | x -SQL_REAL | x | - -SQL_FLOAT | x | - -SQL_DOUBLE | x | x -SQL_SMALLINT | x | x -SQL_TINYINT | x | - -SQL_BIGINT | x | x -SQL_DATE | x | x -SQL_TYPE_TIME | x | - -SQL_TIME | x | x -SQL_TIMESTAMP | x | x -SQL_GUID | x | - + type | select | insert/update/delete + -----------------|--------|------- + SQL_CHAR | x | - + SQL_WCHAR | x | - + SQL_VARCHAR | x | x + SQL_WVARCHAR | x | - + SQL_LONGVARCHAR | x | - + SQL_WLONGVARCHAR | x | - + SQL_DECIMAL | x | - + SQL_NUMERIC | x | x + SQL_INTEGER | x | x + SQL_REAL | x | - + SQL_FLOAT | x | - + SQL_DOUBLE | x | x + SQL_SMALLINT | x | x + SQL_TINYINT | x | - + SQL_BIGINT | x | x + SQL_DATE | x | x + SQL_TYPE_TIME | x | - + SQL_TIME | x | x + SQL_TIMESTAMP | x | x + SQL_GUID | x | - * Foreign encodings are supported with the `encoding` option for any enconding supported by PostgreSQL and compatible with the local database. The encoding must be identified with the name used by [PostgreSQL](https://www.postgresql.org/docs/9.5/static/multibyte.html). +* Concatenation Operator +The `||` operator as a concatenation operator is standard SQL, however in MySQL, it represents the OR operator (logical operator) +If the PIPES_AS_CONCAT SQL mode is enabled, || signifies the SQL-standard string concatenation operator (like CONCAT()). +User needs to enable PIPES_AS_CONCAT mode in MySQL for concatenation. + +* Floating-point value comparison +Floating-point numbers are approximate and not stored as exact values. A floating-point value as written in an SQL statement may not be the same as the value represented internally. + + For example: + + ``` + SELECT float4.f1 FROM FLOAT4_TBL tbl06 WHERE float4.f1 <> '1004.3'; + f1 + ------------- + 0 + 1004.3 + -34.84 + 1.23457e+20 + 1.23457e-20 + (5 rows) + ``` + In order to get correct result, can decide on an acceptable tolerance for differences between the numbers and then do the comparison against the tolerance value to that can get the correct result. + ``` + SELECT float4.f1 FROM tbl06 float4 WHERE float4.f1 <> '1004.3' GROUP BY float4.id, float4.f1 HAVING abs(f1 - 1004.3) > 0.001 ORDER BY float4.id; + f1 + ------------- + 0 + -34.84 + 1.23457e+20 + 1.23457e-20 + (4 rows) + ``` + * Functions push-down: + * For `log`: Just push down `log(b, x)`, the `log(x)` does not push-down to remote server because of different functionality in the remote side (Mysql ODBC datasource) + * For `regexp_replace`: Just push-down `regexp_replace(source, pattern, eplacement_string)`, does not push-down the other signature of `regexp_replace` (these signatures is not support by Mysql ODBC datasource) [1]:https://github.com/CartoDB/odbc_fdw \ No newline at end of file diff --git a/deparse.c b/deparse.c new file mode 100644 index 0000000..8d5452d --- /dev/null +++ b/deparse.c @@ -0,0 +1,2369 @@ +/*------------------------------------------------------------------------- + * + * deparse.c + * Query deparser for odbc_fdw + * + * Portions Copyright (c) 2021, TOSHIBA Corporation + * Portions Copyright (c) 2012-2021, PostgreSQL Global Development Group + * + * IDENTIFICATION + * contrib/odbc_fdw/deparse.c + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "access/htup_details.h" +#include "access/sysattr.h" +#include "access/table.h" +#include "catalog/pg_aggregate.h" +#include "catalog/pg_collation.h" +#include "catalog/pg_namespace.h" +#include "catalog/pg_operator.h" +#include "catalog/pg_proc.h" +#include "catalog/pg_type.h" +#include "commands/defrem.h" +#include "common/keywords.h" +#include "nodes/makefuncs.h" +#include "nodes/nodeFuncs.h" +#include "nodes/plannodes.h" +#include "optimizer/optimizer.h" +#include "optimizer/prep.h" +#include "optimizer/tlist.h" +#include "parser/parsetree.h" +#include "odbc_fdw.h" +#include "utils/builtins.h" +#include "utils/lsyscache.h" +#include "utils/rel.h" +#include "utils/syscache.h" +#include "utils/typcache.h" +#include "commands/tablecmds.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" + +/* + * Global context for odbc_foreign_expr_walker's search of an expression tree. + */ +typedef struct foreign_glob_cxt +{ + PlannerInfo *root; /* global planner state */ + RelOptInfo *foreignrel; /* the foreign relation we are planning for */ + Relids relids; /* relids of base relations in the underlying + * scan */ +} foreign_glob_cxt; + +/* + * Local (per-tree-level) context for odbc_foreign_expr_walker's search. + * This is concerned with identifying collations used in the expression. + */ +typedef enum +{ + FDW_COLLATE_NONE, /* expression is of a noncollatable type, or + * it has default collation that is not + * traceable to a foreign Var */ + FDW_COLLATE_SAFE, /* collation derives from a foreign Var */ + FDW_COLLATE_UNSAFE /* collation is non-default and derives from + * something other than a foreign Var */ +} FDWCollateState; + +typedef struct foreign_loc_cxt +{ + Oid collation; /* OID of current collation, if any */ + FDWCollateState state; /* state of current collation choice */ + bool is_op_args; /* outer is T_OpExpr or not */ + bool is_scalar_array_op_arg; /* outer is T_ScalarArrayOpExpr or not */ +} foreign_loc_cxt; + +/* + * odbcSupportedBuiltinAggFunction + * List of supported builtin aggregate functions for odbc + */ +static const char *odbcSupportedBuiltinAggFunction[] = { + "avg", + "bit_and", + "bit_or", + "count", + "max", + "min", + "stddev_pop", + "stddev_samp", + "sum", + "var_pop", + "var_samp", + NULL}; + +/* + * odbcSupportedBuiltinOperators + * List of supported builtin operator for odbc + */ +static const char *odbcSupportedBuiltinOperators[] = { + /* Comparison operators */ + ">", + "<", + ">=", + "<=", + "=", + "<>", + "!=", + /* Mathematical operators */ + "+", + "-", + "*", + /* "/", Does not support / operator */ + "%", /* MOD */ + /* String operators */ + "||", /* Concatenates */ + /* Pattern matching operators */ + "~~", /* LIKE */ + "!~~", /* NOT LIKE */ + NULL}; + +/* + * OdbcCommonFunctions: + * - List of common function for ODBC driver + * - This list is confirmed with PostgreSQL and MySQL. + */ +static const char *OdbcCommonFunctions[] = { + "nullif", + /* Numeric functions */ + "abs", + "acos", + "asin", + "atan", + "atan2", + "ceil", + "ceiling", + "cos", + "cot", + "degrees", + "div", + "exp", + "floor", + "ln", + "log", + "log10", + "mod", + "pow", + "power", + "radians", + "round", + "sign", + "sin", + "sqrt", + "tan", + /* String functions */ + "ascii", + "bit_length", + "char_length", + "character_length", + "concat", + "concat_ws", + "left", + "length", + "lower", + "lpad", + "octet_length", + "repeat", + "replace", + "reverse", + "right", + "rpad", + "position", + "regexp_replace", + "substr", + "substring", + "upper", + /* Datetime function */ + "date", + NULL}; + +/* + * CastFunctions + * List of PostgreSQL cast functions, these functions can be push down. + */ +static const char *CastFunctions[] = { + "float4", + /* date time cast */ + "date", + "time", + NULL}; + +bool odbc_is_builtin(Oid oid); +static bool odbc_foreign_expr_walker(Node *node, + foreign_glob_cxt *glob_cxt, + foreign_loc_cxt *outer_cxt); + +/* + * Functions to construct string representation of a node tree. + */ +static void odbc_deparse_target_list(StringInfo buf, + RangeTblEntry *rte, + Index rtindex, + Relation rel, + bool is_returning, + Bitmapset *attrs_used, + bool qualify_col, + List **retrieved_attrs, + deparse_expr_cxt *context); +static void odbc_deparse_expr(Expr *expr, deparse_expr_cxt *context); +static void odbc_deparse_var(Var *node, deparse_expr_cxt *context); +static void odbc_deparse_const(Const *node, deparse_expr_cxt *context); +static void odbc_deparse_op_expr(OpExpr *node, deparse_expr_cxt *context); +static void odbc_deparse_nullif_expr(NullIfExpr *node, deparse_expr_cxt *context); +static void odbc_deparse_operator_name(StringInfo buf, Form_pg_operator opform); +static void odbc_deparse_bool_expr(BoolExpr *node, deparse_expr_cxt *context); +static void odbc_deparse_null_test(NullTest *node, deparse_expr_cxt *context); +static void odbc_deparse_boolean_test(BooleanTest *node, deparse_expr_cxt *context); +static void odbc_deparse_aggref(Aggref *node, deparse_expr_cxt *context); +static void odbc_deparse_func_expr(FuncExpr *node, deparse_expr_cxt *context); +static char *odbc_deparse_cast_function(char *function_name, Oid type_oid, int32 typemod); +static void odbc_deparse_select_sql(List *tlist, List **retrieved_attrs, + deparse_expr_cxt *context); +static void odbc_deparse_from_expr_for_rel(StringInfo buf, PlannerInfo *root, + RelOptInfo *foreignrel, bool use_alias, + Index ignore_rel, List **ignore_conds, + List **params_list); +static void odbc_deparse_from_expr(List *quals, deparse_expr_cxt *context); +static void odbc_deparse_string_literal(StringInfo buf, const char *val); +static void odbc_deparse_function_name(Oid funcid, deparse_expr_cxt *context); +static void odbc_deparse_explicit_target_list(List *tlist, + bool is_returning, + List **retrieved_attrs, + deparse_expr_cxt *context); +static void odbc_deparse_scalar_array_op_expr(ScalarArrayOpExpr *node, deparse_expr_cxt *context); +static bool odbc_is_str_exist_in_list(char *str, const char **list); +static void odbc_deconstruct_constant_array(Const *node, bool **elem_nulls, + Datum **elem_values, Oid *elmtype, int *num_elems); +static void odbc_append_constant_value(StringInfo buf, Oid const_type, char *extval); +static void odbc_append_conditions(List *exprs, deparse_expr_cxt *context); +static bool odbc_is_supported_type(Oid type); +static bool odbc_is_supported_builtin_func(Oid funcid, char *in); + +/* + * Returns true if given expr is safe to evaluate on the foreign server. + */ +bool +odbc_is_foreign_expr(PlannerInfo *root, + RelOptInfo *baserel, + Expr *expr) +{ + foreign_glob_cxt glob_cxt; + foreign_loc_cxt loc_cxt; + OdbcFdwRelationInfo *fpinfo = (OdbcFdwRelationInfo *) (baserel->fdw_private); + + /* + * Check that the expression consists of nodes that are safe to execute + * remotely. + */ + glob_cxt.root = root; + glob_cxt.foreignrel = baserel; + + /* + * For an upper relation, use relids from its underneath scan relation, + * because the upperrel's own relids currently aren't set to anything + * meaningful by the core code. For other relation, use their own relids. + */ + if (IS_UPPER_REL(baserel)) + glob_cxt.relids = fpinfo->outerrel->relids; + else + glob_cxt.relids = baserel->relids; + loc_cxt.collation = InvalidOid; + loc_cxt.state = FDW_COLLATE_NONE; + loc_cxt.is_op_args = false; + loc_cxt.is_scalar_array_op_arg = false; + if (!odbc_foreign_expr_walker((Node *) expr, &glob_cxt, &loc_cxt)) + return false; + + /* + * If the expression has a valid collation that does not arise from a + * foreign var, the expression can not be sent over. + */ + if (loc_cxt.state == FDW_COLLATE_UNSAFE) + return false; + + /* OK to evaluate on the remote server */ + return true; +} + + +/* + * Check if expression is safe to execute remotely, and return true if so. + * + * In addition, *outer_cxt is updated with collation information. + * + * We must check that the expression contains only node types we can deparse, + * that all types/functions/operators are safe to send (they are "shippable"), + * and that all collations used in the expression derive from Vars of the + * foreign table. Because of the latter, the logic is pretty close to + * assign_collations_walker() in parse_collate.c, though we can assume here + * that the given expression is valid. Note function mutability is not + * currently considered here. + */ +static bool +odbc_foreign_expr_walker(Node *node, + foreign_glob_cxt *glob_cxt, + foreign_loc_cxt *outer_cxt) +{ + bool check_type = true; + foreign_loc_cxt inner_cxt; + Oid collation; + FDWCollateState state; + HeapTuple tuple; + + /* Need do nothing for empty subexpressions */ + if (node == NULL) + return true; + + /* Set up inner_cxt for possible recursion to child nodes */ + inner_cxt.collation = InvalidOid; + inner_cxt.state = FDW_COLLATE_NONE; + inner_cxt.is_op_args = outer_cxt->is_op_args; + inner_cxt.is_scalar_array_op_arg = outer_cxt->is_scalar_array_op_arg; + + switch (nodeTag(node)) + { + case T_Var: + { + Var *var = (Var *) node; + + /* Check var type if it is an arg of an operator */ + if (outer_cxt->is_op_args && !odbc_is_supported_type(var->vartype)) + return false; + + /* + * If the Var is from the foreign table, we consider its + * collation (if any) safe to use. If it is from another + * table, we treat its collation the same way as we would a + * Param's collation, ie it's not safe for it to have a + * non-default collation. + */ + if (bms_is_member(var->varno, glob_cxt->relids) && + var->varlevelsup == 0) + { + /* Var belongs to foreign table */ + + /* + * System columns should not be sent to the remote, since + * we don't make any effort to ensure that local and + * remote values match (tableoid, in particular, almost + * certainly doesn't match). + */ + if (var->varattno < 0) + return false; + + /* Else check the collation */ + collation = var->varcollid; + state = OidIsValid(collation) ? FDW_COLLATE_SAFE : FDW_COLLATE_NONE; + } + else + { + /* Parameter is unsupported */ + return false; + } + } + break; + case T_Const: + { + Const *c = (Const *) node; + + /* Does not support push-down bytea constant */ + if (c->consttype == BYTEAOID) + return false; + /* Check const type if it is an arg of an operator */ + if (outer_cxt->is_op_args && !odbc_is_supported_type(c->consttype)) + return false; + + /* + * If the constant has nondefault collation, either it's of a + * non-builtin type, or it reflects folding of a CollateExpr. + * It's unsafe to send to the remote unless it's used in a + * non-collation-sensitive context. + */ + collation = c->constcollid; + if (collation == InvalidOid || + collation == DEFAULT_COLLATION_OID) + state = FDW_COLLATE_NONE; + else + state = FDW_COLLATE_UNSAFE; + } + break; + case T_DistinctExpr: + /* Does not support pushdown T_DistinctExpr */ + return false; + case T_NullIfExpr: + case T_OpExpr: + { + OpExpr *oe = (OpExpr *) node; + char *oprname; + Form_pg_operator form; + + /* + * Similarly, only built-in operators can be sent to remote. + * (If the operator is, surely its underlying function is + * too.) + */ + if (!odbc_is_builtin(oe->opno)) + return false; + + tuple = SearchSysCache1(OPEROID, ObjectIdGetDatum(oe->opno)); + if (!HeapTupleIsValid(tuple)) + elog(ERROR, "cache lookup failed for operator %u", oe->opno); + form = (Form_pg_operator) GETSTRUCT(tuple); + + /* Get operation name */ + oprname = pstrdup(NameStr(form->oprname)); + ReleaseSysCache(tuple); + + /* + * odbc does not support push-down operator which not exsisted + * in odbcSupportedBuiltinOperators + */ + if (!odbc_is_str_exist_in_list(oprname, odbcSupportedBuiltinOperators)) + return false; + + /* + * Recurse to input subexpressions. + */ + inner_cxt.is_op_args = true; + if (!odbc_foreign_expr_walker((Node *) oe->args, + glob_cxt, &inner_cxt)) + return false; + inner_cxt.is_op_args = false; + + /* + * If operator's input collation is not derived from a foreign + * Var, it can't be sent to remote. + */ + if (oe->inputcollid == InvalidOid) + /* OK, inputs are all noncollatable */ ; + else if (inner_cxt.state != FDW_COLLATE_SAFE || + oe->inputcollid != inner_cxt.collation) + return false; + + /* Result-collation handling is same as for functions */ + collation = oe->opcollid; + if (collation == InvalidOid) + state = FDW_COLLATE_NONE; + else if (inner_cxt.state == FDW_COLLATE_SAFE && + collation == inner_cxt.collation) + state = FDW_COLLATE_SAFE; + else if (collation == DEFAULT_COLLATION_OID) + state = FDW_COLLATE_NONE; + else + state = FDW_COLLATE_UNSAFE; + } + break; + case T_BoolExpr: + { + BoolExpr *b = (BoolExpr *) node; + + /* + * Recurse to input subexpressions. + */ + if (!odbc_foreign_expr_walker((Node *) b->args, + glob_cxt, &inner_cxt)) + return false; + + /* Output is always boolean and so noncollatable. */ + collation = InvalidOid; + state = FDW_COLLATE_NONE; + } + break; + case T_NullTest: + { + NullTest *nt = (NullTest *) node; + + /* + * Recurse to input subexpressions. + */ + if (!odbc_foreign_expr_walker((Node *) nt->arg, + glob_cxt, &inner_cxt)) + return false; + + /* Output is always boolean and so noncollatable. */ + collation = InvalidOid; + state = FDW_COLLATE_NONE; + } + break; + case T_BooleanTest: + { + BooleanTest *bt = (BooleanTest *) node; + + if (bt->booltesttype == IS_UNKNOWN || bt->booltesttype == IS_NOT_UNKNOWN) + return false; + + /* + * Recurse to input subexpressions. + */ + if (!odbc_foreign_expr_walker((Node *) bt->arg, + glob_cxt, &inner_cxt)) + return false; + + /* Output is always boolean and so noncollatable. */ + collation = InvalidOid; + state = FDW_COLLATE_NONE; + } + break; + case T_ScalarArrayOpExpr: + { + ScalarArrayOpExpr *oe = (ScalarArrayOpExpr *) node; + Form_pg_operator form; + char *oprname = NULL; + + /* + * Again, only built-in operators can be sent to remote. + */ + if (!odbc_is_builtin(oe->opno)) + return false; + + tuple = SearchSysCache1(OPEROID, ObjectIdGetDatum(oe->opno)); + if (!HeapTupleIsValid(tuple)) + elog(ERROR, "cache lookup failed for operator %u", oe->opno); + form = (Form_pg_operator) GETSTRUCT(tuple); + + /* Get operation name */ + oprname = pstrdup(NameStr(form->oprname)); + ReleaseSysCache(tuple); + + /* Only support push down equal or not-equal operator. */ + if (!(strcmp(oprname, "=") == 0 || + strcmp(oprname, "<>") == 0 || + strcmp(oprname, "!=") == 0)) + return false; + + /* + * Recurse to input subexpressions. + */ + inner_cxt.is_scalar_array_op_arg = true; + if (!odbc_foreign_expr_walker((Node *) oe->args, + glob_cxt, &inner_cxt)) + return false; + inner_cxt.is_scalar_array_op_arg = false; + + /* + * If operator's input collation is not derived from a foreign + * Var, it can't be sent to remote. + */ + if (oe->inputcollid == InvalidOid) + /* OK, inputs are all noncollatable */ ; + else if (inner_cxt.state != FDW_COLLATE_SAFE || + oe->inputcollid != inner_cxt.collation) + return false; + + /* Output is always boolean and so noncollatable. */ + collation = InvalidOid; + state = FDW_COLLATE_NONE; + } + break; + case T_ArrayExpr: + { + ArrayExpr *a = (ArrayExpr *) node; + + /* just support array in side T_ScalarArrayOpExpr */ + if (!inner_cxt.is_scalar_array_op_arg) + return false; + /* + * Recurse to input subexpressions. + */ + if (!odbc_foreign_expr_walker((Node *) a->elements, + glob_cxt, &inner_cxt)) + return false; + + /* + * ArrayExpr must not introduce a collation not derived from + * an input foreign Var. + */ + collation = a->array_collid; + if (collation == InvalidOid) + state = FDW_COLLATE_NONE; + else if (inner_cxt.state == FDW_COLLATE_SAFE && + collation == inner_cxt.collation) + state = FDW_COLLATE_SAFE; + else + state = FDW_COLLATE_UNSAFE; + } + break; + case T_List: + { + List *l = (List *) node; + ListCell *lc; + + /* + * Recurse to component subexpressions. + */ + foreach(lc, l) + { + if (!odbc_foreign_expr_walker((Node *) lfirst(lc), + glob_cxt, &inner_cxt)) + return false; + } + + /* + * When processing a list, collation state just bubbles up + * from the list elements. + */ + collation = inner_cxt.collation; + state = inner_cxt.state; + + /* Don't apply exprType() to the list. */ + check_type = false; + } + break; + case T_Aggref: + { + Aggref *agg = (Aggref *) node; + ListCell *lc; + char *aggname = NULL; + + /* Not safe to pushdown when not in grouping context */ + if (!IS_UPPER_REL(glob_cxt->foreignrel)) + return false; + + /* Only non-split aggregates are pushable. */ + if (agg->aggsplit != AGGSPLIT_SIMPLE) + return false; + + /* + * Does not support VARIADIC, FILTER and ORDER BY inside + * aggregate function + */ + if (agg->aggfilter != NULL || + agg->aggorder != NIL || + agg->aggvariadic == true) + return false; + + /* get function name */ + aggname = get_func_name(agg->aggfnoid); + + /* + * Does not push down aggregate function if it not in + * odbcSupportedBuiltinAggFunction + */ + if (!odbc_is_str_exist_in_list(aggname, odbcSupportedBuiltinAggFunction)) + return false; + + if (agg->aggdistinct != NIL && + !(strcmp(aggname, "max") == 0 || + strcmp(aggname, "min") == 0 || + strcmp(aggname, "avg") == 0 || + strcmp(aggname, "sum") == 0 || + strcmp(aggname, "count") == 0)) + return false; + + /* + * Recurse to input args. + */ + foreach(lc, agg->args) + { + Node *n = (Node *) lfirst(lc); + + /* If TargetEntry, extract the expression from it */ + if (IsA(n, TargetEntry)) + { + TargetEntry *tle = (TargetEntry *) n; + + n = (Node *) tle->expr; + } + + if (!odbc_foreign_expr_walker(n, glob_cxt, &inner_cxt)) + return false; + } + + /* + * If aggregate's input collation is not derived from a + * foreign Var, it can't be sent to remote. + */ + if (agg->inputcollid == InvalidOid) + /* OK, inputs are all noncollatable */ ; + else if (inner_cxt.state != FDW_COLLATE_SAFE || + agg->inputcollid != inner_cxt.collation) + return false; + + /* + * Detect whether node is introducing a collation not derived + * from a foreign Var. (If so, we just mark it unsafe for now + * rather than immediately returning false, since the parent + * node might not care.) + */ + collation = agg->aggcollid; + if (collation == InvalidOid) + state = FDW_COLLATE_NONE; + else if (inner_cxt.state == FDW_COLLATE_SAFE && + collation == inner_cxt.collation) + state = FDW_COLLATE_SAFE; + else if (collation == DEFAULT_COLLATION_OID) + state = FDW_COLLATE_NONE; + else + state = FDW_COLLATE_UNSAFE; + } + break; + case T_FuncExpr: + { + FuncExpr *fe = (FuncExpr *) node; + char *funcname = NULL; + bool is_cast_functions = false; + bool is_common_function = false; + + /* + * If function used by the expression is not built-in, it + * can't be sent to remote because it might have incompatible + * semantics on remote side. + */ + funcname = get_func_name(fe->funcid); + + /* check NULL for funcname */ + if (funcname == NULL) + elog(ERROR, "cache lookup failed for function %u", fe->funcid); + + /* + * Check cast functions: + * - IMPLICIT CAST will be skip + * - EXPLICIT CAST existed in CastFunctions list will be pushed-down + */ + if (fe->funcformat == COERCE_IMPLICIT_CAST || + (fe->funcformat == COERCE_EXPLICIT_CAST && + odbc_is_str_exist_in_list(funcname, CastFunctions))) + { + is_cast_functions = true; + } + else if (fe->funcformat != COERCE_EXPLICIT_CAST) + { + /* odbc supported builtin functions */ + if (odbc_is_supported_builtin_func(fe->funcid, funcname)) + is_common_function = true; + } + + /* + * Does not push down function to odbc data source if it not + * a supported cast function or common function + */ + if (!is_cast_functions && + !is_common_function) + return false; + + /* Just support push-down log with 2 arguments */ + if (strcmp(funcname, "log") == 0 && list_length(fe->args) != 2) + return false; + + /* Does not support push-down regexp_replace with more than 3 arguments */ + if (strcmp(funcname, "regexp_replace") == 0 && list_length(fe->args) > 3) + return false; + + /* + * Recurse to input subexpressions. + */ + if (!odbc_foreign_expr_walker((Node *) fe->args, + glob_cxt, &inner_cxt)) + return false; + + /* + * If function's input collation is not derived from a + * foreign Var, it can't be sent to remote. + */ + if (fe->inputcollid == InvalidOid) + /* OK, inputs are all noncollatable */ ; + else if (inner_cxt.state != FDW_COLLATE_SAFE || + fe->inputcollid != inner_cxt.collation) + return false; + + /* + * Detect whether node is introducing a collation not + * derived from a foreign Var. (If so, we just mark it + * unsafe for now rather than immediately returning false, + * since the parent node might not care.) + */ + collation = fe->funccollid; + if (collation == InvalidOid) + state = FDW_COLLATE_NONE; + else if (inner_cxt.state == FDW_COLLATE_SAFE && + collation == inner_cxt.collation) + state = FDW_COLLATE_SAFE; + else + state = FDW_COLLATE_UNSAFE; + } + break; + default: + + /* + * If it's anything else, assume it's unsafe. This list can be + * expanded later, but don't forget to add deparse support below. + */ + return false; + } + + /* + * If result type of given expression is not shippable, it can't be sent + * to remote because it might have incompatible semantics on remote side. + */ + if (check_type && !odbc_is_builtin(exprType(node))) + return false; + + /* + * Now, merge my collation information into my parent's state. + */ + if (state > outer_cxt->state) + { + /* Override previous parent state */ + outer_cxt->collation = collation; + outer_cxt->state = state; + } + else if (state == outer_cxt->state) + { + /* Merge, or detect error if there's a collation conflict */ + switch (state) + { + case FDW_COLLATE_NONE: + /* Nothing + nothing is still nothing */ + break; + case FDW_COLLATE_SAFE: + if (collation != outer_cxt->collation) + { + /* + * Non-default collation always beats default. + */ + if (outer_cxt->collation == DEFAULT_COLLATION_OID) + { + /* Override previous parent state */ + outer_cxt->collation = collation; + } + else if (collation != DEFAULT_COLLATION_OID) + { + /* + * Conflict; show state as indeterminate. We don't + * want to "return false" right away, since parent + * node might not care about collation. + */ + outer_cxt->state = FDW_COLLATE_UNSAFE; + } + } + break; + case FDW_COLLATE_UNSAFE: + /* We're still conflicted ... */ + break; + } + } + + /* It looks OK */ + return true; +} + +/* + * Examine each qual clause in input_conds, and classify them into two groups, + * which are returned as two lists: + * - remote_conds contains expressions that can be evaluated remotely + * - local_conds contains expressions that can't be evaluated remotely + */ +void +odbc_classify_conditions(PlannerInfo *root, + RelOptInfo *baserel, + List *input_conds, + List **remote_conds, + List **local_conds) +{ + ListCell *lc; + + *remote_conds = NIL; + *local_conds = NIL; + + foreach(lc, input_conds) + { + RestrictInfo *ri = lfirst_node(RestrictInfo, lc); + + if (odbc_is_foreign_expr(root, baserel, ri->clause)) + *remote_conds = lappend(*remote_conds, ri); + else + *local_conds = lappend(*local_conds, ri); + } +} + + +/* + * Return true if given object is one of PostgreSQL's built-in objects. + * + * We use FirstBootstrapObjectId as the cutoff, so that we only consider + * objects with hand-assigned OIDs to be "built in", not for instance any + * function or type defined in the information_schema. + * + * Our constraints for dealing with types are tighter than they are for + * functions or operators: we want to accept only types that are in pg_catalog, + * else format_type might incorrectly fail to schema-qualify their names. + * (This could be fixed with some changes to format_type, but for now there's + * no need.) Thus we must exclude information_schema types. + * + * XXX there is a problem with this, which is that the set of built-in + * objects expands over time. Something that is built-in to us might not + * be known to the remote server, if it's of an older version. But keeping + * track of that would be a huge exercise. + */ +bool +odbc_is_builtin(Oid oid) +{ + return (oid < FirstBootstrapObjectId); +} + + +/* + * Deparse SELECT statement for given relation into buf. + * + * tlist contains the list of desired columns to be fetched from foreign server. + * For a base relation fpinfo->attrs_used is used to construct SELECT clause, + * hence the tlist is ignored for a base relation. + * + * remote_conds is the list of conditions to be deparsed into the WHERE clause + * (or, in the case of upper relations, into the HAVING clause). + * + * If params_list is not NULL, it receives a list of Params and other-relation + * Vars used in the clauses; these values must be transmitted to the remote + * server as parameter values. + * + * pathkeys is the list of pathkeys to order the result by. + * + * is_subquery is the flag to indicate whether to deparse the specified + * relation as a subquery. + * + * List of columns selected is returned in retrieved_attrs. + */ +void +odbc_deparse_select_stmt_for_rel(StringInfo buf, PlannerInfo *root, RelOptInfo *rel, + List *tlist, List *remote_conds, List *pathkeys, + bool has_final_sort, bool has_limit, bool is_subquery, + List **retrieved_attrs) +{ + deparse_expr_cxt context; + OdbcFdwRelationInfo *fpinfo = (OdbcFdwRelationInfo *) rel->fdw_private; + List *quals; + + /* + * We handle relations for foreign tables, joins between those and upper + * relations. + */ + Assert(IS_SIMPLE_REL(rel) || IS_UPPER_REL(rel)); + + /* Fill portions of context common to upper, join and base relation */ + context.buf = buf; + context.root = root; + context.foreignrel = rel; + context.q_char = fpinfo->q_char; + context.name_qualifier_char = fpinfo->name_qualifier_char; + context.scanrel = IS_UPPER_REL(rel) ? fpinfo->outerrel : rel; + + /* + * For upper relations, the WHERE clause is built from the remote + * conditions of the underlying scan relation; otherwise, we can use the + * supplied list of remote conditions directly. + */ + if (IS_UPPER_REL(rel)) + { + OdbcFdwRelationInfo *ofpinfo; + + ofpinfo = (OdbcFdwRelationInfo *) fpinfo->outerrel->fdw_private; + quals = ofpinfo->remote_conds; + } + else + quals = remote_conds; + + /* Construct SELECT clause */ + odbc_deparse_select_sql(tlist, retrieved_attrs, &context); + + /* Construct FROM and WHERE clauses */ + odbc_deparse_from_expr(quals, &context); +} + +/* + * Construct a simple SELECT statement that retrieves desired columns + * of the specified foreign table, and append it to "buf". The output + * contains just "SELECT ... ". + * + * We also create an integer List of the columns being retrieved, which is + * returned to *retrieved_attrs, unless we deparse the specified relation + * as a subquery. + * + * tlist is the list of desired columns. is_subquery is the flag to + * indicate whether to deparse the specified relation as a subquery. + * Read prologue of odbc_deparse_select_stmt_for_rel() for details. + */ +static void +odbc_deparse_select_sql(List *tlist, List **retrieved_attrs, + deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + RelOptInfo *foreignrel = context->foreignrel; + PlannerInfo *root = context->root; + OdbcFdwRelationInfo *fpinfo = (OdbcFdwRelationInfo *) foreignrel->fdw_private; + + /* + * Construct SELECT list + */ + appendStringInfoString(buf, "SELECT "); + if (IS_UPPER_REL(foreignrel)) + { + /* + * For a join or upper relation the input tlist gives the list of + * columns required to be fetched from the foreign server. + */ + odbc_deparse_explicit_target_list(tlist, false, retrieved_attrs, context); + } + else + { + /* + * For a base relation fpinfo->attrs_used gives the list of columns + * required to be fetched from the foreign server. + */ + RangeTblEntry *rte = planner_rt_fetch(foreignrel->relid, root); + + /* + * Core code already has some lock on each rel being planned, so we + * can use NoLock here. + */ + Relation rel = table_open(rte->relid, NoLock); + + odbc_deparse_target_list(buf, rte, foreignrel->relid, rel, false, + fpinfo->attrs_used, false, retrieved_attrs, context); + table_close(rel, NoLock); + } +} + +/* + * Construct a FROM clause and, if needed, a WHERE clause, and append those to + * "buf". + * + * quals is the list of clauses to be included in the WHERE clause. + * (These may or may not include RestrictInfo decoration.) + */ +static void +odbc_deparse_from_expr(List *quals, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + RelOptInfo *scanrel = context->scanrel; + + /* For upper relations, scanrel must be either a joinrel or a baserel */ + Assert(!IS_UPPER_REL(context->foreignrel) || + IS_JOIN_REL(scanrel) || IS_SIMPLE_REL(scanrel)); + + /* Construct FROM clause */ + appendStringInfoString(buf, " FROM "); + odbc_deparse_from_expr_for_rel(buf, context->root, scanrel, + (bms_membership(scanrel->relids) == BMS_MULTIPLE), + (Index) 0, NULL, NULL); + + /* Construct WHERE clause */ + if (quals != NIL) + { + appendStringInfoString(buf, " WHERE "); + odbc_append_conditions(quals, context); + } +} + +/* + * Deparse given targetlist and append it to paremeter of select + * + * tlist is list of TargetEntry's which in turn contain Var nodes. + * + * retrieved_attrs is the list of continuously increasing integers starting + * from 1. It has same number of entries as tlist. + * + * This is used for both SELECT and RETURNING targetlists; the is_returning + * parameter is true only for a RETURNING targetlist. + */ +static void +odbc_deparse_explicit_target_list(List *tlist, + bool is_returning, + List **retrieved_attrs, + deparse_expr_cxt *context) +{ + ListCell *lc; + int i = 0; + + *retrieved_attrs = NIL; + + foreach(lc, tlist) + { + TargetEntry *tle = lfirst_node(TargetEntry, lc); + + if (i > 0) + appendStringInfoString(context->buf, ", "); + + odbc_deparse_expr((Expr *) tle->expr, context); + + *retrieved_attrs = lappend_int(*retrieved_attrs, i + 1); + i++; + } + + if (i == 0) + appendStringInfoString(context->buf, "NULL"); +} + +/* + * Emit a target list that retrieves the columns specified in attrs_used. + * This is used for both SELECT and RETURNING targetlists; the is_returning + * parameter is true only for a RETURNING targetlist. + * + * The tlist text is appended to buf, and we also create an integer List + * of the columns being retrieved, which is returned to *retrieved_attrs. + * + * If qualify_col is true, add relation alias before the column name. + */ +static void +odbc_deparse_target_list(StringInfo buf, + RangeTblEntry *rte, + Index rtindex, + Relation rel, + bool is_returning, + Bitmapset *attrs_used, + bool qualify_col, + List **retrieved_attrs, + deparse_expr_cxt *context) +{ + TupleDesc tupdesc = RelationGetDescr(rel); + bool have_wholerow; + bool first; + int i; + + *retrieved_attrs = NIL; + + /* If there's a whole-row reference, we'll need all the columns. */ + have_wholerow = bms_is_member(0 - FirstLowInvalidHeapAttributeNumber, + attrs_used); + + first = true; + for (i = 1; i <= tupdesc->natts; i++) + { + Form_pg_attribute attr = TupleDescAttr(tupdesc, i - 1); + + /* Ignore dropped attributes. */ + if (attr->attisdropped) + continue; + + if (have_wholerow || + bms_is_member(i - FirstLowInvalidHeapAttributeNumber, + attrs_used)) + { + if (!first) + appendStringInfoString(buf, ", "); + + first = false; + + odbc_deparse_column_ref(buf, rtindex, i, rte, qualify_col, context); + + *retrieved_attrs = lappend_int(*retrieved_attrs, i); + } + } + + /* Don't generate bad syntax if no undropped columns */ + if (first) + appendStringInfoString(buf, "NULL"); +} + +/* + * Construct FROM clause for given relation + * + * 'ignore_rel' is either zero or the RT index of a target relation. In the + * latter case the function constructs FROM clause of UPDATE or USING clause + * of DELETE; it deparses the join relation as if the relation never contained + * the target relation, and creates a List of conditions to be deparsed into + * the top-level WHERE clause, which is returned to *ignore_conds. + */ +static void +odbc_deparse_from_expr_for_rel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel, + bool use_alias, Index ignore_rel, List **ignore_conds, + List **params_list) +{ + OdbcFdwRelationInfo *fpinfo = (OdbcFdwRelationInfo *) foreignrel->fdw_private; + + RangeTblEntry *rte = planner_rt_fetch(foreignrel->relid, root); + + /* + * Core code already has some lock on each rel being planned, so we can + * use NoLock here. + */ + Relation rel = table_open(rte->relid, NoLock); + + odbc_deparse_relation(buf, rel, fpinfo->name_qualifier_char, fpinfo->q_char); + + /* + * Add a unique alias to avoid any conflict in relation names due to + * pulled up subqueries in the query being built for a pushed down join. + */ + if (use_alias) + appendStringInfo(buf, " %s%d", REL_ALIAS_PREFIX, foreignrel->relid); + + table_close(rel, NoLock); +} + +/* + * Append remote name of specified foreign table to buf. + * Use value of table_name FDW option (if any) instead of relation's name. + * Similarly, schema_name FDW option overrides schema name. + */ +void +odbc_deparse_relation(StringInfo buf, Relation rel, char *name_qualifier_char, char *q_char) +{ + ForeignTable *table; + const char *nspname = NULL; + const char *relname = NULL; + ListCell *lc; + + /* obtain additional catalog information. */ + table = GetForeignTable(RelationGetRelid(rel)); + + /* + * Use value of FDW options if any, instead of the name of object itself. + */ + foreach(lc, table->options) + { + DefElem *def = (DefElem *) lfirst(lc); + + if (strcmp(def->defname, "schema") == 0) + nspname = defGetString(def); + else if (strcmp(def->defname, "table") == 0) + relname = defGetString(def); + } + + /* + * Note: we could skip printing the schema name if it's pg_catalog, but + * that doesn't seem worth the trouble. + */ + if (nspname == NULL) + nspname = get_namespace_name(RelationGetNamespace(rel)); + if (relname == NULL) + relname = RelationGetRelationName(rel); + + appendStringInfo(buf, "%s%s%s", + odbc_quote_identifier(nspname, q_char, false), + name_qualifier_char, + odbc_quote_identifier(relname, q_char, false)); +} + +/* + * Deparse conditions from the provided list and append them to buf. + * + * The conditions in the list are assumed to be ANDed. This function is used to + * deparse WHERE clauses, JOIN .. ON clauses and HAVING clauses. + * + * Depending on the caller, the list elements might be either RestrictInfos + * or bare clauses. + */ +static void +odbc_append_conditions(List *exprs, deparse_expr_cxt *context) +{ + int nestlevel; + ListCell *lc; + bool is_first = true; + StringInfo buf = context->buf; + + /* Make sure any constants in the exprs are printed portably */ + nestlevel = odbc_set_transmission_modes(); + + foreach(lc, exprs) + { + Expr *expr = (Expr *) lfirst(lc); + + /* Extract clause from RestrictInfo, if required */ + if (IsA(expr, RestrictInfo)) + expr = ((RestrictInfo *) expr)->clause; + + /* Connect expressions with "AND" and parenthesize each condition. */ + if (!is_first) + appendStringInfoString(buf, " AND "); + + appendStringInfoChar(buf, '('); + odbc_deparse_expr(expr, context); + appendStringInfoChar(buf, ')'); + + is_first = false; + } + + odbc_reset_transmission_modes(nestlevel); +} + +/* + * Deparse given expression into context->buf. + * + * This function must support all the same node types that odbc_foreign_expr_walker + * accepts. + * + * Note: unlike ruleutils.c, we just use a simple hard-wired parenthesization + * scheme: anything more complex than a Var, Const, function call or cast + * should be self-parenthesized. + */ +static void +odbc_deparse_expr(Expr *node, deparse_expr_cxt *context) +{ + if (node == NULL) + return; + + switch (nodeTag(node)) + { + case T_Var: + odbc_deparse_var((Var *) node, context); + break; + case T_Const: + odbc_deparse_const((Const *) node, context); + break; + case T_NullIfExpr: + odbc_deparse_nullif_expr((OpExpr *) node, context); + break; + case T_OpExpr: + odbc_deparse_op_expr((OpExpr *) node, context); + break; + case T_BoolExpr: + odbc_deparse_bool_expr((BoolExpr *) node, context); + break; + case T_NullTest: + odbc_deparse_null_test((NullTest *) node, context); + break; + case T_BooleanTest: + odbc_deparse_boolean_test((BooleanTest *) node, context); + break; + case T_ScalarArrayOpExpr: + odbc_deparse_scalar_array_op_expr((ScalarArrayOpExpr *) node, context); + break; + case T_Aggref: + odbc_deparse_aggref((Aggref *) node, context); + break; + case T_FuncExpr: + odbc_deparse_func_expr((FuncExpr *) node, context); + break; + default: + elog(ERROR, "unsupported expression type for deparse: %d", + (int) nodeTag(node)); + break; + } +} + +/* + * Deparse given Var node into context->buf. + * + * If the Var belongs to the foreign relation, just print its remote name. + * Otherwise, it's effectively a Param (and will in fact be a Param at + * run time). Handle it the same way we handle plain Params --- see + * deparseParam for comments. + */ +static void +odbc_deparse_var(Var *node, deparse_expr_cxt *context) +{ + Relids relids = context->scanrel->relids; + + /* Qualify columns when multiple relations are involved. */ + bool qualify_col = (bms_membership(relids) == BMS_MULTIPLE); + + if (bms_is_member(node->varno, relids) && node->varlevelsup == 0) + odbc_deparse_column_ref(context->buf, node->varno, node->varattno, + planner_rt_fetch(node->varno, context->root), + qualify_col, context); + else + { + /* Does not reach here. */ + elog(ERROR, "Parameter is unsupported"); + Assert(false); + } +} + +/* + * Construct name to use for given column, and emit it into buf. + * If it has a column_name FDW option, use that instead of attribute name. + * + * If qualify_col is true, qualify column name with the alias of relation. + */ +void +odbc_deparse_column_ref(StringInfo buf, int varno, int varattno, RangeTblEntry *rte, + bool qualify_col, deparse_expr_cxt *context) +{ + if (varattno == 0) + { + /* Whole row reference */ + Relation rel; + Bitmapset *attrs_used; + + /* Required only to be passed down to odbc_deparse_target_list(). */ + List *retrieved_attrs; + + /* + * The lock on the relation will be held by upper callers, so it's + * fine to open it with no lock here. + */ + rel = table_open(rte->relid, NoLock); + + /* + * The local name of the foreign table can not be recognized by the + * foreign server and the table it references on foreign server might + * have different column ordering or different columns than those + * declared locally. Hence we have to deparse whole-row reference as + * ROW(columns referenced locally). Construct this by deparsing a + * "whole row" attribute. + */ + attrs_used = bms_add_member(NULL, + 0 - FirstLowInvalidHeapAttributeNumber); + + odbc_deparse_target_list(buf, rte, varno, rel, false, attrs_used, qualify_col, + &retrieved_attrs, context); + + table_close(rel, NoLock); + bms_free(attrs_used); + } + else + { + char *colname = NULL; + List *options; + ListCell *lc; + + /* varno must not be any of OUTER_VAR, INNER_VAR and INDEX_VAR. */ + Assert(!IS_SPECIAL_VARNO(varno)); + + /* + * If it's a column of a foreign table, and it has the column_name FDW + * option, use that value. + */ + options = GetForeignColumnOptions(rte->relid, varattno); + foreach(lc, options) + { + DefElem *def = (DefElem *) lfirst(lc); + + if (strcmp(def->defname, "column") == 0) + { + colname = defGetString(def); + break; + } + } + + /* + * If it's a column of a regular table or it doesn't have column_name + * FDW option, use attribute name. + */ + if (colname == NULL) + colname = get_attname(rte->relid, varattno, false); + + if (qualify_col) + appendStringInfo(buf, "%s%d%s", REL_ALIAS_PREFIX, varno, context->name_qualifier_char); + + appendStringInfoString(buf, odbc_quote_identifier(colname, context->q_char, false)); + } +} + +/* + * Deparse given constant value into context->buf. + * + * This function has to be kept in sync with ruleutils.c's get_const_expr. + * As for that function, showtype can be -1 to never show "::typename" decoration, + * or +1 to always show it, or 0 to show it only if the constant wouldn't be assumed + * to be the right type by default. + */ +static void +odbc_deparse_const(Const *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + Oid typoutput; + bool typIsVarlena; + char *extval; + + if (node->constisnull) + { + appendStringInfoString(buf, "NULL"); + return; + } + + getTypeOutputInfo(node->consttype, + &typoutput, &typIsVarlena); + extval = OidOutputFunctionCall(typoutput, node->constvalue); + + odbc_append_constant_value(buf, node->consttype, extval); + + pfree(extval); +} + +/* + * Append constant value to buffer, + * and convert constant to common style if needed. + */ +static void +odbc_append_constant_value(StringInfo buf, Oid const_type, char *extval) +{ + switch (const_type) + { + case INT2OID: + case INT4OID: + case INT8OID: + case OIDOID: + case FLOAT4OID: + case FLOAT8OID: + case NUMERICOID: + { + /* + * No need to quote unless it's a special value such as 'NaN'. + * See comments in get_const_expr(). + */ + if (strspn(extval, "0123456789+-eE.") == strlen(extval)) + { + if (extval[0] == '+' || extval[0] == '-') + appendStringInfo(buf, "(%s)", extval); + else + appendStringInfoString(buf, extval); + } + else + appendStringInfo(buf, "'%s'", extval); + } + break; + case BITOID: + case VARBITOID: + appendStringInfo(buf, "B'%s'", extval); + break; + case BOOLOID: + if (strcmp(extval, "t") == 0) + appendStringInfoString(buf, "true"); + else + appendStringInfoString(buf, "false"); + break; + default: + odbc_deparse_string_literal(buf, extval); + break; + } +} + +static void +odbc_deparse_nullif_expr(NullIfExpr *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + + /* Sanity check. */ + Assert(list_length(node->args) == 2); + + appendStringInfoString(buf, "nullif("); + odbc_deparse_expr(linitial(node->args), context); + appendStringInfoString(buf, ", "); + odbc_deparse_expr(llast(node->args), context); + appendStringInfoChar(buf, ')'); +} + +/* + * Deparse given operator expression. To avoid problems around + * priority of operations, we always parenthesize the arguments. + */ +static void +odbc_deparse_op_expr(OpExpr *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + HeapTuple tuple; + Form_pg_operator form; + char oprkind; + + /* Retrieve information about the operator from system catalog. */ + tuple = SearchSysCache1(OPEROID, ObjectIdGetDatum(node->opno)); + if (!HeapTupleIsValid(tuple)) + elog(ERROR, "cache lookup failed for operator %u", node->opno); + form = (Form_pg_operator) GETSTRUCT(tuple); + oprkind = form->oprkind; + + /* Sanity check. */ + Assert((oprkind == 'l' && list_length(node->args) == 1) || + (oprkind == 'b' && list_length(node->args) == 2)); + + /* Always parenthesize the expression. */ + appendStringInfoChar(buf, '('); + + /* Deparse left operand, if any. */ + if (oprkind == 'b') + { + odbc_deparse_expr(linitial(node->args), context); + appendStringInfoChar(buf, ' '); + } + + /* Deparse operator name. */ + odbc_deparse_operator_name(buf, form); + + /* Deparse right operand. */ + appendStringInfoChar(buf, ' '); + odbc_deparse_expr(llast(node->args), context); + + appendStringInfoChar(buf, ')'); + + ReleaseSysCache(tuple); +} + +/* + * Deparse a BoolExpr node. + */ +static void +odbc_deparse_bool_expr(BoolExpr *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + const char *op = NULL; /* keep compiler quiet */ + bool first; + ListCell *lc; + + switch (node->boolop) + { + case AND_EXPR: + op = "AND"; + break; + case OR_EXPR: + op = "OR"; + break; + case NOT_EXPR: + appendStringInfoString(buf, "(NOT "); + odbc_deparse_expr(linitial(node->args), context); + appendStringInfoChar(buf, ')'); + return; + } + + appendStringInfoChar(buf, '('); + first = true; + foreach(lc, node->args) + { + if (!first) + appendStringInfo(buf, " %s ", op); + odbc_deparse_expr((Expr *) lfirst(lc), context); + first = false; + } + appendStringInfoChar(buf, ')'); +} + +/* + * Deparse IS [NOT] NULL expression. + */ +static void +odbc_deparse_null_test(NullTest *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + + appendStringInfoChar(buf, '('); + odbc_deparse_expr(node->arg, context); + + if (node->nulltesttype == IS_NULL) + appendStringInfoString(buf, " IS NULL)"); + else + appendStringInfoString(buf, " IS NOT NULL)"); + +} + +/* + * Deparse IS [NOT] TRUE/FALSE expression. + */ +static void +odbc_deparse_boolean_test(BooleanTest *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + + appendStringInfoChar(buf, '('); + odbc_deparse_expr(node->arg, context); + + if (node->booltesttype == IS_TRUE) + appendStringInfoString(buf, " IS TRUE)"); + else if (node->booltesttype == IS_NOT_TRUE) + appendStringInfoString(buf, " IS NOT TRUE)"); + else if (node->booltesttype == IS_FALSE) + appendStringInfoString(buf, " IS FALSE)"); + else + appendStringInfoString(buf, " IS NOT FALSE)"); + +} + +/* + * Print the name of an operator. + */ +static void +odbc_deparse_operator_name(StringInfo buf, Form_pg_operator opform) +{ + char *opname = NameStr(opform->oprname); + + /* Just print operator name. */ + if (strcmp(opname, "~~") == 0) + appendStringInfoString(buf, "LIKE"); + else if (strcmp(opname, "!~~") == 0) + appendStringInfoString(buf, "NOT LIKE"); + else + appendStringInfoString(buf, opname); + +} + +/* + * Append a SQL string literal representing "val" to buf. + */ +static void +odbc_deparse_string_literal(StringInfo buf, const char *val) +{ + const char *valptr; + + appendStringInfoChar(buf, '\''); + + for (valptr = val; *valptr; valptr++) + { + char ch = *valptr; + + if (SQL_STR_DOUBLE(ch, true)) + appendStringInfoChar(buf, ch); + appendStringInfoChar(buf, ch); + } + appendStringInfoChar(buf, '\''); +} + +/* + * Deparse an Aggref node. + */ +static void +odbc_deparse_aggref(Aggref *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + + /* Only basic, non-split aggregation accepted. */ + Assert(node->aggsplit == AGGSPLIT_SIMPLE); + + /* Find aggregate name from aggfnoid which is a pg_proc entry */ + odbc_deparse_function_name(node->aggfnoid, context); + appendStringInfoChar(buf, '('); + + /* Add DISTINCT */ + appendStringInfo(buf, "%s", (node->aggdistinct != NIL) ? "DISTINCT " : ""); + + /* aggstar can be set only in zero-argument aggregates */ + if (node->aggstar) + appendStringInfoChar(buf, '*'); + else + { + ListCell *arg; + bool first = true; + + /* Add all the arguments */ + foreach(arg, node->args) + { + TargetEntry *tle = (TargetEntry *) lfirst(arg); + Node *n = (Node *) tle->expr; + + if (tle->resjunk) + continue; + + if (!first) + appendStringInfoString(buf, ", "); + first = false; + + odbc_deparse_expr((Expr *) n, context); + } + } + + /* Does not support ORDER BY inside Aggregate */ + Assert(!node->aggorder); + + appendStringInfoChar(buf, ')'); +} + +/* + * Deparse function position() + */ +static void +odbc_deparse_func_expr_position(FuncExpr *node, deparse_expr_cxt *context, StringInfo buf, char *proname) +{ + Expr *arg1; + Expr *arg2; + + /* Append the function name */ + appendStringInfo(buf, "%s(", proname); + + /* + * POSITION function has only two arguments. When deparsing, the range of + * these argument will be changed, the first argument will be in last so + * it will be get first, After that, the last argument will be get later. + */ + Assert(list_length(node->args) == 2); + + /* Get the first argument */ + arg1 = lsecond(node->args); + odbc_deparse_expr(arg1, context); + appendStringInfo(buf, " IN "); + /* Get the last argument */ + arg2 = linitial(node->args); + odbc_deparse_expr(arg2, context); + + appendStringInfoChar(buf, ')'); +} + +/* + * Deparse a function call. + */ +static void +odbc_deparse_func_expr(FuncExpr *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + bool first; + ListCell *arg; + char *function_name; + + /* + * If the function call came from an implicit coercion, then just show the + * first argument. + */ + if (node->funcformat == COERCE_IMPLICIT_CAST) + { + odbc_deparse_expr((Expr *) linitial(node->args), context); + return; + } + + function_name = get_func_name(node->funcid); + + /* + * If the function call came from a cast, it will deparse to CAST(... AS ...) + */ + if (node->funcformat == COERCE_EXPLICIT_CAST) + { + Oid rettype = node->funcresulttype; + int32 coercedTypmod; + + /* Get the typmod if this is a length-coercion function */ + (void) exprIsLengthCoercion((Node *) node, &coercedTypmod); + appendStringInfoString(buf, "CAST("); + odbc_deparse_expr((Expr *) linitial(node->args), context); + appendStringInfo(buf, " AS %s)", + odbc_deparse_cast_function(function_name, rettype, coercedTypmod)); + return; + } + + if (strcmp(function_name, "position") == 0) + { + odbc_deparse_func_expr_position(node, context, buf, function_name); + return; + } + + /* + * For the other function: display as function_name(args1, arg2, ...). + */ + appendStringInfo(buf, "%s(", function_name); + + /* ... and all the arguments */ + first = true; + foreach(arg, node->args) + { + if (!first) + appendStringInfoString(buf, ", "); + odbc_deparse_expr((Expr *) lfirst(arg), context); + first = false; + } + appendStringInfoChar(buf, ')'); +} + +/* + * Add typmod decoration to the basic type name + */ +static char * +odbc_print_typmod(char *typname, int32 typmod, Oid typmodout) +{ + char *res; + + /* Shouldn't be called if typmod is -1 */ + Assert(typmod >= 0); + + if (typmodout == InvalidOid) + { + /* Default behavior: just print the integer typmod with parens */ + res = psprintf("%s(%d)", typname, (int) typmod); + } + else + { + /* Use the type-specific typmodout procedure */ + char *tmstr; + + tmstr = DatumGetCString(OidFunctionCall1(typmodout, + Int32GetDatum(typmod))); + res = psprintf("%s%s", typname, tmstr); + } + + return res; +} + +static char * +odbc_format_type_extended(char *function_name, Oid type_oid, int32 typemod) +{ + char *buf; + + if (strcmp(function_name, "float4") == 0) + buf = pstrdup("real"); + else + buf = function_name; + + /* print type modifier */ + if (typemod >= 0) + { + HeapTuple tuple; + Form_pg_type typeform; + + tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(type_oid)); + if (!HeapTupleIsValid(tuple)) + { + elog(ERROR, "cache lookup failed for type %u", type_oid); + } + typeform = (Form_pg_type) GETSTRUCT(tuple); + + buf = odbc_print_typmod(buf, typemod, typeform->typmodout); + ReleaseSysCache(tuple); + } + + return buf; +} + +/* + * Convert type OID + typmod info into a type name we can ship to the remote + * server. Someplace else had better have verified that this type name is + * expected to be known on the remote end. + * + * This is almost just format_type_with_typemod(), except that if left to its + * own devices, that function will make schema-qualification decisions based + * on the local search_path, which is wrong. We must schema-qualify all + * type names that are not in pg_catalog. We assume here that built-in types + * are all in pg_catalog and need not be qualified; otherwise, qualify. + */ +static char * +odbc_deparse_cast_function(char *function_name, Oid type_oid, int32 typemod) +{ + return odbc_format_type_extended(function_name, type_oid, typemod); +} + +/* + * Deparse given ScalarArrayOpExpr expression. To avoid problems around + * priority of operations, we always parenthesize the arguments. + */ +static void +odbc_deparse_scalar_array_op_expr(ScalarArrayOpExpr *node, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + HeapTuple tuple; + Expr *arg1; + Expr *arg2; + Form_pg_operator form; + char *opname = NULL; + bool useIn = false; + + /* Retrieve information about the operator from system catalog. */ + tuple = SearchSysCache1(OPEROID, ObjectIdGetDatum(node->opno)); + if (!HeapTupleIsValid(tuple)) + elog(ERROR, "cache lookup failed for operator %u", node->opno); + form = (Form_pg_operator) GETSTRUCT(tuple); + + /* Sanity check. */ + Assert(list_length(node->args) == 2); + + opname = pstrdup(NameStr(form->oprname)); + ReleaseSysCache(tuple); + + /* Using IN clause for '= ANY' and NOT IN clause for '<> ALL' */ + if ((strcmp(opname, "=") == 0 && node->useOr == true) || + (strcmp(opname, "<>") == 0 && node->useOr == false)) + useIn = true; + + /* Get left and right argument for deparsing */ + arg1 = linitial(node->args); + arg2 = lsecond(node->args); + + if (useIn) + { + /* Deparse left operand. */ + odbc_deparse_expr(arg1, context); + appendStringInfoChar(buf, ' '); + + /* Add IN clause */ + if (strcmp(opname, "<>") == 0) + { + appendStringInfoString(buf, "NOT IN ("); + } + else if (strcmp(opname, "=") == 0) + { + appendStringInfoString(buf, "IN ("); + } + } + + arg2 = (Expr *) lsecond(node->args); + switch (nodeTag((Node *) arg2)) + { + case T_Const: + { + Const *c = (Const *) arg2; + char *extval; + int num_elems = 0; + Datum *elem_values; + bool *elem_nulls; + Oid elmtype; + int i; + Oid outputFunctionId; + bool typeVarLength; + + if (c->constisnull) + { + appendStringInfoString(buf, " NULL"); + return; + } + + odbc_deconstruct_constant_array(c, &elem_nulls, &elem_values, &elmtype, &num_elems); + getTypeOutputInfo(elmtype, &outputFunctionId, &typeVarLength); + + for (i = 0; i < num_elems; i++) + { + if (i > 0) + { + if (useIn) + appendStringInfoString(buf, ", "); + else + { + if (node->useOr) + appendStringInfoString(buf, " OR "); + else + appendStringInfoString(buf, " AND "); + } + } + + if (!useIn) + { + /* Deparse left argument */ + appendStringInfoChar(buf, '('); + odbc_deparse_expr(arg1, context); + + appendStringInfo(buf, " %s ", opname); + } + + if (elem_nulls[i] == true) + { + appendStringInfoString(buf, "NULL"); + continue; + } + + extval = OidOutputFunctionCall(outputFunctionId, elem_values[i]); + odbc_append_constant_value(buf, elmtype, extval); + + if (!useIn) + appendStringInfoChar(buf, ')'); + pfree(extval); + } + + pfree(elem_values); + pfree(elem_nulls); + } + break; + case T_ArrayExpr: + { + bool first = true; + ListCell *lc; + + foreach(lc, ((ArrayExpr *) arg2)->elements) + { + if (!first) + { + if (useIn) + { + appendStringInfoString(buf, ", "); + } + else + { + if (node->useOr) + appendStringInfoString(buf, " OR "); + else + appendStringInfoString(buf, " AND "); + } + } + + if (useIn) + { + odbc_deparse_expr(lfirst(lc), context); + } + else + { + /* Deparse left argument */ + appendStringInfoChar(buf, '('); + odbc_deparse_expr(arg1, context); + + appendStringInfo(buf, " %s ", opname); + + /* + * Deparse each element in right argument + */ + odbc_deparse_expr(lfirst(lc), context); + appendStringInfoChar(buf, ')'); + } + first = false; + } + break; + } + default: + elog(ERROR, "unsupported expression type for deparse: %d", (int) nodeTag(node)); + break; + } + + /* Close IN clause */ + if (useIn) + appendStringInfoChar(buf, ')'); +} + +/* + * odbc_deparse_function_name + * Deparses function name from given function oid. + */ +static void +odbc_deparse_function_name(Oid funcid, deparse_expr_cxt *context) +{ + StringInfo buf = context->buf; + HeapTuple proctup; + Form_pg_proc procform; + const char *proname; + + proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid)); + if (!HeapTupleIsValid(proctup)) + elog(ERROR, "cache lookup failed for function %u", funcid); + procform = (Form_pg_proc) GETSTRUCT(proctup); + + /* Always print the function name */ + proname = NameStr(procform->proname); + appendStringInfoString(buf, proname); + + ReleaseSysCache(proctup); +} + +/* + * odbc_quote_identifier - Quote an identifier only if needed + * + * When quotes are needed, we palloc the required space; slightly + * space-wasteful but well worth it for notational simplicity. + * refer: PostgreSQL 13.0 src/backend/utils/adt/ruleutils.c L10730 + */ +const char * +odbc_quote_identifier(const char *ident, char *q_char, bool quote_all_identifiers) +{ + /* + * Can avoid quoting if ident starts with a lowercase letter or underscore + * and contains only lowercase letters, digits, and underscores, *and* is + * not any SQL keyword. Otherwise, supply quotes. + */ + int nquotes = 0; + bool safe; + const char *ptr; + char *result; + char *optr; + + if (q_char == NULL) + return ident; + + /* + * Verify q_char get from remote server + */ + if (strlen(q_char) == 1) + { + /* q_char is a char value */ + if (strcmp(q_char, " ") == 0) + { + /* remote server not support identifier quote string */ + return ident; /* no change needed */ + } + } + else + { + /* + * q_char is a string value. Currently, we do not handle this case. + */ + elog(ERROR, "odbc_fdw: Not support quote string \"%s\".", q_char); + } + + /* + * would like to use macros here, but they might yield unwanted + * locale-specific results... + */ + safe = ((ident[0] >= 'a' && ident[0] <= 'z') || ident[0] == '_'); + + for (ptr = ident; *ptr; ptr++) + { + char ch = *ptr; + + if ((ch >= 'a' && ch <= 'z') || + (ch >= '0' && ch <= '9') || + (ch == '_')) + { + /* okay */ + } + else + { + safe = false; + if (ch == *q_char) + nquotes++; + } + } + + if (quote_all_identifiers) + safe = false; + + if (safe) + { + /* + * Check for keyword. We quote keywords except for unreserved ones. + * (In some cases we could avoid quoting a col_name or type_func_name + * keyword, but it seems much harder than it's worth to tell that.) + * + * Note: ScanKeywordLookup() does case-insensitive comparison, but + * that's fine, since we already know we have all-lower-case. + */ + int kwnum = ScanKeywordLookup(ident, &ScanKeywords); + + if (kwnum >= 0 && ScanKeywordCategories[kwnum] != UNRESERVED_KEYWORD) + safe = false; + } + + if (safe) + return ident; /* no change needed */ + + /* ----- + * Create new ident: + * - Enclose by q_char arg + * - Add escape for quotes char + * + * Note: + * - nquote: number of quote char need to escape + * - 2: number of outer quote. + * - 1: null terminator. + * ----- + */ + result = (char *) palloc0(strlen(ident) + nquotes + 2 + 1); + + optr = result; + *optr++ = *q_char; + for (ptr = ident; *ptr; ptr++) + { + char ch = *ptr; + + if (ch == *q_char) + *optr++ = *q_char; + *optr++ = ch; + } + *optr++ = *q_char; + *optr = '\0'; + + return result; +} + +/* + * Build the targetlist for given relation to be deparsed as SELECT clause. + * + * The output targetlist contains the columns that need to be fetched from the + * foreign server for the given relation. If foreignrel is an upper relation, + * then the output targetlist can also contain expressions to be evaluated on + * foreign server. + */ +List * +odbc_build_tlist_to_deparse(RelOptInfo *foreignrel) +{ + List *tlist = NIL; + OdbcFdwRelationInfo *fpinfo = (OdbcFdwRelationInfo *) foreignrel->fdw_private; + ListCell *lc; + + /* + * For an upper relation, we have already built the target list while + * checking shippability, so just return that. + */ + if (IS_UPPER_REL(foreignrel)) + return fpinfo->grouped_tlist; + + /* + * We require columns specified in foreignrel->reltarget->exprs and those + * required for evaluating the local conditions. + */ + tlist = add_to_flat_tlist(tlist, + pull_var_clause((Node *) foreignrel->reltarget->exprs, + PVC_RECURSE_PLACEHOLDERS)); + foreach(lc, fpinfo->local_conds) + { + RestrictInfo *rinfo = lfirst_node(RestrictInfo, lc); + + tlist = add_to_flat_tlist(tlist, + pull_var_clause((Node *) rinfo->clause, + PVC_RECURSE_PLACEHOLDERS)); + } + + return tlist; +} + +/* + * Return true if str existed in list string + */ +static bool +odbc_is_str_exist_in_list(char *str, const char **list) +{ + int i; + + if (list == NULL || /* NULL list */ + list[0] == NULL || /* List length = 0 */ + str == NULL) /* Input function name = NULL */ + return false; + + for (i = 0; list[i]; i++) + { + if (strcmp(str, list[i]) == 0) + return true; + } + return false; +} + +/* + * Deconstruct constant array to C array. + */ +static void +odbc_deconstruct_constant_array(Const *node, bool **elem_nulls, Datum **elem_values, Oid *elmtype, int *num_elems) +{ + ArrayType *array; + int16 elmlen; + bool elmbyval; + char elmalign; + + array = DatumGetArrayTypeP(node->constvalue); + *elmtype = ARR_ELEMTYPE(array); + + get_typlenbyvalalign(*elmtype, &elmlen, &elmbyval, &elmalign); + deconstruct_array(array, *elmtype, elmlen, elmbyval, elmalign, + elem_values, elem_nulls, num_elems); +} + +/* + * Return true if the type has fully supported by odbc_fdw + * this type refer from the Map ODBC data types to PostgreSQL: sql_data_type() + */ +static bool +odbc_is_supported_type(Oid type) +{ + switch (type) + { + /* SQL_CHAR, SQL_WCHAR */ + case CHAROID: + case BPCHAROID: + /* SQL_VARCHAR, SQL_WVARCHAR */ + case VARCHAROID: + /* SQL_LONGVARCHAR, SQL_WLONGVARCHAR */ + case TEXTOID: + /* SQL_DECIMAL, SQL_NUMERIC */ + case NUMERICOID: + /* SQL_SMALLINT, SQL_TINYINT */ + case INT2OID: + /* SQL_INTEGER */ + case INT4OID: + /* SQL_BIGINT */ + case INT8OID: + /* SQL_REAL, SQL_FLOAT */ + case FLOAT4OID: + /* SQL_DOUBLE */ + case FLOAT8OID: + /* SQL_BIT */ + case BOOLOID: + /* SQL_TIME, SQL_TYPE_TIME*/ + case TIMEOID: + /* SQL_TIMESTAMP, SQL_TYPE_TIMESTAMP */ + case TIMESTAMPOID: + /* SQL_DATE, SQL_TYPE_DATE */ + case DATEOID: + /* SQL_GUID */ + case UUIDOID: + return true; + default: + return false; + } +} + +/* + * Return true if function is common function can pushdown to Odbc + */ +static bool +odbc_is_supported_builtin_func(Oid funcid, char *in) +{ + if (!odbc_is_builtin(funcid) || + !odbc_is_str_exist_in_list(in, OdbcCommonFunctions)) + return false; + + return true; +} diff --git a/expected/13.4/mysql/char.out b/expected/13.4/mysql/char.out index 2869c72..ad3bb02 100644 --- a/expected/13.4/mysql/char.out +++ b/expected/13.4/mysql/char.out @@ -39,10 +39,10 @@ CREATE FOREIGN TABLE CHAR_TBL (f1 char, id serial OPTIONS (key 'true')) SERVER : --Testcase 7: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('a'); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'a'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -52,10 +52,10 @@ INSERT INTO char_tbl VALUES ('a'); --Testcase 9: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('A'); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'A'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -66,10 +66,10 @@ INSERT INTO char_tbl VALUES ('A'); --Testcase 11: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('1'); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -79,10 +79,10 @@ INSERT INTO char_tbl VALUES ('1'); --Testcase 13: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES (2); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '2'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -92,10 +92,10 @@ INSERT INTO char_tbl VALUES (2); --Testcase 15: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('3'); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '3'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -106,10 +106,10 @@ INSERT INTO char_tbl VALUES ('3'); --Testcase 17: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES (''); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: ' '::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -127,10 +127,10 @@ psql:sql/13.4/char.sql:62: ERROR: value too long for type character(1) --Testcase 21: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('c '); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'c'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -145,7 +145,7 @@ SELECT f1 FROM CHAR_TBL; Foreign Scan on public.char_tbl (cost=25.00..32.00 rows=7 width=8) Output: f1 Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl (4 rows) --Testcase 24: @@ -161,19 +161,20 @@ SELECT f1 FROM CHAR_TBL; c (7 rows) +-- For Char, varchar, text in MySQL, comparison is case-insensitive. +-- Result at MySQL will not same as Postgres. --Testcase 25: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 <> 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 <> 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 <> 'a')) +(4 rows) --Testcase 26: SELECT c.f1 @@ -181,27 +182,25 @@ SELECT c.f1 WHERE c.f1 <> 'a'; f1 ---- - A 1 2 3 c -(6 rows) +(5 rows) --Testcase 27: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 = 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 = 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 = 'a')) +(4 rows) --Testcase 28: SELECT c.f1 @@ -210,21 +209,21 @@ SELECT c.f1 f1 ---- a -(1 row) + A +(2 rows) --Testcase 29: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 < 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 < 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 < 'a')) +(4 rows) --Testcase 30: SELECT c.f1 @@ -243,14 +242,13 @@ EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 <= 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 <= 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 <= 'a')) +(4 rows) --Testcase 32: SELECT c.f1 @@ -259,25 +257,25 @@ SELECT c.f1 f1 ---- a + A 1 2 3 -(5 rows) +(6 rows) --Testcase 33: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 > 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 > 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 > 'a')) +(4 rows) --Testcase 34: SELECT c.f1 @@ -285,23 +283,21 @@ SELECT c.f1 WHERE c.f1 > 'a'; f1 ---- - A c -(2 rows) +(1 row) --Testcase 35: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 >= 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 >= 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 >= 'a')) +(4 rows) --Testcase 36: SELECT c.f1 @@ -324,10 +320,10 @@ CREATE FOREIGN TABLE CHAR_TBL(f1 char(4), id serial OPTIONS (key 'true')) SERVER --Testcase 39: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('a'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=24) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl_2`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'a '::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -337,10 +333,10 @@ INSERT INTO CHAR_TBL VALUES ('a'); --Testcase 41: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('ab'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=24) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl_2`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'ab '::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -350,10 +346,10 @@ INSERT INTO CHAR_TBL VALUES ('ab'); --Testcase 43: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcd'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=24) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl_2`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'abcd'::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -363,17 +359,17 @@ INSERT INTO CHAR_TBL VALUES ('abcd'); --Testcase 45: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcde'); -psql:sql/13.4/char.sql:154: ERROR: value too long for type character(4) +psql:sql/13.4/char.sql:156: ERROR: value too long for type character(4) --Testcase 46: INSERT INTO CHAR_TBL VALUES ('abcde'); -psql:sql/13.4/char.sql:156: ERROR: value too long for type character(4) +psql:sql/13.4/char.sql:158: ERROR: value too long for type character(4) --Testcase 47: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcd '); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=24) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl_2`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'abcd'::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -387,7 +383,7 @@ EXPLAIN VERBOSE SELECT f1 FROM CHAR_TBL; Foreign Scan on public.char_tbl (cost=25.00..29.00 rows=4 width=20) Output: f1 Foreign Table Size: 4 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl_2` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl_2 (4 rows) --Testcase 50: @@ -402,7 +398,7 @@ SELECT f1 FROM CHAR_TBL; --Testcase 51: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/13.4/char.sql:168: NOTICE: drop cascades to 2 other objects +psql:sql/13.4/char.sql:170: NOTICE: drop cascades to 2 other objects DETAIL: drop cascades to user mapping for public on server mysql_server drop cascades to foreign table char_tbl --Testcase 52: diff --git a/expected/13.4/mysql/date.out b/expected/13.4/mysql/date.out index bce0f3e..47afca3 100644 --- a/expected/13.4/mysql/date.out +++ b/expected/13.4/mysql/date.out @@ -176,7 +176,7 @@ SELECT f1 as "date", Foreign Scan on public.date_tbl (cost=25.00..41.05 rows=15 width=116) Output: f1, date_part('year'::text, (f1)::timestamp without time zone), date_part('month'::text, (f1)::timestamp without time zone), date_part('day'::text, (f1)::timestamp without time zone), date_part('quarter'::text, (f1)::timestamp without time zone), date_part('decade'::text, (f1)::timestamp without time zone), date_part('century'::text, (f1)::timestamp without time zone), date_part('millennium'::text, (f1)::timestamp without time zone), date_part('isoyear'::text, (f1)::timestamp without time zone), date_part('week'::text, (f1)::timestamp without time zone), date_part('dow'::text, (f1)::timestamp without time zone), date_part('isodow'::text, (f1)::timestamp without time zone), date_part('doy'::text, (f1)::timestamp without time zone), date_part('julian'::text, (f1)::timestamp without time zone), date_part('epoch'::text, (f1)::timestamp without time zone) Foreign Table Size: 15 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`date_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.date_tbl (4 rows) --Testcase 29: diff --git a/expected/13.4/mysql/delete.out b/expected/13.4/mysql/delete.out index ae3853b..675caba 100644 --- a/expected/13.4/mysql/delete.out +++ b/expected/13.4/mysql/delete.out @@ -24,16 +24,15 @@ INSERT INTO delete_test (a) VALUES (100); -- allow an alias to be specified for DELETE's target table --Testcase 5: EXPLAIN VERBOSE DELETE FROM delete_test AS dt WHERE dt.a > 75; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Delete on public.delete_test dt (cost=25.00..28.00 rows=3 width=4) - Remote SQL: DELETE FROM `odbc_fdw_regress`.`delete_test` WHERE `id` = ? + Remote SQL: DELETE FROM odbc_fdw_regress.delete_test WHERE id = ? -> Foreign Scan on public.delete_test dt (cost=25.00..28.00 rows=3 width=4) Output: id - Filter: (dt.a > 75) Foreign Table Size: 3 b - Remote SQL: SELECT `id`,`a`,`b` FROM `odbc_fdw_regress`.`delete_test` -(7 rows) + Remote SQL: SELECT id FROM odbc_fdw_regress.delete_test WHERE ((a > 75)) +(6 rows) --Testcase 6: DELETE FROM delete_test AS dt WHERE dt.a > 75; @@ -58,7 +57,7 @@ EXPLAIN VERBOSE SELECT id, a, char_length(b) FROM delete_test; Foreign Scan on public.delete_test (cost=25.00..27.00 rows=2 width=12) Output: id, a, char_length(b) Foreign Table Size: 2 b - Remote SQL: SELECT `id`,`a`,`b` FROM `odbc_fdw_regress`.`delete_test` + Remote SQL: SELECT id, a, b FROM odbc_fdw_regress.delete_test (4 rows) --Testcase 10: @@ -72,16 +71,15 @@ SELECT id, a, char_length(b) FROM delete_test; -- delete a row with a TOASTed value --Testcase 11: EXPLAIN VERBOSE DELETE FROM delete_test WHERE a > 25; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Delete on public.delete_test (cost=25.00..27.00 rows=2 width=4) - Remote SQL: DELETE FROM `odbc_fdw_regress`.`delete_test` WHERE `id` = ? + Remote SQL: DELETE FROM odbc_fdw_regress.delete_test WHERE id = ? -> Foreign Scan on public.delete_test (cost=25.00..27.00 rows=2 width=4) Output: id - Filter: (delete_test.a > 25) Foreign Table Size: 2 b - Remote SQL: SELECT `id`,`a`,`b` FROM `odbc_fdw_regress`.`delete_test` -(7 rows) + Remote SQL: SELECT id FROM odbc_fdw_regress.delete_test WHERE ((a > 25)) +(6 rows) --Testcase 12: DELETE FROM delete_test WHERE a > 25; @@ -92,7 +90,7 @@ EXPLAIN VERBOSE SELECT id, a, char_length(b) FROM delete_test; Foreign Scan on public.delete_test (cost=25.00..26.00 rows=1 width=12) Output: id, a, char_length(b) Foreign Table Size: 1 b - Remote SQL: SELECT `id`,`a`,`b` FROM `odbc_fdw_regress`.`delete_test` + Remote SQL: SELECT id, a, b FROM odbc_fdw_regress.delete_test (4 rows) --Testcase 14: diff --git a/expected/13.4/mysql/float4.out b/expected/13.4/mysql/float4.out index 6ea5a08..c4dcc4c 100644 --- a/expected/13.4/mysql/float4.out +++ b/expected/13.4/mysql/float4.out @@ -254,7 +254,11 @@ SELECT (f1::float4) AS float4 FROM FLOAT4_TBL; -------- (0 rows) --- +-- The comparison of floating-point values for equality is not safe +-- because of the rounding errors when converting between binary and decimal. +-- A floating-point value as written in an SQL statement may not be +-- the same as the value represented internally. +-- E.g: binary value of 1004.3 may be 1004.2999999999999 --Testcase 61: ALTER FOREIGN TABLE FLOAT4_TBL OPTIONS (SET table 'float4_tbl'); --Testcase 62: @@ -273,35 +277,37 @@ SELECT '' AS four, f1 FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3'; four | f1 ------+------------- | 0 + | 1004.3 | -34.84 | 1.23457e+20 | 1.23457e-20 -(4 rows) +(5 rows) --Testcase 64: SELECT '' AS one, f1 FROM FLOAT4_TBL f WHERE f.f1 = '1004.3'; - one | f1 ------+-------- - | 1004.3 -(1 row) + one | f1 +-----+---- +(0 rows) --Testcase 65: SELECT '' AS three, f1 FROM FLOAT4_TBL f WHERE '1004.3' > f.f1; three | f1 -------+------------- | 0 + | 1004.3 | -34.84 | 1.23457e-20 -(3 rows) +(4 rows) --Testcase 66: SELECT '' AS three, f1 FROM FLOAT4_TBL f WHERE f.f1 < '1004.3'; three | f1 -------+------------- | 0 + | 1004.3 | -34.84 | 1.23457e-20 -(3 rows) +(4 rows) --Testcase 67: SELECT '' AS four, f.f1 FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1; @@ -366,7 +372,7 @@ SELECT '' AS three, f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f -- test divide by zero --Testcase 73: SELECT '' AS bad, f.f1 / '0.0' from FLOAT4_TBL f; -psql:sql/13.4/float4.sql:183: ERROR: division by zero +psql:sql/13.4/float4.sql:187: ERROR: division by zero --Testcase 74: SELECT '' AS five, f1 FROM FLOAT4_TBL; five | f1 @@ -427,7 +433,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('32767.6'::float4); --Testcase 84: SELECT f1::int2 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:216: ERROR: smallint out of range +psql:sql/13.4/float4.sql:220: ERROR: smallint out of range -- --Testcase 85: DELETE FROM FLOAT4_TBL; @@ -447,7 +453,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-32768.6'::float4); --Testcase 90: SELECT f1::int2 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:230: ERROR: smallint out of range +psql:sql/13.4/float4.sql:234: ERROR: smallint out of range -- --Testcase 91: DELETE FROM FLOAT4_TBL; @@ -539,7 +545,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-9223380000000000000'::float4); --Testcase 114: SELECT f1::int8 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:286: ERROR: bigint out of range +psql:sql/13.4/float4.sql:290: ERROR: bigint out of range -- Test for correct input rounding in edge cases. -- These lists are from Paxson 1991, excluding subnormals and -- inputs of over 9 sig. digits. @@ -625,6 +631,6 @@ SELECT float4send(f1) FROM FLOAT4_TBL; DROP FOREIGN TABLE FLOAT4_TBL; --Testcase 137: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/13.4/float4.sql:351: NOTICE: drop cascades to user mapping for public on server mysql_server +psql:sql/13.4/float4.sql:355: NOTICE: drop cascades to user mapping for public on server mysql_server --Testcase 138: DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/expected/13.4/mysql/float8.out b/expected/13.4/mysql/float8.out index 8eaf694..d3f488b 100644 --- a/expected/13.4/mysql/float8.out +++ b/expected/13.4/mysql/float8.out @@ -19,10 +19,10 @@ CREATE FOREIGN TABLE FLOAT8_TBL(f1 float8, id serial OPTIONS (key 'true')) SERVE --Testcase 5: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 '); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '0'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -32,10 +32,10 @@ INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 '); --Testcase 7: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 '); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1004.3'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -45,10 +45,10 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 '); --Testcase 9: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-34.84'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -61,7 +61,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200'); QUERY PLAN -------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1.2345678901234e+200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -74,7 +74,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200'); QUERY PLAN -------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1.2345678901234e-200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -178,7 +178,7 @@ SELECT '' AS five, f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 32: @@ -195,14 +195,13 @@ SELECT '' AS five, f1 FROM FLOAT8_TBL; --Testcase 33: EXPLAIN VERBOSE SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: (f.f1 <> '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 <> 1004.3)) +(4 rows) --Testcase 34: SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; @@ -217,14 +216,13 @@ SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; --Testcase 35: EXPLAIN VERBOSE SELECT '' AS one, f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: (f.f1 = '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 = 1004.3)) +(4 rows) --Testcase 36: SELECT '' AS one, f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; @@ -236,14 +234,13 @@ SELECT '' AS one, f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; --Testcase 37: EXPLAIN VERBOSE SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: ('1004.3'::double precision > f.f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((1004.3 > f1)) +(4 rows) --Testcase 38: SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; @@ -257,14 +254,13 @@ SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; --Testcase 39: EXPLAIN VERBOSE SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: (f.f1 < '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 < 1004.3)) +(4 rows) --Testcase 40: SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; @@ -278,14 +274,13 @@ SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; --Testcase 41: EXPLAIN VERBOSE SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: ('1004.3'::double precision >= f.f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((1004.3 >= f1)) +(4 rows) --Testcase 42: SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; @@ -300,14 +295,13 @@ SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; --Testcase 43: EXPLAIN VERBOSE SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: (f.f1 <= '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 <= 1004.3)) +(4 rows) --Testcase 44: SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3'; @@ -324,14 +318,13 @@ EXPLAIN VERBOSE SELECT '' AS three, f.f1, f.f1 * '-10' AS x FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (f1 * '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 46: SELECT '' AS three, f.f1, f.f1 * '-10' AS x @@ -349,14 +342,13 @@ EXPLAIN VERBOSE SELECT '' AS three, f.f1, f.f1 + '-10' AS x FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (f1 + '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 48: SELECT '' AS three, f.f1, f.f1 + '-10' AS x @@ -374,14 +366,13 @@ EXPLAIN VERBOSE SELECT '' AS three, f.f1, f.f1 / '-10' AS x FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (f1 / '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 50: SELECT '' AS three, f.f1, f.f1 / '-10' AS x @@ -399,14 +390,13 @@ EXPLAIN VERBOSE SELECT '' AS three, f.f1, f.f1 - '-10' AS x FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (f1 - '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 52: SELECT '' AS three, f.f1, f.f1 - '-10' AS x @@ -423,14 +413,13 @@ SELECT '' AS three, f.f1, f.f1 - '-10' AS x EXPLAIN VERBOSE SELECT '' AS one, f.f1 ^ '2.0' AS square_f1 FROM FLOAT8_TBL f where f.f1 = '1004.3'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, (f1 ^ '2'::double precision) - Filter: (f.f1 = '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 = 1004.3)) +(4 rows) --Testcase 54: SELECT '' AS one, f.f1 ^ '2.0' AS square_f1 @@ -450,7 +439,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (@ f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 56: @@ -475,7 +464,7 @@ SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, trunc(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 58: @@ -500,7 +489,7 @@ SELECT '' AS five, f.f1, round(f.f1) AS round_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, round(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 60: @@ -524,7 +513,7 @@ select ceil(f1) as ceil_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ceil(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 62: @@ -546,7 +535,7 @@ select ceiling(f1) as ceiling_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ceiling(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 64: @@ -569,7 +558,7 @@ select floor(f1) as floor_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: floor(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 66: @@ -592,7 +581,7 @@ select sign(f1) as sign_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: sign(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 68: @@ -647,14 +636,13 @@ EXPLAIN VERBOSE SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (|/ f1) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 75: SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 @@ -673,14 +661,13 @@ EXPLAIN VERBOSE SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1 FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.02 rows=5 width=48) Output: ''::text, f1, exp(ln(f1)) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 77: SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1 @@ -701,7 +688,7 @@ SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (||/ f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 79: @@ -723,7 +710,7 @@ SELECT '' AS five, f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 81: @@ -742,16 +729,15 @@ EXPLAIN VERBOSE UPDATE FLOAT8_TBL SET f1 = FLOAT8_TBL.f1 * '-1' WHERE FLOAT8_TBL.f1 > '0.0'; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Update on public.float8_tbl (cost=25.00..30.01 rows=5 width=16) - Remote SQL: UPDATE `odbc_fdw_regress`.`float8_tbl` SET `f1` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.float8_tbl SET f1 = ? WHERE id = ? -> Foreign Scan on public.float8_tbl (cost=25.00..30.01 rows=5 width=16) Output: (f1 * '-1'::double precision), id, id - Filter: (float8_tbl.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(7 rows) + Remote SQL: SELECT f1, id FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(6 rows) --Testcase 83: UPDATE FLOAT8_TBL @@ -765,7 +751,7 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, (f1 * '1e+200'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 85: @@ -779,7 +765,7 @@ SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, (f1 ^ '1e+200'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 87: @@ -793,14 +779,13 @@ psql:sql/13.4/float8.sql:268: ERROR: value out of range: overflow --Testcase 90: EXPLAIN VERBOSE SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, ln(f1) - Filter: (f.f1 = '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 = 0)) +(4 rows) --Testcase 91: SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; @@ -808,14 +793,13 @@ psql:sql/13.4/float8.sql:278: ERROR: cannot take logarithm of zero --Testcase 92: EXPLAIN VERBOSE SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, ln(f1) - Filter: (f.f1 < '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 < 0)) +(4 rows) --Testcase 93: SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; @@ -828,7 +812,7 @@ SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, exp(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 95: @@ -842,7 +826,7 @@ SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, (f1 / '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 97: @@ -856,7 +840,7 @@ SELECT '' AS five, f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 99: @@ -925,11 +909,11 @@ DELETE FROM FLOAT8_TBL; QUERY PLAN ----------------------------------------------------------------------------- Delete on public.float8_tbl (cost=25.00..30.00 rows=5 width=4) - Remote SQL: DELETE FROM `odbc_fdw_regress`.`float8_tbl` WHERE `id` = ? + Remote SQL: DELETE FROM odbc_fdw_regress.float8_tbl WHERE id = ? -> Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=4) Output: id Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT id FROM odbc_fdw_regress.float8_tbl (6 rows) --Testcase 110: @@ -937,10 +921,10 @@ DELETE FROM FLOAT8_TBL; --Testcase 111: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '0'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -950,10 +934,10 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0'); --Testcase 113: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-34.84'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -966,7 +950,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30'); QUERY PLAN ------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1004.3'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -979,7 +963,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200'); QUERY PLAN --------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1.2345678901234e+200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -992,7 +976,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200'); QUERY PLAN --------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1.2345678901234e-200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1007,7 +991,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 122: diff --git a/expected/13.4/mysql/function_pushdown.out b/expected/13.4/mysql/function_pushdown.out new file mode 100644 index 0000000..162cd3b --- /dev/null +++ b/expected/13.4/mysql/function_pushdown.out @@ -0,0 +1,1861 @@ +-- +-- MySQL +-- +\set ECHO none +\i sql/13.4/function_pushdown.sql +-- +-- function push-down +-- +--Testcase 1: +CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; +--Testcase 2: +CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME + OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); +--Testcase 3: +CREATE USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); +--Testcase 4: +CREATE FOREIGN TABLE s1(id int, tag1 text, value1 float, value2 int, value3 float, value4 int, value5 numeric, str1 text, str2 text) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 's1'); +--Testcase 5: +CREATE FOREIGN TABLE tbl04 (id int OPTIONS (key 'true'), c1 float8, c2 bigint, c3 text, c4 boolean, c5 timestamp) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl04'); +--Testcase 6: +EXPLAIN VERBOSE +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=4) + Output: NULLIF(value2, 100) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 WHERE ((nullif(value2, 100) IS NULL)) +(4 rows) + +--Testcase 7: +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + nullif +-------- + + + +(3 rows) + +-- numeric function +--Testcase 8: +EXPLAIN VERBOSE +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: abs(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((abs(value1) > 1)) +(4 rows) + +--Testcase 9: +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + abs +----- + 1.1 + 2.2 + 3.3 +(3 rows) + +--Testcase 10: +EXPLAIN VERBOSE +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: acos(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((value1 < 1)) AND ((acos(value1) > 1)) +(4 rows) + +--Testcase 11: +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + acos +-------------------- + 1.4706289056333368 + 1.369438406004566 + 1.2661036727794992 +(3 rows) + +--Testcase 12: +EXPLAIN VERBOSE +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: asin(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((value1 < 1)) AND ((asin(value1) < 1)) +(4 rows) + +--Testcase 13: +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + asin +-------------------- + 0.1001674211615598 + 0.2013579207903308 + 0.3046926540153975 +(3 rows) + +--Testcase 14: +EXPLAIN VERBOSE +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: atan((id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id FROM odbc_fdw_regress.s1 WHERE ((atan(id) > 0.2)) +(4 rows) + +--Testcase 15: +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + atan +-------------------- + 0.7853981633974483 + 1.1071487177940904 + 1.2490457723982544 + 1.3258176636680326 + 1.373400766945016 +(5 rows) + +--Testcase 16: +EXPLAIN VERBOSE +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: atan2('3.141592653589793'::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id FROM odbc_fdw_regress.s1 WHERE ((atan2(3.141592653589793, id) > 0.2)) +(4 rows) + +--Testcase 17: +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + atan2 +-------------------- + 1.5707963267948966 + 1.2626272556789118 + 1.0038848218538872 + 0.808448792630022 + 0.6657737500283538 + 0.5609821161086238 +(6 rows) + +--Testcase 18: +EXPLAIN VERBOSE +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ceil(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((ceil(value1) > 0)) +(4 rows) + +--Testcase 19: +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + ceil +------ + 1 + 1 + 1 + 2 + 3 + 4 +(6 rows) + +--Testcase 20: +EXPLAIN VERBOSE +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ceiling(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((ceiling(value1) > 0)) +(4 rows) + +--Testcase 21: +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + ceiling +--------- + 1 + 1 + 1 + 2 + 3 + 4 +(6 rows) + +--Testcase 22: +EXPLAIN VERBOSE +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: cos(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((cos(value1) > 0)) +(4 rows) + +--Testcase 23: +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + cos +-------------------- + 0.9950041652780258 + 0.9800665778412416 + 0.955336489125606 + 0.4535961214255773 +(4 rows) + +--Testcase 24: +EXPLAIN VERBOSE +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: cot(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((cot(value1) > 0)) +(4 rows) + +--Testcase 25: +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + cot +-------------------- + 9.966644423259238 + 4.933154875586893 + 3.2327281437658275 + 0.5089681052390643 + 6.259947539437359 +(5 rows) + +--Testcase 26: +EXPLAIN VERBOSE +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: degrees(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((degrees(value1) > 0)) +(4 rows) + +--Testcase 27: +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + degrees +-------------------- + 5.729577951308232 + 11.459155902616464 + 17.188733853924695 + 63.02535746439056 + 126.05071492878112 + 189.07607239317164 +(6 rows) + +--Testcase 28: +EXPLAIN VERBOSE +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: exp(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((exp(value1) > 0)) +(4 rows) + +--Testcase 29: +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + exp +-------------------- + 1.1051709180756477 + 1.2214027581601699 + 1.3498588075760032 + 3.0041660239464334 + 9.025013499434122 + 27.112638920657883 +(6 rows) + +--Testcase 30: +EXPLAIN VERBOSE +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: floor(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((floor(value1) > 0)) +(4 rows) + +--Testcase 31: +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + floor +------- + 1 + 2 + 3 +(3 rows) + +--Testcase 32: +EXPLAIN VERBOSE +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ln(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((ln(value1) > 0)) +(4 rows) + +--Testcase 33: +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + ln +--------------------- + 0.09531017980432493 + 0.7884573603642703 + 1.1939224684724346 +(3 rows) + +--Testcase 34: +EXPLAIN VERBOSE +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=64) + Output: value5, log('2'::numeric, value5) + Foreign Table Size: 6 b + Remote SQL: SELECT value5 FROM odbc_fdw_regress.s1 WHERE ((log(2, value5) > 0)) +(4 rows) + +--Testcase 35: +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + value5 | log +--------+--------------------- + 1.1 | 0.13750352374993491 + 1.2 | 0.2630344058337938 + 1.3 | 0.3785116232537298 +(3 rows) + +--Testcase 37: +EXPLAIN VERBOSE +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: log(value1) + Filter: (log(s1.value1) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 38: +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + log +--------------------- + 0.04139268515822507 + 0.3424226808222063 + 0.5185139398778874 +(3 rows) + +--Testcase 39: +EXPLAIN VERBOSE +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: log10(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((log10(value1) > 0)) +(4 rows) + +--Testcase 40: +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + log10 +--------------------- + 0.04139268515822507 + 0.3424226808222063 + 0.5185139398778874 +(3 rows) + +--Testcase 41: +EXPLAIN VERBOSE +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=4) + Output: mod(value2, (id + 1)) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM odbc_fdw_regress.s1 WHERE ((mod(value2, (id + 1)) > 0)) +(4 rows) + +--Testcase 42: +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + mod +----- + 1 + 2 +(2 rows) + +--Testcase 43: +EXPLAIN VERBOSE +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + QUERY PLAN +---------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: pow((value2)::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM odbc_fdw_regress.s1 WHERE ((pow(value2, id) > 0)) +(4 rows) + +--Testcase 44: +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + pow +-------------- + 1 + 100 + 10000 + 8000000 + 1600000000 + 320000000000 +(6 rows) + +--Testcase 45: +EXPLAIN VERBOSE +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + QUERY PLAN +------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: power((value2)::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM odbc_fdw_regress.s1 WHERE ((power(value2, id) > 0)) +(4 rows) + +--Testcase 46: +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + power +-------------- + 1 + 100 + 10000 + 8000000 + 1600000000 + 320000000000 +(6 rows) + +--Testcase 47: +EXPLAIN VERBOSE +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: radians(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((radians(value1) > 0)) +(4 rows) + +--Testcase 48: +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + radians +----------------------- + 0.0017453292519943296 + 0.003490658503988659 + 0.005235987755982988 + 0.019198621771937627 + 0.038397243543875255 + 0.05759586531581287 +(6 rows) + +--Testcase 49: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: round(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((round(value1) > 0)) +(4 rows) + +--Testcase 50: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + round +------- + 1 + 2 + 3 +(3 rows) + +--Testcase 51: +EXPLAIN VERBOSE +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=16) + Output: sign(value3), value3 + Foreign Table Size: 6 b + Remote SQL: SELECT value3 FROM odbc_fdw_regress.s1 WHERE ((sign(value3) = (-1))) +(4 rows) + +--Testcase 52: +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + sign | value3 +------+-------- + -1 | -0.1 + -1 | -0.2 + -1 | -0.3 + -1 | -1.1 + -1 | -2.2 + -1 | -3.3 +(6 rows) + +--Testcase 53: +EXPLAIN VERBOSE +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: sin(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((sin(value1) > 0)) +(4 rows) + +--Testcase 54: +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + sin +--------------------- + 0.09983341664682815 + 0.19866933079506122 + 0.29552020666133955 + 0.8912073600614354 + 0.8084964038195901 +(5 rows) + +--Testcase 55: +EXPLAIN VERBOSE +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: sqrt(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((sqrt(value1) > 0)) +(4 rows) + +--Testcase 56: +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + sqrt +--------------------- + 0.31622776601683794 + 0.4472135954999579 + 0.5477225575051661 + 1.0488088481701516 + 1.4832396974191326 + 1.816590212458495 +(6 rows) + +--Testcase 57: +EXPLAIN VERBOSE +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: tan(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((tan(value1) > 0)) +(4 rows) + +--Testcase 58: +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + tan +--------------------- + 0.10033467208545055 + 0.2027100355086725 + 0.30933624960962325 + 1.9647596572486523 + 0.15974574766003222 +(5 rows) + +--Testcase 59: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: round(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((round(value1) > 0)) +(4 rows) + +--Testcase 60: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + round +------- + 1 + 2 + 3 +(3 rows) + +-- date/time function: +--Testcase 61: +EXPLAIN VERBOSE +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: date(c5) + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM odbc_fdw_regress.tbl04 WHERE ((date(c5) > '1970-01-01')) +(4 rows) + +--Testcase 62: +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + date +------------ + 01-01-2000 + 01-01-2000 + 01-01-2000 + 11-01-1990 + 11-01-2010 + 10-01-1999 + 10-01-2010 + 10-01-1999 + 10-01-2010 +(9 rows) + +-- string function: +--Testcase 63: +EXPLAIN VERBOSE +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: ascii(str1), ascii(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((ascii(str1) > 0)) +(4 rows) + +--Testcase 64: +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + ascii | ascii +-------+------- + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 +(6 rows) + +--Testcase 65: +-- for bit_length() function, postgre's core will optimize it to octet_length() * 8 and push it down +EXPLAIN VERBOSE +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=8) + Output: (octet_length(str1) * 8), (octet_length(str2) * 8) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE (((octet_length(str1) * 8) > 0)) +(4 rows) + +--Testcase 66: +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + bit_length | bit_length +------------+------------ + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 +(6 rows) + +--Testcase 67: +EXPLAIN VERBOSE +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2) + Filter: (btrim(s1.str2) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 68: +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 69: +EXPLAIN VERBOSE +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2, ' '::text) + Filter: (btrim(s1.str2, ' '::text) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 70: +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 71: +EXPLAIN VERBOSE +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: char_length(str1), char_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((char_length(str1) > 0)) +(4 rows) + +--Testcase 72: +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + char_length | char_length +-------------+------------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 73: +EXPLAIN VERBOSE +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: character_length(str1), character_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((character_length(str1) > 0)) +(4 rows) + +--Testcase 74: +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + character_length | character_length +------------------+------------------ + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 75: +EXPLAIN VERBOSE +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: concat(str1, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((concat(str1, str2) LIKE '---XYZ--- XYZ ')) +(4 rows) + +--Testcase 76: +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + concat +-------------------- + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ +(6 rows) + +--Testcase 77: +EXPLAIN VERBOSE +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: concat_ws(','::text, str1, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ ')) +(4 rows) + +--Testcase 78: +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + concat_ws +--------------------- + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ +(6 rows) + +--Testcase 79: +EXPLAIN VERBOSE +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "left"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((left(str1, 3) LIKE '---')) +(4 rows) + +--Testcase 80: +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + left +------ + --- + --- + --- + --- + --- + --- +(6 rows) + +--Testcase 81: +EXPLAIN VERBOSE +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: length(str1), length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((length(str1) > 0)) +(4 rows) + +--Testcase 82: +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + length | length +--------+-------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 83: +EXPLAIN VERBOSE +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: lower(str1), lower(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((lower(str1) LIKE '%xyz%')) +(4 rows) + +--Testcase 84: +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + lower | lower +-----------+----------- + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz +(6 rows) + +--Testcase 85: +EXPLAIN VERBOSE +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: lpad(str1, 20, 'ABCD'::text), lpad(str2, 20, 'ABCD'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((lpad(str1, 20, 'ABCD') LIKE '%XYZ%')) +(4 rows) + +--Testcase 86: +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + lpad | lpad +----------------------+---------------------- + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ +(6 rows) + +--Testcase 87: +EXPLAIN VERBOSE +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str2) + Filter: (ltrim(s1.str2) ~~ 'XYZ '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 88: +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + ltrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 89: +EXPLAIN VERBOSE +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str2, ' '::text) + Filter: (ltrim(s1.str2, ' '::text) ~~ 'XYZ '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 90: +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + ltrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 91: +EXPLAIN VERBOSE +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: octet_length(str1), octet_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((octet_length(str1) > 0)) +(4 rows) + +--Testcase 92: +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + octet_length | octet_length +--------------+-------------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 93: +EXPLAIN VERBOSE +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=4) + Output: "position"(str1, 'X'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((position('X' IN str1) > 0)) +(4 rows) + +--Testcase 94: +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + position +---------- + 4 + 4 + 4 + 4 + 4 + 4 +(6 rows) + +--Testcase 95: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: regexp_replace(str1, 'X..'::text, 'xyz'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%')) +(4 rows) + +--Testcase 96: +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + regexp_replace +---------------- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- +(6 rows) + +--Testcase 97: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: regexp_replace(str1, '[Y]'::text, 'y'::text, 'i'::text) + Filter: (regexp_replace(s1.str1, '[Y]'::text, 'y'::text, 'i'::text) ~~ '%XyZ%'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 98: +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + regexp_replace +---------------- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- +(6 rows) + +--Testcase 99: +EXPLAIN VERBOSE +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: repeat(str1, 3), repeat(str2, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((repeat(str2, 3) LIKE '%X%')) +(4 rows) + +--Testcase 100: +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + repeat | repeat +-----------------------------+----------------------------- + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ +(6 rows) + +--Testcase 101: +EXPLAIN VERBOSE +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + QUERY PLAN +----------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: replace(str1, 'XYZ'::text, 'ABC'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((replace(str1, 'XYZ', 'ABC') LIKE '%A%')) +(4 rows) + +--Testcase 102: +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + replace +----------- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- +(6 rows) + +--Testcase 103: +EXPLAIN VERBOSE +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: reverse(str1), reverse(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((reverse(str1) LIKE '%ZYX%')) +(4 rows) + +--Testcase 104: +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + reverse | reverse +-----------+----------- + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX +(6 rows) + +--Testcase 105: +EXPLAIN VERBOSE +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: "right"(str1, 4), "right"(str2, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((right(str1, 4) LIKE 'Z%')) +(4 rows) + +--Testcase 106: +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + right | right +-------+------- + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z +(6 rows) + +--Testcase 107: +EXPLAIN VERBOSE +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: rpad(str1, 16, str2), rpad(str1, 4, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((rpad(str1, 16, str2) LIKE '---XYZ---%')) +(4 rows) + +--Testcase 108: +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + rpad | rpad +------------------+------ + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X +(6 rows) + +--Testcase 109: +EXPLAIN VERBOSE +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str2) + Filter: (rtrim(s1.str2) ~~ '%XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 110: +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + rtrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 111: +EXPLAIN VERBOSE +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str2, ' '::text) + Filter: (rtrim(s1.str2, ' '::text) ~~ '%XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 112: +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + rtrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 113: +EXPLAIN VERBOSE +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: substr(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((substr(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 114: +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + substr +--------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 115: +EXPLAIN VERBOSE +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: substr(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 WHERE ((substr(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 116: +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + substr +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 117: +EXPLAIN VERBOSE +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((substring(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 118: +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + substring +----------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 119: +EXPLAIN VERBOSE +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 WHERE ((substring(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 120: +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + substring +----------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 121: +EXPLAIN VERBOSE +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((substring(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 122: +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + substring +----------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 123: +EXPLAIN VERBOSE +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 WHERE ((substring(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 124: +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + substring +----------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 125: +EXPLAIN VERBOSE +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2) + Filter: (btrim(s1.str2) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 126: +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 127: +EXPLAIN VERBOSE +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str1, '-'::text) + Filter: (btrim(s1.str1, '-'::text) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 128: +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 129: +EXPLAIN VERBOSE +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str1, '-'::text) + Filter: (ltrim(s1.str1, '-'::text) ~~ 'XYZ---'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 130: +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + ltrim +-------- + XYZ--- + XYZ--- + XYZ--- + XYZ--- + XYZ--- + XYZ--- +(6 rows) + +--Testcase 131: +EXPLAIN VERBOSE +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str1, '-'::text) + Filter: (btrim(s1.str1, '-'::text) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 132: +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 133: +EXPLAIN VERBOSE +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str1, '-'::text) + Filter: (rtrim(s1.str1, '-'::text) ~~ '---XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 134: +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + rtrim +-------- + ---XYZ + ---XYZ + ---XYZ + ---XYZ + ---XYZ + ---XYZ +(6 rows) + +--Testcase 135: +EXPLAIN VERBOSE +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: upper(tag1) + Foreign Table Size: 6 b + Remote SQL: SELECT tag1 FROM odbc_fdw_regress.s1 WHERE ((upper(tag1) LIKE 'A')) +(4 rows) + +--Testcase 136: +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + upper +------- + A + A + A +(3 rows) + +-- explicit cast function: +--Testcase 137: +EXPLAIN VERBOSE +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=40) + Output: cos(((value1)::numeric)::double precision), (value1)::numeric + Filter: (cos(((s1.value1)::numeric)::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 138: +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 139: +EXPLAIN VERBOSE +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.09 rows=6 width=24) + Output: cos(((value1)::numeric(10,0))::double precision), (value1)::numeric(10,0) + Filter: (cos(((s1.value1)::numeric(10,0))::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 140: +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 1 | 0 + 1 | 0 + 1 | 0 + 0.5403023058681398 | 1 +(4 rows) + +--Testcase 141: +EXPLAIN VERBOSE +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=40) + Output: cos(((value1)::numeric)::double precision), (value1)::numeric + Filter: (cos(((s1.value1)::numeric)::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 142: +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 143: +EXPLAIN VERBOSE +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.09 rows=6 width=24) + Output: cos(((value1)::numeric(10,1))::double precision), (value1)::numeric(10,1) + Filter: (cos(((s1.value1)::numeric(10,1))::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 144: +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 145: +EXPLAIN VERBOSE +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: (value2)::character(1) + Filter: ((s1.value2)::character(1) ~~ '1'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 146: +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + value2 +-------- + 1 + 1 + 1 +(3 rows) + +--Testcase 147: +EXPLAIN VERBOSE +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=32) + Output: (value2)::character varying + Filter: (((s1.value2)::character varying)::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 148: +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 149: +EXPLAIN VERBOSE +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=28) + Output: (value2)::character(6) + Filter: ((s1.value2)::character(6) ~~ '100 '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 150: +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 151: +EXPLAIN VERBOSE +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=28) + Output: (value2)::character varying(6) + Filter: (((s1.value2)::character varying(6))::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 152: +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 153: +EXPLAIN VERBOSE +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=32) + Output: (value2)::text + Filter: ((s1.value2)::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 154: +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 155: +EXPLAIN VERBOSE +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=2) + Output: (value2)::smallint + Filter: ((s1.value2)::smallint > 20) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 156: +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + value2 +-------- + 100 + 100 + 100 + 200 + 200 + 200 +(6 rows) + +--Testcase 157: +EXPLAIN VERBOSE +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + QUERY PLAN +------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c1)::integer + Filter: ((tbl04.c1)::integer > 20) + Foreign Table Size: 9 b + Remote SQL: SELECT c1 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 158: +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + c1 +------- + 31 + 2566 + 55 + 45021 + 122 + 75 + 6867 +(7 rows) + +--Testcase 159: +EXPLAIN VERBOSE +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=8) + Output: (c2)::double precision + Filter: ((tbl04.c2)::double precision > '20'::double precision) + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 160: +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + c2 +--------- + 128912 + 6565 + 1829812 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 161: +EXPLAIN VERBOSE +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c2)::real + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM odbc_fdw_regress.tbl04 WHERE ((CAST(c2 AS real) > 20)) +(4 rows) + +--Testcase 162: +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + c2 +-------------- + 128912 + 6565 + 1.829812e+06 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 163: +EXPLAIN VERBOSE +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c2)::real + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM odbc_fdw_regress.tbl04 WHERE ((CAST(c2 AS real) > 20)) +(4 rows) + +--Testcase 164: +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + c2 +-------------- + 128912 + 6565 + 1.829812e+06 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 165: +EXPLAIN VERBOSE +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c5)::date + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM odbc_fdw_regress.tbl04 WHERE ((CAST(c5 AS date) > '2001-01-01')) +(4 rows) + +--Testcase 166: +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + c5 +------------ + 11-01-2010 + 10-01-2010 + 10-01-2010 +(3 rows) + +--Testcase 167: +EXPLAIN VERBOSE +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=8) + Output: (c5)::time without time zone + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM odbc_fdw_regress.tbl04 WHERE ((CAST(c5 AS time) > '00:00:00')) +(4 rows) + +--Testcase 168: +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + c5 +---------- + 10:10:00 + 10:10:00 +(2 rows) + +--Testcase 169: +DROP FOREIGN TABLE s1; +--Testcase 170: +DROP FOREIGN TABLE tbl04; +--Testcase 171: +DROP USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME; +--Testcase 172: +DROP SERVER :DB_SERVERNAME CASCADE; +--Testcase 173: +DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/expected/13.4/mysql/insert.out b/expected/13.4/mysql/insert.out index 307a87a..50847c8 100644 --- a/expected/13.4/mysql/insert.out +++ b/expected/13.4/mysql/insert.out @@ -20,10 +20,10 @@ create foreign table inserttest (col1 int4, col2 int4 NOT NULL, col3 text defaul --Testcase 5: EXPLAIN VERBOSE insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, NULL::integer, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -35,10 +35,10 @@ psql:sql/13.4/insert.sql:19: ERROR: Executing ODBC query --Testcase 7: EXPLAIN VERBOSE insert into inserttest (col2, col3) values (3, DEFAULT); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 3, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -48,10 +48,10 @@ insert into inserttest (col2, col3) values (3, DEFAULT); --Testcase 9: EXPLAIN VERBOSE insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 5, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -61,10 +61,10 @@ insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT); --Testcase 11: EXPLAIN VERBOSE insert into inserttest values (DEFAULT, 5, 'test'); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 5, 'test'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -74,10 +74,10 @@ insert into inserttest values (DEFAULT, 5, 'test'); --Testcase 13: EXPLAIN VERBOSE insert into inserttest values (DEFAULT, 7); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 7, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -87,12 +87,12 @@ insert into inserttest values (DEFAULT, 7); --Testcase 15: EXPLAIN VERBOSE select col1, col2, col3 from inserttest; - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..29.00 rows=4 width=40) Output: col1, col2, col3 Foreign Table Size: 4 b - Remote SQL: SELECT `col1`,`col2`,`col3`,`id` FROM `odbc_fdw_regress`.`inserttest` + Remote SQL: SELECT col1, col2, col3 FROM odbc_fdw_regress.inserttest (4 rows) select col1, col2, col3 from inserttest; @@ -154,12 +154,12 @@ LINE 1: insert into inserttest (col1) values (DEFAULT, DEFAULT); --Testcase 24: EXPLAIN VERBOSE select col1, col2, col3 from inserttest; - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..29.00 rows=4 width=40) Output: col1, col2, col3 Foreign Table Size: 4 b - Remote SQL: SELECT `col1`,`col2`,`col3`,`id` FROM `odbc_fdw_regress`.`inserttest` + Remote SQL: SELECT col1, col2, col3 FROM odbc_fdw_regress.inserttest (4 rows) --Testcase 25: @@ -182,7 +182,7 @@ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT), QUERY PLAN -------------------------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.02..0.07 rows=3 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) InitPlan 1 (returns $0) -> Result (cost=0.00..0.01 rows=1 width=4) Output: 2 @@ -199,12 +199,12 @@ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT), --Testcase 28: EXPLAIN VERBOSE select col1, col2, col3 from inserttest; - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..32.00 rows=7 width=40) Output: col1, col2, col3 Foreign Table Size: 7 b - Remote SQL: SELECT `col1`,`col2`,`col3`,`id` FROM `odbc_fdw_regress`.`inserttest` + Remote SQL: SELECT col1, col2, col3 FROM odbc_fdw_regress.inserttest (4 rows) --Testcase 29: @@ -229,7 +229,7 @@ insert into inserttest values(30, 50, repeat('x', 10000)); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 30, 50, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -239,12 +239,12 @@ insert into inserttest values(30, 50, repeat('x', 10000)); --Testcase 32: EXPLAIN VERBOSE select col1, col2, char_length(col3) from inserttest; - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..33.02 rows=8 width=12) Output: col1, col2, char_length(col3) Foreign Table Size: 8 b - Remote SQL: SELECT `col1`,`col2`,`col3`,`id` FROM `odbc_fdw_regress`.`inserttest` + Remote SQL: SELECT col1, col2, col3 FROM odbc_fdw_regress.inserttest (4 rows) --Testcase 33: diff --git a/expected/13.4/mysql/new_test.out b/expected/13.4/mysql/new_test.out index 4e78ea6..ffbf59d 100644 --- a/expected/13.4/mysql/new_test.out +++ b/expected/13.4/mysql/new_test.out @@ -13,18 +13,18 @@ CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); --Testcase 3: -CREATE USER MAPPING FOR public SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); +CREATE USER MAPPING FOR public SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); --Primary key options --Testcase 4: -CREATE FOREIGN TABLE tbl01 (id bigint OPTIONS (key 'true'), c1 int) +CREATE FOREIGN TABLE tbl01 (id bigint OPTIONS (key 'true'), c1 int) SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl01'); --Testcase 5: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (166565, 1); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Insert on public.tbl01 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl01`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '166565'::bigint, 1 (4 rows) @@ -34,10 +34,10 @@ INSERT INTO tbl01 VALUES (166565, 1); --Testcase 7: EXPLAIN VERBOSE INSERT INTO tbl01 (c1) VALUES (3); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Insert on public.tbl01 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl01`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: NULL::bigint, 3 (4 rows) @@ -49,10 +49,10 @@ psql:sql/13.4/new_test.sql:25: ERROR: Executing ODBC query --Testcase 9: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (null, 4); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Insert on public.tbl01 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl01`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: NULL::bigint, 4 (4 rows) @@ -64,10 +64,10 @@ psql:sql/13.4/new_test.sql:30: ERROR: Executing ODBC query --Testcase 11: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (166565, 7); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Insert on public.tbl01 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl01`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '166565'::bigint, 7 (4 rows) @@ -85,7 +85,7 @@ INSERT INTO tbl02 VALUES (repeat('a', 255), 1, 12112.12, true); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Insert on public.tbl02 (cost=0.00..0.01 rows=1 width=1037) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl02`(`id`, `c1`, `c2`, `c3`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=1037) Output: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::character(255), 1, '12112.12'::double precision, true (4 rows) @@ -95,10 +95,10 @@ INSERT INTO tbl02 VALUES (repeat('a', 255), 1, 12112.12, true); --Testcase 16: EXPLAIN VERBOSE INSERT INTO tbl02 VALUES (NULL, 2, -12.23, false); - QUERY PLAN --------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Insert on public.tbl02 (cost=0.00..0.01 rows=1 width=1037) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl02`(`id`, `c1`, `c2`, `c3`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=1037) Output: NULL::character(255), 2, '-12.23'::double precision, false (4 rows) @@ -110,10 +110,10 @@ psql:sql/13.4/new_test.sql:48: ERROR: Executing ODBC query --Testcase 18: EXPLAIN VERBOSE INSERT INTO tbl02(c1) VALUES (3); - QUERY PLAN --------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Insert on public.tbl02 (cost=0.00..0.01 rows=1 width=45) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl02`(`id`, `c1`, `c2`, `c3`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=45) Output: NULL::bpchar, 3, NULL::double precision, NULL::boolean (4 rows) @@ -127,6 +127,7 @@ psql:sql/13.4/new_test.sql:53: ERROR: Executing ODBC query ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp01'); --Testcase 20: ALTER FOREIGN TABLE tbl02 ALTER COLUMN c2 SET NOT NULL; +--Testcase 77: \dS+ tbl02 Foreign table "public.tbl02" Column | Type | Collation | Nullable | Default | FDW options | Storage | Stats target | Description @@ -140,7 +141,7 @@ FDW options: (schema 'odbc_fdw_regress', "table" 'tbl02_tmp01') --Testcase 21: INSERT INTO tbl02(id, c2) VALUES ('b', NULL); -- fail -psql:sql/13.4/new_test.sql:62: ERROR: Executing ODBC query +psql:sql/13.4/new_test.sql:63: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Column 'c2' cannot be null --Testcase 22: SELECT * FROM tbl02; -- no result @@ -153,6 +154,7 @@ SELECT * FROM tbl02; -- no result ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp02'); --Testcase 23: ALTER FOREIGN TABLE tbl02 ALTER c1 OPTIONS (key 'true'); -- now, id and c1 are key +--Testcase 78: \dS+ tbl02 Foreign table "public.tbl02" Column | Type | Collation | Nullable | Default | FDW options | Storage | Stats target | Description @@ -166,20 +168,21 @@ FDW options: (schema 'odbc_fdw_regress', "table" 'tbl02_tmp02') --Testcase 73 INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- ok +--Testcase 79: INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- fail -psql:sql/13.4/new_test.sql:75: ERROR: Executing ODBC query +psql:sql/13.4/new_test.sql:78: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Duplicate entry 'a-12112' for key 'tbl02_tmp02.PRIMARY' --Testcase 74 INSERT INTO tbl02(id, c1) VALUES ('a', 13113.13); -- ok --Testcase 24: EXPLAIN VERBOSE SELECT * FROM tbl02; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------- Foreign Scan on public.tbl02 (cost=25.00..27.00 rows=2 width=1037) Output: id, c1, c2, c3 Foreign Table Size: 2 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3` FROM `odbc_fdw_regress`.`tbl02_tmp02` + Remote SQL: SELECT id, c1, c2, c3 FROM odbc_fdw_regress.tbl02_tmp02 (4 rows) --Testcase 25: @@ -196,10 +199,10 @@ CREATE FOREIGN TABLE tbl03 (id timestamp OPTIONS (key 'true'), c1 int) --Testcase 33: EXPLAIN VERBOSE INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 0); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.tbl03 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl03`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl03(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'Sat Jan 01 00:00:00 2000'::timestamp without time zone, 0 (4 rows) @@ -209,17 +212,17 @@ INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 0); --Testcase 35: EXPLAIN VERBOSE INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 1); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.tbl03 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl03`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl03(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'Sat Jan 01 00:00:00 2000'::timestamp without time zone, 1 (4 rows) --Testcase 36: INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 1); --fail -psql:sql/13.4/new_test.sql:96: ERROR: Executing ODBC query +psql:sql/13.4/new_test.sql:98: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Duplicate entry '2000-01-01 00:00:00' for key 'tbl03.PRIMARY' --WHERE clause push-down with functions in WHERE --Testcase 37: @@ -228,14 +231,13 @@ CREATE FOREIGN TABLE tbl04 (id INT OPTIONS (key 'true'), c1 float8, c2 bigint, --Testcase 38: EXPLAIN VERBOSE SELECT * FROM tbl04 WHERE abs(c1) > 3233; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) Output: id, c1, c2, c3, c4, c5 - Filter: (abs(tbl04.c1) > '3233'::double precision) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((abs(c1) > 3233)) +(4 rows) --Testcase 39: SELECT * FROM tbl04 WHERE abs(c1) > 3233; @@ -248,14 +250,13 @@ SELECT * FROM tbl04 WHERE abs(c1) > 3233; --Testcase 40: EXPLAIN VERBOSE SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=20) Output: id, c1, c2 - Filter: ((tbl04.c1 >= '0'::double precision) AND (tbl04.c2 > 0) AND (sqrt((tbl04.c2)::double precision) > sqrt(tbl04.c1))) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c1 >= 0)) AND ((c2 > 0)) AND ((sqrt(c2) > sqrt(c1))) +(4 rows) --Testcase 41: SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; @@ -272,14 +273,13 @@ SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; --Testcase 42: EXPLAIN VERBOSE SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: c1, c2 - Filter: ((tbl04.c3 || tbl04.c3) <> 'things thing'::text) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c3 || c3) <> 'things thing')) +(4 rows) --Testcase 43: SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; @@ -299,14 +299,13 @@ SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; --Testcase 44: EXPLAIN VERBOSE SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------ Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=44) Output: c1, id, (c3 || c3) - Filter: ((abs(tbl04.c2))::double precision <> abs(tbl04.c1)) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT id, c1, c3 FROM odbc_fdw_regress.tbl04 WHERE ((abs(c2) <> abs(c1))) +(4 rows) --Testcase 45: SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); @@ -326,14 +325,13 @@ SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); --Testcase 46: EXPLAIN VERBOSE SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.05 rows=9 width=44) Output: (id + id), c2, (c3 || 'afas'::text) - Filter: (floor((tbl04.c2)::double precision) > '0'::double precision) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT id, c2, c3 FROM odbc_fdw_regress.tbl04 WHERE ((floor(c2) > 0)) +(4 rows) --Testcase 47: SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; @@ -353,14 +351,13 @@ SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; --Testcase 48: EXPLAIN VERBOSE SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------ Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=49) Output: c2, c3, c4, c5 - Filter: (tbl04.c5 > 'Sat Jan 01 00:00:00 2000'::timestamp without time zone) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((c5 > '2000-01-01 00:00:00')) +(4 rows) --Testcase 49: SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; @@ -374,14 +371,13 @@ SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; --Testcase 50: EXPLAIN VERBOSE SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=17) Output: c5, c4, c2 - Filter: (tbl04.c5 = ANY ('{"Sat Jan 01 00:00:00 2000","Mon Nov 01 00:00:00 2010"}'::timestamp without time zone[])) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT c2, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (c5 IN ('2000-01-01 00:00:00', '2010-11-01 00:00:00')) +(4 rows) --Testcase 51: SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); @@ -393,25 +389,282 @@ SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); Mon Nov 01 00:00:00 2010 | f | 22342 (4 rows) ---Testcase 52: +--Testcase 245: EXPLAIN VERBOSE -SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id IN (1, 2, 3)) +(4 rows) + +--Testcase 246: +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(3 rows) + +--Testcase 247: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + QUERY PLAN +----------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id NOT IN (1, 2, 3)) +(4 rows) + +--Testcase 248: +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(6 rows) + +--Testcase 249: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); + QUERY PLAN +------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id IN (1, 3) OR (id = c2))) +(4 rows) + +--Testcase 250: +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(2 rows) + +--Testcase 251: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id NOT IN (1, 3)) AND ((id <> c2)) +(4 rows) + +--Testcase 252: +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(7 rows) + +--Testcase 253: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); + QUERY PLAN +------------------------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id NOT IN (c2, 2, 3)) +(4 rows) + +--Testcase 254: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+--------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(7 rows) + +--Testcase 255: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id = c2) AND (id = 2) AND (id = 3)) +(4 rows) + +--Testcase 256: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----+----+----+----+---- +(0 rows) + +--Testcase 257: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id <> c2) OR (id <> 2) OR (id <> 3)) +(4 rows) + +--Testcase 258: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(9 rows) + +--Testcase 259: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); QUERY PLAN -------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id IN (c2, 2, 3)) +(4 rows) + +--Testcase 260: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+---------+----+-------------------------- + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(2 rows) + +--Testcase 261: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); + QUERY PLAN +----------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id NOT IN (1, 2, 3)) +(4 rows) + +--Testcase 262: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(6 rows) + +--Testcase 263: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id = 1) AND (id = 2) AND (id = 3)) +(4 rows) + +--Testcase 264: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----+----+----+----+---- +(0 rows) + +--Testcase 265: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id <> 1) OR (id <> 2) OR (id <> 3)) +(4 rows) + +--Testcase 266: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(9 rows) + +--Testcase 267: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id IN (1, 2, 3)) +(4 rows) + +--Testcase 268: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(3 rows) + +--Testcase 52: +EXPLAIN VERBOSE +SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); + QUERY PLAN +---------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=48) Output: tbl04.c3, tbl04.c5, tbl04.c1 Filter: (SubPlan 1) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c3, c5 FROM odbc_fdw_regress.tbl04 SubPlan 1 -> Materialize (cost=25.00..34.05 rows=9 width=4) Output: tbl04_1.id -> Foreign Scan on public.tbl04 tbl04_1 (cost=25.00..34.00 rows=9 width=4) Output: tbl04_1.id - Filter: tbl04_1.c4 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(13 rows) + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 WHERE (c4) +(12 rows) --Testcase 53: SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); @@ -429,20 +682,19 @@ SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true --Testcase 54: EXPLAIN VERBOSE SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 != false) AND c1 > 0 OR c2 < 0; - QUERY PLAN --------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=56) Output: tbl04.c1, tbl04.c5, tbl04.c3, tbl04.c2 Filter: (((hashed SubPlan 1) AND (tbl04.c1 > '0'::double precision)) OR (tbl04.c2 < 0)) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2, c3, c5 FROM odbc_fdw_regress.tbl04 SubPlan 1 -> Foreign Scan on public.tbl04 tbl04_1 (cost=25.00..34.00 rows=9 width=8) Output: tbl04_1.c1 - Filter: tbl04_1.c4 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(11 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_regress.tbl04 WHERE (c4) +(10 rows) --Testcase 55: SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 != false) AND c1 > 0 OR c2 < 0; @@ -455,14 +707,14 @@ SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 ! --Testcase 56: EXPLAIN VERBOSE SELECT variance(c1), variance(c2) FROM tbl04; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.05..34.06 rows=1 width=40) Output: variance(c1), variance(c2) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 (6 rows) --Testcase 57: @@ -475,16 +727,15 @@ SELECT variance(c1), variance(c2) FROM tbl04; --Testcase 58: EXPLAIN VERBOSE SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Aggregate (cost=34.02..34.03 rows=1 width=8) Output: variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=8) Output: id, c1, c2, c3, c4, c5 - Filter: (tbl04.c3 <> 'aef'::text) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(7 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_regress.tbl04 WHERE ((c3 <> 'aef')) +(6 rows) --Testcase 59: SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; @@ -496,14 +747,14 @@ SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; --Testcase 60: EXPLAIN VERBOSE SELECT max(id), min(c1), variance(c2) FROM tbl04; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.07..34.08 rows=1 width=44) Output: max(id), min(c1), variance(c2) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=20) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 (6 rows) --Testcase 61: @@ -516,14 +767,14 @@ SELECT max(id), min(c1), variance(c2) FROM tbl04; --Testcase 62: EXPLAIN VERBOSE SELECT variance(c2), variance(c1) FROM tbl04; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.05..34.06 rows=1 width=40) Output: variance(c2), variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 (6 rows) --Testcase 63: @@ -536,16 +787,15 @@ SELECT variance(c2), variance(c1) FROM tbl04; --Testcase 64: EXPLAIN VERBOSE SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Aggregate (cost=34.05..34.06 rows=1 width=16) Output: sum(c1), variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=8) Output: id, c1, c2, c3, c4, c5 - Filter: (tbl04.id <= 10) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(7 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_regress.tbl04 WHERE ((id <= 10)) +(6 rows) --Testcase 65: SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; @@ -558,15 +808,15 @@ SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; --Testcase 66: EXPLAIN VERBOSE SELECT count(c1), sum(c2), variance(c2) FROM tbl04 HAVING (count(c1) > 0); - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.10..34.11 rows=1 width=72) Output: count(c1), sum(c2), variance(c2) Filter: (count(tbl04.c1) > 0) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 (7 rows) --Testcase 67: @@ -579,15 +829,15 @@ SELECT count(c1), sum(c2), variance(c2) FROM tbl04 HAVING (count(c1) > 0); --Testcase 68: EXPLAIN VERBOSE SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 AND variance(c2) > 55.54; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.12..34.14 rows=1 width=64) Output: ((count(c1))::numeric + sum(c2)), (variance(c2) / 2.12) Filter: ((count(tbl04.c4) <> 0) AND (variance(tbl04.c2) > 55.54)) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=17) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2, c4 FROM odbc_fdw_regress.tbl04 (7 rows) --Testcase 69: @@ -597,9 +847,1897 @@ SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 2022757 | 171661843805.39832285 (1 row) +--Testcase 241: +EXPLAIN VERBOSE +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (count(c1)), (sum(c2)) + Filter: ((count(tbl04.c1)) > 0) + Foreign Table Size: 9 b + Remote SQL: SELECT count(c1), sum(c2) FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 242: +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); + count | sum +-------+--------- + 9 | 2022748 +(1 row) + +--Testcase 243: +EXPLAIN VERBOSE +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=32) + Output: (((count(c1))::numeric + sum(c2))) + Filter: (((count(tbl04.c4)) <> 0) AND ((avg(tbl04.c2)) > 55.54)) + Foreign Table Size: 9 b + Remote SQL: SELECT (count(c1) + sum(c2)), count(c4), avg(c2) FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 244: +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + ?column? +---------- + 2022757 +(1 row) + +--aggregation function push-down: +-- avg +--Testcase 80: +EXPLAIN VERBOSE +SELECT avg(c1), avg(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (avg(c1)), ((avg(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT avg(c1), (avg(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 81: +SELECT avg(c1), avg(c2) + 1 FROM tbl04; + avg | ?column? +-------------------+------------- + 6068.354677777777 | 224750.7778 +(1 row) + +-- avg(DISTINCT) +--Testcase 82: +EXPLAIN VERBOSE +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (avg(DISTINCT c1)), (avg(DISTINCT c2)) + Foreign Table Size: 9 b + Remote SQL: SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 83: +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + avg | avg +-------------------+------------- + 6068.354677777777 | 224749.7778 +(1 row) + +-- bit_and +--Testcase 84: +EXPLAIN VERBOSE +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=12) + Output: (bit_and(id)), ((bit_and(c2) + 1)) + Foreign Table Size: 9 b + Remote SQL: SELECT bit_and(id), (bit_and(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 85: +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; + bit_and | ?column? +---------+---------- + 0 | 1 +(1 row) + +-- bit_and(DISTINCT) +--Testcase 86: +EXPLAIN VERBOSE +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.05 rows=1 width=12) + Output: bit_and(DISTINCT id), bit_and(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 87: +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + bit_and | bit_and +---------+--------- + 0 | 0 +(1 row) + +-- bit_or +--Testcase 88: +EXPLAIN VERBOSE +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=12) + Output: (bit_or(id)), ((bit_or(c2) + 1)) + Foreign Table Size: 9 b + Remote SQL: SELECT bit_or(id), (bit_or(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 89: +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; + bit_or | ?column? +--------+---------- + 15 | 1835008 +(1 row) + +-- bit_or(DISTINCT) +--Testcase 90: +EXPLAIN VERBOSE +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.05 rows=1 width=12) + Output: bit_or(DISTINCT id), bit_or(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 91: +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + bit_or | bit_or +--------+--------- + 15 | 1835007 +(1 row) + +-- count +--Testcase 92: +EXPLAIN VERBOSE +SELECT count(c1), count(c2), count(c3) FROM tbl04; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=24) + Output: (count(c1)), (count(c2)), (count(c3)) + Foreign Table Size: 9 b + Remote SQL: SELECT count(c1), count(c2), count(c3) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 93: +SELECT count(c1), count(c2), count(c3) FROM tbl04; + count | count | count +-------+-------+------- + 9 | 9 | 9 +(1 row) + +-- count(DISTINCT) +--Testcase 94: +EXPLAIN VERBOSE +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=24) + Output: (count(DISTINCT c1)), (count(DISTINCT c2)), (count(DISTINCT c3)) + Foreign Table Size: 9 b + Remote SQL: SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 95: +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + count | count | count +-------+-------+------- + 9 | 9 | 5 +(1 row) + +-- max/min +--Testcase 241: +EXPLAIN VERBOSE +SELECT max(c1), min(c1) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=16) + Output: (max(c1)), (min(c1)) + Foreign Table Size: 9 b + Remote SQL: SELECT max(c1), min(c1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 242: +SELECT max(c1), min(c1) FROM tbl04; + max | min +----------+---------- + 45021.21 | -121.122 +(1 row) + +-- max/min (DISTINCT) +--Testcase 243: +EXPLAIN VERBOSE +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=16) + Output: (max(DISTINCT c1)), (min(DISTINCT c1)) + Foreign Table Size: 9 b + Remote SQL: SELECT max(DISTINCT c1), min(DISTINCT c1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 244: +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + max | min +----------+---------- + 45021.21 | -121.122 +(1 row) + +-- stddev +--Testcase 96: +EXPLAIN VERBOSE +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev(c1), (stddev(c2) + '1'::numeric) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 97: +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; + stddev | ?column? +-------------------+----------------- + 14787.10013608647 | 603261.39888878 +(1 row) + +-- stddev(DISTINCT) +--Testcase 98: +EXPLAIN VERBOSE +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev(DISTINCT c1), stddev(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 99: +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + stddev | stddev +-------------------+----------------- + 14787.10013608647 | 603260.39888878 +(1 row) + +-- stddev_pop +--Testcase 100: +EXPLAIN VERBOSE +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (stddev_pop(c1)), ((stddev_pop(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT stddev_pop(c1), (stddev_pop(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 101: +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; + stddev_pop | ?column? +--------------------+------------------- + 13941.411707081685 | 568760.3585007397 +(1 row) + +-- stddev_pop(DISTINCT) +--Testcase 102: +EXPLAIN VERBOSE +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 103: +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + stddev_pop | stddev_pop +--------------------+----------------- + 13941.411707081685 | 568759.35850074 +(1 row) + +-- stddev_samp +--Testcase 104: +EXPLAIN VERBOSE +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (stddev_samp(c1)), ((stddev_samp(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT stddev_samp(c1), (stddev_samp(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 105: +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; + stddev_samp | ?column? +-------------------+------------------- + 14787.10013608647 | 603261.3988887755 +(1 row) + +-- stddev_samp(DISTINCT) +--Testcase 106: +EXPLAIN VERBOSE +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 107: +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + stddev_samp | stddev_samp +-------------------+----------------- + 14787.10013608647 | 603260.39888878 +(1 row) + +-- sum +--Testcase 108: +EXPLAIN VERBOSE +SELECT sum(c1), sum(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (sum(c1)), ((sum(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT sum(c1), (sum(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 109: +SELECT sum(c1), sum(c2) + 1 FROM tbl04; + sum | ?column? +------------+---------- + 54615.1921 | 2022749 +(1 row) + +-- sum(DISTINCT) +--Testcase 110: +EXPLAIN VERBOSE +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (sum(DISTINCT c1)), (sum(DISTINCT c2)) + Foreign Table Size: 9 b + Remote SQL: SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 111: +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + sum | sum +-------------------+--------- + 54615.19209999999 | 2022748 +(1 row) + +-- var_pop +--Testcase 112: +EXPLAIN VERBOSE +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (var_pop(c1)), ((var_pop(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT var_pop(c1), (var_pop(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 113: +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; + var_pop | ?column? +--------------------+-------------------- + 194362960.38635424 | 323487207883.17285 +(1 row) + +-- var_pop(DISTINCT) +--Testcase 114: +EXPLAIN VERBOSE +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: var_pop(DISTINCT c1), var_pop(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 115: +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + var_pop | var_pop +--------------------+----------------------- + 194362960.38635424 | 323487207882.17283951 +(1 row) + +-- var_samp +--Testcase 116: +EXPLAIN VERBOSE +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (var_samp(c1)), ((var_samp(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT var_samp(c1), (var_samp(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 117: +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; + var_samp | ?column? +-------------------+-------------------- + 218658330.4346485 | 363923108868.44446 +(1 row) + +-- var_samp(DISTINCT) +--Testcase 118: +EXPLAIN VERBOSE +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: var_samp(DISTINCT c1), var_samp(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 119: +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + var_samp | var_samp +-------------------+----------------------- + 218658330.4346485 | 363923108867.44444444 +(1 row) + +-- variance(DISTINCT) +--Testcase 120: +EXPLAIN VERBOSE +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: variance(DISTINCT c1), variance(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 121: +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + variance | variance +-------------------+----------------------- + 218658330.4346485 | 363923108867.44444444 +(1 row) + +-- non-push down case: +--Testcase 122: +EXPLAIN VERBOSE +SELECT corr(id, c1) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=8) + Output: corr((id)::double precision, c1) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 123: +SELECT corr(id, c1) FROM tbl04; + corr +--------------------- + 0.20164072965667135 +(1 row) + +-- =================================================================== +-- WHERE push-down +-- =================================================================== +-- add some null record +--Testcase 124: +INSERT INTO tbl04 VALUES (11, -1.12, NULL, '(!)JAWLFJ', false, '2010-11-01 00:00:00'); +--Testcase 125: +INSERT INTO tbl04 VALUES (12, 45021.21, 2121, 'example', NULL, '1999-10-01 00:00:00'); +--Testcase 126: +INSERT INTO tbl04 VALUES (13, 121.9741, 23241, 'thing', NULL, '2010-10-01 00:00:00'); +--Testcase 127: +INSERT INTO tbl04 VALUES (14, 75, 316, 'example', NULL, '1999-10-01 10:10:00'); +--Testcase 128: +INSERT INTO tbl04 VALUES (15, 6867.34, 8916, NULL, false, '2010-10-01 10:10:00'); +-- Logical operator +--Testcase 129: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c1 >= 0) OR ((c2 > 0) AND (NOT c4)))) +(4 rows) + +--Testcase 130: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + id | c1 | c2 +----+----------+-------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 131: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c1 >= 0) OR c4)) +(4 rows) + +--Testcase 132: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 133: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + QUERY PLAN +---------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (c4) AND ((c1 >= 0)) +(4 rows) + +--Testcase 134: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + id | c1 | c2 +----+-------+-------- + 1 | 31.12 | 128912 +(1 row) + +--Testcase 135: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((NOT c4)) +(4 rows) + +--Testcase 136: +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 15 | 6867.34 | 8916 +(9 rows) + +-- Comparison operator +--Testcase 137: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id > 1)) +(4 rows) + +--Testcase 138: +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + id | c1 | c2 +----+----------+--------- + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 139: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id >= 1)) +(4 rows) + +--Testcase 140: +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 141: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id < 2)) +(4 rows) + +--Testcase 142: +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + id | c1 | c2 +----+-------+-------- + 1 | 31.12 | 128912 +(1 row) + +--Testcase 143: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id <= 2)) +(4 rows) + +--Testcase 144: +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + id | c1 | c2 +----+---------+-------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 +(2 rows) + +--Testcase 145: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id = 2)) +(4 rows) + +--Testcase 146: +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + id | c1 | c2 +----+---------+------ + 2 | 2565.56 | 6565 +(1 row) + +--Testcase 147: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id <> 2)) +(4 rows) + +--Testcase 148: +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 149: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id <> 2)) +(4 rows) + +--Testcase 150: +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 151: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((id < 1) OR (id > 5))) +(4 rows) + +--Testcase 152: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + id | c1 | c2 +----+----------+------- + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 153: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id <= c2)) AND ((id >= c1)) +(4 rows) + +--Testcase 154: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + id | c1 | c2 +----+----------+--------- + 3 | -121.122 | 1829812 + 5 | -1.12 | 22342 +(2 rows) + +--Testcase 155: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((id < 1) OR (id > 5))) AND (((id < 5) OR (id > 1))) +(4 rows) + +--Testcase 156: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + id | c1 | c2 +----+----------+------- + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 157: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((((id >= c1) AND (id <= c2)) OR ((id >= c2) AND (id <= c1)))) +(4 rows) + +--Testcase 158: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + id | c1 | c2 +----+----------+--------- + 3 | -121.122 | 1829812 + 5 | -1.12 | 22342 +(2 rows) + +--Testcase 159: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: (tbl04.c1 IS DISTINCT FROM '2'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 160: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 161: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: (tbl04.c1 IS DISTINCT FROM (tbl04.id)::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 162: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 163: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c3 IS NULL)) +(4 rows) + +--Testcase 164: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + id | c1 | c2 +----+---------+------ + 15 | 6867.34 | 8916 +(1 row) + +--Testcase 165: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c3 IS NOT NULL)) +(4 rows) + +--Testcase 166: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 +(13 rows) + +--Testcase 167: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c4 IS TRUE)) +(4 rows) + +--Testcase 168: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 +(2 rows) + +--Testcase 169: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c4 IS FALSE)) +(4 rows) + +--Testcase 170: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 171: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c4 IS NOT TRUE)) +(4 rows) + +--Testcase 172: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 173: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c4 IS NOT FALSE)) +(4 rows) + +--Testcase 174: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 +(5 rows) + +--Testcase 175: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=13) + Output: id, c1, c4 + Filter: (tbl04.c4 IS UNKNOWN) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c4 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 176: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + id | c1 | c4 +----+----------+---- + 12 | 45021.21 | + 13 | 121.9741 | + 14 | 75 | +(3 rows) + +--Testcase 177: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=13) + Output: id, c1, c4 + Filter: (tbl04.c4 IS NOT UNKNOWN) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c4 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 178: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down + id | c1 | c4 +----+----------+---- + 1 | 31.12 | t + 2 | 2565.56 | f + 3 | -121.122 | t + 4 | 55.23 | f + 5 | -1.12 | f + 6 | 45021.21 | f + 7 | 121.9741 | f + 8 | 75 | f + 9 | 6867.34 | f + 11 | -1.12 | f + 15 | 6867.34 | f +(11 rows) + +-- Mathematical operator +--Testcase 179: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id * 100 + 100 > c2; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((((id * 100) + 100) > c2)) +(4 rows) + +--Testcase 180: +SELECT id, c1, c2 FROM tbl04 WHERE c1 * 100 + 100 > c2; + id | c1 | c2 +----+----------+------ + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(8 rows) + +--Testcase 181: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c2 - c1) < 0)) +(4 rows) + +--Testcase 182: +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + id | c1 | c2 +----+----------+------ + 6 | 45021.21 | 2121 + 12 | 45021.21 | 2121 +(2 rows) + +--Testcase 183: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: ((tbl04.c2 / 100) > 0) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 184: +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 185: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c2 % 2) = 1)) +(4 rows) + +--Testcase 186: +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 +(6 rows) + +--Testcase 187: +EXPLAIN VERBOSE +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, ((id)::double precision ^ '2'::double precision) + Filter: (((tbl04.id)::double precision ^ '2'::double precision) > '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 188: +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + id | ?column? +----+---------- + 3 | 9 + 4 | 16 + 5 | 25 + 6 | 36 + 7 | 49 + 8 | 64 + 9 | 81 + 11 | 121 + 12 | 144 + 13 | 169 + 14 | 196 + 15 | 225 +(12 rows) + +--Testcase 189: +EXPLAIN VERBOSE +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, (|/ (id)::double precision) + Filter: ((|/ (tbl04.id)::double precision) < '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 190: +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + id | ?column? +----+-------------------- + 1 | 1 + 2 | 1.4142135623730951 + 3 | 1.7320508075688772 + 4 | 2 + 5 | 2.23606797749979 + 6 | 2.449489742783178 + 7 | 2.6457513110645907 + 8 | 2.8284271247461903 + 9 | 3 + 11 | 3.3166247903554 + 12 | 3.4641016151377544 + 13 | 3.605551275463989 + 14 | 3.7416573867739413 + 15 | 3.872983346207417 +(14 rows) + +--Testcase 191: +EXPLAIN VERBOSE +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, (||/ (id)::double precision) + Filter: ((||/ (tbl04.id)::double precision) < '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 192: +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + id | ?column? +----+-------------------- + 1 | 1 + 2 | 1.2599210498948734 + 3 | 1.4422495703074083 + 4 | 1.5874010519681996 + 5 | 1.7099759466766968 + 6 | 1.8171205928321394 + 7 | 1.9129311827723894 + 8 | 2 + 9 | 2.080083823051904 + 11 | 2.2239800905693157 + 12 | 2.2894284851066633 + 13 | 2.3513346877207577 + 14 | 2.4101422641752306 + 15 | 2.46621207433047 +(14 rows) + +--Testcase 193: +EXPLAIN VERBOSE +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=12) + Output: id, (@ c2) + Filter: ((@ tbl04.c2) < 1000) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 194: +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + id | ?column? +----+---------- + 4 | 523 + 8 | 316 + 14 | 316 +(3 rows) + +--Testcase 195: +EXPLAIN VERBOSE +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id & 123) + Filter: ((tbl04.id & 123) < 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 196: +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + id | ?column? +----+---------- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 0 + 5 | 1 + 6 | 2 + 7 | 3 +(7 rows) + +--Testcase 197: +EXPLAIN VERBOSE +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=12) + Output: id, ('123'::bigint | c2) + Filter: (('123'::bigint | tbl04.c2) > 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 198: +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + id | ?column? +----+---------- + 1 | 129019 + 2 | 6655 + 3 | 1829887 + 4 | 635 + 5 | 22399 + 6 | 2171 + 7 | 23291 + 8 | 383 + 9 | 8959 + 12 | 2171 + 13 | 23291 + 14 | 383 + 15 | 8959 +(13 rows) + +--Testcase 199: +EXPLAIN VERBOSE +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id # 324) + Filter: ((tbl04.id # 324) > 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 200: +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + id | ?column? +----+---------- + 1 | 325 + 2 | 326 + 3 | 327 + 4 | 320 + 5 | 321 + 6 | 322 + 7 | 323 + 8 | 332 + 9 | 333 + 11 | 335 + 12 | 328 + 13 | 329 + 14 | 330 + 15 | 331 +(14 rows) + +--Testcase 201: +EXPLAIN VERBOSE +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (~ id) + Filter: ((~ tbl04.id) < '-2'::integer) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 202: +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + id | ?column? +----+---------- + 2 | -3 + 3 | -4 + 4 | -5 + 5 | -6 + 6 | -7 + 7 | -8 + 8 | -9 + 9 | -10 + 11 | -12 + 12 | -13 + 13 | -14 + 14 | -15 + 15 | -16 +(13 rows) + +--Testcase 203: +EXPLAIN VERBOSE +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id << 2) + Filter: ((tbl04.id << 2) < 10) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 204: +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + id | ?column? +----+---------- + 1 | 4 + 2 | 8 +(2 rows) + +--Testcase 205: +EXPLAIN VERBOSE +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id >> 2) + Filter: ((tbl04.id >> 2) = 0) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 206: +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + id | ?column? +----+---------- + 1 | 0 + 2 | 0 + 3 | 0 +(3 rows) + +-- String operator +--Testcase 207: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: is_normalized(tbl04.c3, 'nfc'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 208: +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + c3 +------------ + anystring + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(13 rows) + +--Testcase 209: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (NOT is_normalized(tbl04.c3, 'nfkc'::text)) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 210: +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + c3 +---- +(0 rows) + +-- Pattern matching operator +--Testcase 211: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 WHERE ((c3 LIKE '%hi%')) +(4 rows) + +--Testcase 212: +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + c3 +------- + thing + thing + thing + thing +(4 rows) + +--Testcase 213: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 WHERE ((c3 NOT LIKE '%hi%')) +(4 rows) + +--Testcase 214: +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + c3 +------------ + anystring + example + !)@(#)!_#! + (!)JAWLFJ + example + example + (!)JAWLFJ + example + example +(9 rows) + +--Testcase 215: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~~* '%Hi%'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 216: +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + c3 +------- + thing + thing + thing + thing +(4 rows) + +--Testcase 217: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~~* '%Hi%'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 218: +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + c3 +------------ + anystring + example + !)@(#)!_#! + (!)JAWLFJ + example + example + (!)JAWLFJ + example + example +(9 rows) + +--Testcase 219: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~ '^(?:.*(?:y|w).*)$'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 220: +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 221: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~ '^(?:.*(?:y|w).*)$'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 222: +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +--Testcase 223: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~ 'any.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 224: +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 225: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~* 'ANY.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 226: +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 227: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~ 'any.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 228: +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +--Testcase 229: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~* 'ANY.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 230: +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +-- test for specific type +--Testcase 231: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE inet; +--Testcase 232: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 + 1 > inet '192.168.1.100'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 + '1'::bigint) > '192.168.1.100'::inet) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 233: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE json; +--Testcase 234: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 ->> 'tag'::text) = 'test data'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 235: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE jsonb; +--Testcase 236: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 ->> 'tag'::text) = 'test data'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 237: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE point; +--Testcase 238: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 >> point '(1, 3)'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: (tbl04.c3 >> '(1,3)'::point) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +-- reset c3 column type +--Testcase 239: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE text; +-- Reset data for tbl04; +--Testcase 240: +DELETE FROM tbl04 WHERE id > 10; --Testcase 70: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/13.4/new_test.sql:185: NOTICE: drop cascades to 5 other objects +psql:sql/13.4/new_test.sql:778: NOTICE: drop cascades to 5 other objects DETAIL: drop cascades to user mapping for public on server mysql_server drop cascades to foreign table tbl01 drop cascades to foreign table tbl02 diff --git a/expected/13.4/mysql/ported_postgres_fdw.out b/expected/13.4/mysql/ported_postgres_fdw.out index 07ec099..bec8a7c 100644 --- a/expected/13.4/mysql/ported_postgres_fdw.out +++ b/expected/13.4/mysql/ported_postgres_fdw.out @@ -524,8 +524,8 @@ SELECT * FROM ft1 ORDER BY c3, c1 OFFSET 100 LIMIT 10; -- single table with alias - also test that tableoid sort is not pushed to remote side --Testcase 40: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tableoid OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8, tableoid -> Sort @@ -533,7 +533,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tabl Sort Key: t1.c3, t1.c1, t1.tableoid -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, tableoid - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 41: @@ -555,8 +555,8 @@ SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tableoid OFFSET 100 LIMIT 10; -- whole-row reference --Testcase 42: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: t1.*, c3, c1 -> Sort @@ -564,7 +564,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET Sort Key: t1.c3, t1.c1 -> Foreign Scan on public.ft1 t1 Output: t1.*, c3, c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 43: @@ -593,12 +593,12 @@ SELECT * FROM ft1 WHERE false; -- with WHERE clause --Testcase 45: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1'; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------ Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c7 >= '1'::bpchar) AND (t1.c1 = 101) AND ((t1.c6)::text = '1'::text)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Filter: ((t1.c6)::text = '1'::text) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c7 >= '1')) AND ((`C_1` = 101)) (4 rows) --Testcase 46: @@ -611,15 +611,14 @@ SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1'; -- with FOR UPDATE/SHARE --Testcase 47: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------ LockRows Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* - Filter: (t1.c1 = 101) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 101)) +(5 rows) --Testcase 48: SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; @@ -630,15 +629,14 @@ SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; --Testcase 49: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------ LockRows Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* - Filter: (t1.c1 = 102) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 102)) +(5 rows) --Testcase 50: SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE; @@ -714,8 +712,8 @@ SET enable_nestloop TO false; --Testcase 58: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2."C_1" FROM ft2 t1 JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------- Limit Output: t1.c1, t2."C_1" -> Merge Join @@ -726,13 +724,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t2."C_1" Sort Key: t2."C_1" -> Foreign Scan on "S 1"."T1" t2 Output: t2."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (17 rows) --Testcase 59: @@ -756,8 +754,8 @@ SELECT t1.c1, t2."C_1" FROM ft2 t1 JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFS --Testcase 60: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2."C_1" FROM ft2 t1 LEFT JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------- Limit Output: t1.c1, t2."C_1" -> Merge Left Join @@ -768,13 +766,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t2."C_1" Sort Key: t2."C_1" -> Foreign Scan on "S 1"."T1" t2 Output: t2."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (17 rows) --Testcase 61: @@ -798,8 +796,8 @@ SELECT t1.c1, t2."C_1" FROM ft2 t1 LEFT JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") --Testcase 62: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1" FROM "S 1"."T1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------- Limit Output: t1."C_1" -> Merge Left Join @@ -810,7 +808,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c1 -> Merge Join @@ -821,13 +819,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (28 rows) --Testcase 63: @@ -852,8 +850,8 @@ SELECT t1."C_1" FROM "S 1"."T1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c --Testcase 64: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 left join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------- Limit Output: t1."C_1", t2.c1, t3.c1 -> Merge Left Join @@ -864,7 +862,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c1, t2.c1 -> Merge Left Join @@ -875,13 +873,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t2.c1 Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (28 rows) --Testcase 65: @@ -904,8 +902,8 @@ SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 left join ft1 t2 full join ft2 --Testcase 66: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 full join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------- Limit Output: t1."C_1", t2.c1, t3.c1 -> Merge Full Join @@ -916,7 +914,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t2.c1, t3.c1 Sort Key: t3.c1 @@ -928,13 +926,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (29 rows) --Testcase 67: @@ -962,123 +960,115 @@ RESET enable_nestloop; -- =================================================================== --Testcase 70: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 1; -- Var, OpExpr(b), Const - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 71: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 100 AND t1.c2 = 0; -- BoolExpr - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c1 = 100) AND (t1.c2 = 0)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 100)) AND ((c2 = 0)) +(3 rows) --Testcase 72: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NULL; -- NullTest - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 IS NULL) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` IS NULL)) +(3 rows) --Testcase 73: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NOT NULL; -- NullTest - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 IS NOT NULL) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` IS NOT NULL)) +(3 rows) --Testcase 74: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE round(abs(c1), 0) = 1; -- FuncExpr - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (round((abs(t1.c1))::numeric, 0) = '1'::numeric) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((round(abs(`C_1`), 0) = 1)) +(3 rows) --Testcase 75: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = -c1; -- OpExpr(l) - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = (- t1.c1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = (- `C_1`))) +(3 rows) --Testcase 76: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE 1 = c1!; -- OpExpr(r) - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ('1'::numeric = ((t1.c1)::bigint !)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 77: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c1 IS NOT NULL) IS DISTINCT FROM (c1 IS NOT NULL); -- DistinctExpr - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c1 IS NOT NULL) IS DISTINCT FROM (t1.c1 IS NOT NULL)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 78: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = ANY(ARRAY[c2, 1, c1 + 0]); -- ScalarArrayOpExpr - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = ANY (ARRAY[t1.c2, 1, (t1.c1 + 0)])) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (`C_1` IN (c2, 1, (`C_1` + 0))) +(3 rows) --Testcase 79: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- SubscriptingRef - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = (ARRAY[t1.c1, t1.c2, 3])[1]) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 80: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c6 = E'foo''s\\bar'; -- check special chars - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c6)::text = 'foo''s\bar'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 81: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c8 = 'foo'; -- can't be sent to remote - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c8 = 'foo'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) +(3 rows) -- parameterized remote path for foreign table --Testcase 82: @@ -1091,14 +1081,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Hash Cond: (a.c2 = b.c1) -> Foreign Scan on "S 1"."T1" a Output: a."C_1", a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8 - Filter: (a."C_1" = 47) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 47)) -> Hash Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 -> Foreign Scan on public.ft2 b Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(12 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` +(11 rows) --Testcase 83: SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2; @@ -1112,8 +1101,8 @@ SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2; EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 a, ft2 b WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = upper(a.c7); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------- Merge Join Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 Merge Cond: ((a.c1 = b.c1) AND ((upper((a.c7)::text)) = ((b.c7)::text))) @@ -1122,15 +1111,14 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: a.c1, (upper((a.c7)::text)) -> Foreign Scan on public.ft2 a Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, upper((a.c7)::text) - Filter: ((a.c2 = 6) AND (a.c8 = 'foo'::text)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c2 = 6)) AND ((c8 = 'foo')) -> Sort Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8, ((b.c7)::text) Sort Key: b.c1, ((b.c7)::text) -> Foreign Scan on public.ft2 b Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8, b.c7 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(16 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` +(15 rows) --Testcase 85: SELECT * FROM ft2 a, ft2 b @@ -1265,27 +1253,27 @@ SELECT * FROM ft2 WHERE c1 = ANY (ARRAY(SELECT c1 FROM ft1 WHERE c1 < 5)); --Testcase 88: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 ORDER BY ft2.c1, random(); - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Sort Output: c1, c2, c3, c4, c5, c6, c7, c8, (random()) Sort Key: ft2.c1, (random()) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8, random() - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 89: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 ORDER BY ft2.c1, ft2.c3 collate "C"; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Sort Output: c1, c2, c3, c4, c5, c6, c7, c8, ((c3)::text) Sort Key: ft2.c1, ft2.c3 COLLATE "C" -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8, c3 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (6 rows) -- user-defined operator/function @@ -1306,15 +1294,12 @@ CREATE OPERATOR === ( --Testcase 92: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: count(c3) - -> Foreign Scan on public.ft1 t1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = abs(t1.c2)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan + Output: (count(c3)) + Remote SQL: SELECT count(c3) FROM odbc_fdw_post.`T1` WHERE ((`C_1` = abs(c2))) +(3 rows) --Testcase 93: SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); @@ -1326,15 +1311,12 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); --Testcase 94: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: count(c3) - -> Foreign Scan on public.ft1 t1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan + Output: (count(c3)) + Remote SQL: SELECT count(c3) FROM odbc_fdw_post.`T1` WHERE ((`C_1` = c2)) +(3 rows) --Testcase 95: SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; @@ -1347,14 +1329,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; --Testcase 96: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = postgres_fdw_abs(t1.c2)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 97: @@ -1367,14 +1349,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); --Testcase 98: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 99: @@ -1388,8 +1370,8 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 100: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -1398,7 +1380,7 @@ EXPLAIN (VERBOSE, COSTS OFF) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 101: @@ -1420,14 +1402,14 @@ ALTER EXTENSION :DB_EXTENSIONNAME ADD OPERATOR === (int, int); --Testcase 105: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = postgres_fdw_abs(t1.c2)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 106: @@ -1440,14 +1422,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); --Testcase 107: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 108: @@ -1461,8 +1443,8 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 109: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -1471,7 +1453,7 @@ EXPLAIN (VERBOSE, COSTS OFF) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 110: @@ -1492,8 +1474,8 @@ SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; --Testcase 111: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -1504,12 +1486,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (16 rows) --Testcase 112: @@ -1532,8 +1514,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 113: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t3 ON (t3.c1 = t1.c1) ORDER BY t1.c3, t1.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3, t1.c3 -> Sort @@ -1544,7 +1526,7 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t Hash Cond: (t2.c1 = t1.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: t1.c1, t1.c3, t3.c3, t3.c1 -> Hash Join @@ -1552,12 +1534,12 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t Hash Cond: (t1.c1 = t3.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (24 rows) --Testcase 114: @@ -1580,8 +1562,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t --Testcase 115: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -1592,12 +1574,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 116: @@ -1620,8 +1602,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. --Testcase 117: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1632,17 +1614,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 118: @@ -1667,22 +1649,20 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 119: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------- Hash Left Join Output: t1.c1, t1.c2, ft5.c1, ft5.c2 Hash Cond: (t1.c1 = ft5.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: (t1.c1 < 10) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T3` WHERE ((c1 < 10)) -> Hash Output: ft5.c1, ft5.c2 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2 - Filter: (ft5.c1 < 10) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(13 rows) + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` WHERE ((c1 < 10)) +(11 rows) --Testcase 120: SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10; @@ -1700,23 +1680,21 @@ SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE (t2.c1 < 10 OR t2.c1 IS NULL) AND t1.c1 < 10; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------- Hash Left Join Output: t1.c1, t1.c2, ft5.c1, ft5.c2 Hash Cond: (t1.c1 = ft5.c1) Filter: ((ft5.c1 < 10) OR (ft5.c1 IS NULL)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: (t1.c1 < 10) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T3` WHERE ((c1 < 10)) -> Hash Output: ft5.c1, ft5.c2 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2 - Filter: (ft5.c1 < 10) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(14 rows) + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` WHERE ((c1 < 10)) +(12 rows) --Testcase 122: SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) @@ -1733,8 +1711,8 @@ SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE --Testcase 123: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2.c1, t1.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -1745,12 +1723,12 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2 Hash Cond: (t2.c1 = t1.c1) -> Foreign Scan on public.ft4 t2 Output: t2.c1, t2.c2, t2.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t1.c1 -> Foreign Scan on public.ft5 t1 Output: t1.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 124: @@ -1773,8 +1751,8 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2 --Testcase 125: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1785,17 +1763,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGH Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t3 Output: t3.c1, t3.c2, t3.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (21 rows) --Testcase 126: @@ -1818,8 +1796,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGH --Testcase 127: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 45 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -1830,12 +1808,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 128: @@ -1859,8 +1837,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. --Testcase 129: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Sort Output: ft4.c1, ft5.c1 Sort Key: ft4.c1, ft5.c1 @@ -1869,15 +1847,13 @@ SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(16 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(14 rows) --Testcase 130: SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1; @@ -1896,23 +1872,21 @@ SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL --Testcase 131: EXPLAIN (VERBOSE, COSTS OFF) SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------- Limit Output: 1 -> Merge Full Join Output: 1 -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT NULL FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Materialize Output: ft5.c1, ft5.c2, ft5.c3 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2, ft5.c3 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(14 rows) + Remote SQL: SELECT NULL FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(12 rows) --Testcase 132: SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10; @@ -1935,8 +1909,8 @@ SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELE --Testcase 133: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Sort Output: ft4.c1, t2.c1, t3.c1 Sort Key: ft4.c1, t2.c1, t3.c1 @@ -1948,20 +1922,18 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 Hash Cond: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t2 Output: t2.c1, t2.c2, t2.c3 - Filter: ((t2.c1 >= 50) AND (t2.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: t3.c1 -> Foreign Scan on public.ft5 t3 Output: t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` -(24 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(22 rows) --Testcase 134: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; @@ -1979,8 +1951,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 --Testcase 135: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------- Sort Output: ft4.c1, ft4_1.c1, ft5.c1 Sort Key: ft4.c1, ft4_1.c1, ft5.c1 @@ -1993,21 +1965,18 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 Filter: ((ft4_1.c1 IS NULL) OR (ft4_1.c1 IS NOT NULL)) -> Foreign Scan on public.ft4 ft4_1 Output: ft4_1.c1, ft4_1.c2, ft4_1.c3 - Filter: ((ft4_1.c1 >= 50) AND (ft4_1.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` -(26 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(23 rows) --Testcase 136: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; @@ -2027,8 +1996,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 --Testcase 137: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1; - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------- LockRows Output: "T3".c1, ft4.c1, ft5.c1, "T3".*, ft4.*, ft5.* -> Sort @@ -2038,8 +2007,7 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER Output: "T3".c1, ft4.c1, ft5.c1, "T3".*, ft4.*, ft5.* -> Foreign Scan on "S 1"."T3" Output: "T3".c1, "T3".* - Filter: ("T3".c1 = 50) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` WHERE ((c1 = 50)) -> Materialize Output: ft4.c1, ft4.*, ft5.c1, ft5.* -> Hash Full Join @@ -2048,15 +2016,13 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER Filter: ((ft4.c1 IS NULL) OR (ft4.c1 IS NOT NULL)) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.* - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1, ft5.* -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.* - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(27 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(24 rows) --Testcase 138: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1; @@ -2076,8 +2042,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER --Testcase 139: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t3.c1 -> Sort @@ -2091,19 +2057,18 @@ SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 a Hash Cond: (t1.c1 = (t2.c1 + 1)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: ((t1.c1 >= 50) AND (t1.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` -> Hash Output: t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` -(25 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` +(24 rows) --Testcase 140: SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10; @@ -2125,8 +2090,8 @@ SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 a --Testcase 141: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -2137,17 +2102,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 142: @@ -2170,8 +2135,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 143: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2182,17 +2147,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t3 Output: t3.c1, t3.c2, t3.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (21 rows) --Testcase 144: @@ -2215,8 +2180,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT --Testcase 145: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -2227,17 +2192,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 146: @@ -2260,8 +2225,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 147: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2272,17 +2237,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 148: @@ -2305,8 +2270,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 149: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -2317,17 +2282,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 150: @@ -2350,8 +2315,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 151: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2362,17 +2327,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (21 rows) --Testcase 152: @@ -2395,8 +2360,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 153: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Right Join @@ -2407,17 +2372,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 154: @@ -2440,8 +2405,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT --Testcase 155: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -2453,12 +2418,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 Filter: ((t1.c1 = t2.c1) OR (t1.c1 IS NULL)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (17 rows) --Testcase 156: @@ -2481,8 +2446,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 --Testcase 157: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t1.c3 -> Hash Full Join @@ -2491,12 +2456,12 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE Filter: (postgres_fdw_abs(t1.c1) > 0) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (14 rows) --Testcase 158: @@ -2506,8 +2471,8 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE --Testcase 159: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t1.c3 -> Hash Full Join @@ -2516,12 +2481,12 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE Filter: (postgres_fdw_abs(t1.c1) > 0) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (14 rows) --Testcase 160: @@ -2531,8 +2496,8 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE --Testcase 161: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE OF t1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2545,12 +2510,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (18 rows) --Testcase 162: @@ -2572,8 +2537,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 163: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2586,12 +2551,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (18 rows) --Testcase 164: @@ -2614,8 +2579,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 165: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE OF t1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2628,12 +2593,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (18 rows) --Testcase 166: @@ -2655,8 +2620,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 167: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2669,12 +2634,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (18 rows) --Testcase 168: @@ -2697,8 +2662,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 169: EXPLAIN (VERBOSE, COSTS OFF) WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) SELECT c1_1, c2_1 FROM t ORDER BY c1_3, c1_1 OFFSET 100 LIMIT 10; - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Limit Output: t.c1_1, t.c2_1, t.c1_3 CTE t @@ -2707,12 +2672,12 @@ WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t.c1_1, t.c2_1, t.c1_3 Sort Key: t.c1_3, t.c1_1 @@ -2740,8 +2705,8 @@ WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t --Testcase 171: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------- Limit Output: t1.ctid, t1.*, t2.*, t1.c1, t1.c3 -> Sort @@ -2752,20 +2717,20 @@ SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER B Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.ctid, t1.*, t1.c1, t1.c3 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.*, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.*, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (16 rows) -- SEMI JOIN, not pushed down --Testcase 172: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) ORDER BY t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1 -> Sort @@ -2777,7 +2742,7 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> HashAggregate @@ -2785,7 +2750,7 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) Group Key: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (20 rows) --Testcase 173: @@ -2808,8 +2773,8 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) --Testcase 174: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c2) ORDER BY t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1 -> Sort @@ -2820,12 +2785,12 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2 Hash Cond: (t1.c1 = t2.c2) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2 -> Foreign Scan on public.ft2 t2 Output: t2.c2 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (16 rows) --Testcase 175: @@ -2848,8 +2813,8 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2 --Testcase 176: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2859,12 +2824,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 1 Output: t1.c1, t2.c1 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (15 rows) --Testcase 177: @@ -2887,8 +2852,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 1 --Testcase 178: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -2899,12 +2864,12 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft5 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` -> Hash Output: t2.c1 -> Foreign Scan on public.ft6 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 179: @@ -2918,8 +2883,8 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t --Testcase 180: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2930,12 +2895,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1. Hash Cond: (t1.c8 = t2.c8) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.c8 -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c8 FROM odbc_fdw_post.`T1` (16 rows) --Testcase 181: @@ -2958,8 +2923,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1. --Testcase 182: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -2970,14 +2935,13 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c8 = 'foo'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(17 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` +(16 rows) --Testcase 183: SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; @@ -3002,8 +2966,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 --Testcase 184: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2.c8 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -3017,13 +2981,13 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2. Sort Key: t1.c1, t1.c8 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3, c8 FROM odbc_fdw_post.`T1` -> Sort Output: t2.c1, t2.c8 Sort Key: t2.c1, t2.c8 -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c8 FROM odbc_fdw_post.`T1` (20 rows) --Testcase 185: @@ -3046,8 +3010,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2. --Testcase 186: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) UNION SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) AS t (t1c1, t2c1) GROUP BY t1c1 ORDER BY t1c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, (avg((t1.c1 + t2.c1))) -> Sort @@ -3065,23 +3029,23 @@ SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Join Output: t1_1.c1, t2_1.c1 Hash Cond: (t1_1.c1 = t2_1.c1) -> Foreign Scan on public.ft1 t1_1 Output: t1_1.c1, t1_1.c2, t1_1.c3, t1_1.c4, t1_1.c5, t1_1.c6, t1_1.c7, t1_1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2_1.c1 -> Foreign Scan on public.ft2 t2_1 Output: t2_1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (34 rows) --Testcase 187: @@ -3104,8 +3068,8 @@ SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 --Testcase 188: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM ft1 t2, ft2 t3 WHERE t2.c1 = t3.c1 AND t2.c2 = t1.c2) q ORDER BY t1."C_1" OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: t1."C_1" -> Sort @@ -3115,7 +3079,7 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f Output: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1", t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Unique Output: t2.c1, t3.c1 -> Merge Join @@ -3127,13 +3091,13 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f -> Foreign Scan on public.ft1 t2 Output: t2.c1 Filter: (t2.c2 = t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (28 rows) --Testcase 189: @@ -3158,22 +3122,20 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f --Testcase 190: EXPLAIN (VERBOSE, COSTS OFF) SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Nested Loop Left Join Output: (13), ft2.c1 Join Filter: (13 = ft2.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: ((ft2.c1 >= 10) AND (ft2.c1 <= 15)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` >= 10)) AND ((`C_1` <= 15)) -> Materialize Output: (13) -> Foreign Scan on public.ft1 Output: 13 - Filter: (ft1.c1 = 13) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(13 rows) + Remote SQL: SELECT NULL FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 13)) +(11 rows) --Testcase 191: SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15; @@ -3191,8 +3153,8 @@ SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 O --Testcase 192: EXPLAIN (VERBOSE, COSTS OFF) SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------- Hash Right Join Output: ft4.c1, (13), ft1.c1, ft2.c1 Hash Cond: (ft1.c1 = ft4.c1) @@ -3200,21 +3162,18 @@ SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT Output: ft1.c1, ft2.c1, 13 -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Filter: (ft1.c1 = 12) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 12)) -> Materialize Output: ft2.c1 -> Foreign Scan on public.ft2 Output: ft2.c1 - Filter: (ft2.c1 = 12) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 12)) -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 10) AND (ft4.c1 <= 15)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` -(21 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 10)) AND ((c1 <= 15)) +(18 rows) --Testcase 193: SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15 ORDER BY ft4.c1; @@ -3231,8 +3190,8 @@ UPDATE ft5 SET c3 = null where c1 % 9 = 0; --Testcase 195: EXPLAIN (VERBOSE, COSTS OFF) SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- Sort Output: ft5.*, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 Sort Key: ft5.c1 @@ -3241,14 +3200,13 @@ SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 10) AND (ft4.c1 <= 30)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 10)) AND ((c1 <= 30)) -> Hash Output: ft5.*, ft5.c1, ft5.c2, ft5.c3 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1, ft5.c2, ft5.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(15 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(14 rows) --Testcase 196: SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1; @@ -3304,28 +3262,26 @@ SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = f Sort Key: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3, ft4.* - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Sort Output: ft5.c1, ft5.c2, ft5.c3, ft5.* Sort Key: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2, ft5.c3, ft5.* - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` -> Sort Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8, ft1.* Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8, ft1.* - Filter: (ft1.c1 < 100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) -> Sort Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.* Sort Key: ft2.c1 -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.* - Filter: (ft2.c1 < 100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(48 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) +(46 rows) --Testcase 202: SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = ft4.c1 @@ -3366,8 +3322,8 @@ ALTER VIEW v5 OWNER TO regress_view_owner; --Testcase 211: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: ft4.c1, ft5.c2, ft5.c1 -> Sort @@ -3378,12 +3334,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.c2, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c2, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 212: @@ -3407,8 +3363,8 @@ ALTER VIEW v4 OWNER TO regress_view_owner; --Testcase 214: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: ft4.c1, ft5.c2, ft5.c1 -> Sort @@ -3419,12 +3375,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.c2, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c2, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 215: @@ -3446,8 +3402,8 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 --Testcase 216: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: ft4.c1, t2.c2, t2.c1 -> Sort @@ -3458,12 +3414,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c Hash Cond: (ft4.c1 = t2.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 217: @@ -3487,8 +3443,8 @@ ALTER VIEW v4 OWNER TO CURRENT_USER; --Testcase 219: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: ft4.c1, t2.c2, t2.c1 -> Sort @@ -3499,12 +3455,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c Hash Cond: (ft4.c1 = t2.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 220: @@ -3549,9 +3505,8 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 5) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(12 rows) + Remote SQL: SELECT `C_1`, c2, c6 FROM odbc_fdw_post.`T1` WHERE ((c2 < 5)) +(11 rows) --Testcase 225: select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2; @@ -3581,9 +3536,8 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 5) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2, c6 FROM odbc_fdw_post.`T1` WHERE ((c2 < 5)) +(13 rows) --Testcase 227: select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2 limit 1; @@ -3596,36 +3550,34 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran --Testcase 228: explain (verbose, costs off) select sum(c1 * (random() <= 1)::int) as sum, avg(c1) from ft1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------- Aggregate Output: sum((c1 * ((random() <= '1'::double precision))::integer)), avg(c1) -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (5 rows) -- Aggregate over join query --Testcase 229: explain (verbose, costs off) select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate Output: count(*), sum(t1.c1), avg(t2.c1) -> Nested Loop Output: t1.c1, t2.c1 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c2 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 = 6)) -> Materialize Output: t2.c1, t2.c2 -> Foreign Scan on public.ft1 t2 Output: t2.c1, t2.c2 - Filter: (t2.c2 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 = 6)) +(12 rows) --Testcase 230: select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6; @@ -3648,20 +3600,20 @@ select sum(t1.c1), count(t2.c1) from ft1 t1 inner join ft2 t2 on (t1.c1 = t2.c1) Join Filter: (((((t1.c1 * t2.c1) / (t1.c1 * t2.c1)))::double precision * random()) <= '1'::double precision) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (14 rows) -- GROUP BY clause having expressions --Testcase 232: explain (verbose, costs off) select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------- Sort Output: ((c2 / 2)), ((sum(c2) * ((c2 / 2)))) Sort Key: ((ft1.c2 / 2)) @@ -3670,7 +3622,7 @@ select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; Group Key: (ft1.c2 / 2) -> Foreign Scan on public.ft1 Output: (c2 / 2), c2 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 233: @@ -3688,8 +3640,8 @@ select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; --Testcase 234: explain (verbose, costs off) select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, sqrt(c1) order by 1, 2) x; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------- Aggregate Output: count(ft1.c2), sum(ft1.c2) -> Sort @@ -3700,7 +3652,7 @@ select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, s Group Key: ft1.c2, sqrt((ft1.c1)::double precision) -> Foreign Scan on public.ft1 Output: ft1.c2, sqrt((ft1.c1)::double precision), ft1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (11 rows) --Testcase 235: @@ -3714,8 +3666,8 @@ select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, s --Testcase 236: explain (verbose, costs off) select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by c2 order by 1, 2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- Sort Output: ((c2 * ((random() <= '1'::double precision))::integer)), ((sum(c1) * c2)), c2 Sort Key: ((ft1.c2 * ((random() <= '1'::double precision))::integer)), ((sum(ft1.c1) * ft1.c2)) @@ -3724,7 +3676,7 @@ select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 237: @@ -3747,8 +3699,8 @@ select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by --Testcase 238: explain (verbose, costs off) select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::int order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: ((c2 * ((random() <= '1'::double precision))::integer)) Sort Key: ((ft2.c2 * ((random() <= '1'::double precision))::integer)) @@ -3757,15 +3709,15 @@ select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::i Group Key: (ft2.c2 * ((random() <= '1'::double precision))::integer) -> Foreign Scan on public.ft2 Output: (c2 * ((random() <= '1'::double precision))::integer) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (9 rows) -- GROUP BY clause in various forms, cardinal, alias and constant expression --Testcase 239: explain (verbose, costs off) select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------- Sort Output: (count(c2)), c2, 5, 7.0, 9 Sort Key: ft1.c2 @@ -3774,7 +3726,7 @@ select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2 Group Key: ft1.c2, 5, 9 -> Foreign Scan on public.ft1 Output: c2, 5, 9 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 240: @@ -3798,8 +3750,8 @@ select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2 --Testcase 241: explain (verbose, costs off) select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: c2, c2, (sum(c1)) Sort Key: (sum(ft1.c1)) @@ -3808,9 +3760,8 @@ select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); Group Key: ft1.c2, ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c2, c1 - Filter: (ft1.c2 > 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 > 6)) +(9 rows) --Testcase 242: select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); @@ -3825,8 +3776,8 @@ select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); --Testcase 243: explain (verbose, costs off) select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 order by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Sort Output: c2, (sum(c1)) Sort Key: ft2.c2 @@ -3836,7 +3787,7 @@ select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 Filter: ((avg(ft2.c1) < '500'::numeric) AND (sum(ft2.c1) < 49800)) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (10 rows) --Testcase 244: @@ -3861,7 +3812,7 @@ select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having Filter: ((avg(ft1.c1) < '500'::numeric) AND ((((avg(ft1.c1) / avg(ft1.c1)))::double precision * random()) <= '1'::double precision)) -> Foreign Scan on public.ft1 Output: ft1.c5, sqrt((ft1.c2)::double precision), ft1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c5 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 246: @@ -3875,8 +3826,8 @@ select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having --Testcase 247: explain (verbose, costs off) select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- Sort Output: (sum(c1)), c2 Sort Key: (sum(ft1.c1)) @@ -3886,7 +3837,7 @@ select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 Filter: (avg((ft1.c1 * ((random() <= '1'::double precision))::integer)) > '100'::numeric) -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (10 rows) -- Remote aggregate in combination with a local Param (for the output @@ -3894,16 +3845,14 @@ select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 --Testcase 248: explain (verbose, costs off) select exists(select 1 from pg_enum), sum(c1) from ft1; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: $0, sum(ft1.c1) + QUERY PLAN +--------------------------------------------------------- + Foreign Scan + Output: $0, (sum(ft1.c1)) + Remote SQL: SELECT sum(`C_1`) FROM odbc_fdw_post.`T1` InitPlan 1 (returns $0) -> Seq Scan on pg_catalog.pg_enum - -> Foreign Scan on public.ft1 - Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) +(5 rows) --Testcase 249: select exists(select 1 from pg_enum), sum(c1) from ft1; @@ -3915,8 +3864,8 @@ select exists(select 1 from pg_enum), sum(c1) from ft1; --Testcase 250: explain (verbose, costs off) select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------- GroupAggregate Output: ($0), sum(ft1.c1) Group Key: $0 @@ -3924,7 +3873,7 @@ select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; -> Seq Scan on pg_catalog.pg_enum -> Foreign Scan on public.ft1 Output: $0, ft1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (8 rows) --Testcase 251: @@ -3939,8 +3888,8 @@ select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; --Testcase 252: explain (verbose, costs off) select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort Output: (array_agg(c1 ORDER BY c1)), c2 Sort Key: (array_agg(ft1.c1 ORDER BY ft1.c1)) @@ -3952,9 +3901,8 @@ select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Filter: (ft1.c1 < 100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(13 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) +(12 rows) --Testcase 253: select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; @@ -3976,15 +3924,14 @@ select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; --Testcase 254: explain (verbose, costs off) select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------- Aggregate Output: array_agg(c5 ORDER BY c1 DESC) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 50) AND (ft2.c2 = 6)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c5 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 50)) AND ((c2 = 6)) +(5 rows) --Testcase 255: select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; @@ -3997,8 +3944,8 @@ select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; --Testcase 256: explain (verbose, costs off) select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Sort Output: (array_agg(DISTINCT (t1.c1 % 5))), ((t2.c1 % 3)) Sort Key: (array_agg(DISTINCT (t1.c1 % 5))) @@ -4014,12 +3961,12 @@ select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2 Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (21 rows) --Testcase 257: @@ -4034,8 +3981,8 @@ select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2 --Testcase 258: explain (verbose, costs off) select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))), ((t2.c1 % 3)) Sort Key: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))) @@ -4051,12 +3998,12 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (21 rows) --Testcase 259: @@ -4087,12 +4034,12 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (21 rows) --Testcase 261: @@ -4107,8 +4054,8 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 --Testcase 262: explain (verbose, costs off) select sum(c1) filter (where c1 < 100 and c2 > 5) from ft1 group by c2 order by 1 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Sort Output: (sum(c1) FILTER (WHERE ((c1 < 100) AND (c2 > 5)))), c2 Sort Key: (sum(ft1.c1) FILTER (WHERE ((ft1.c1 < 100) AND (ft1.c2 > 5)))) @@ -4117,7 +4064,7 @@ select sum(c1) filter (where c1 < 100 and c2 > 5) from ft1 group by c2 order by Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 263: @@ -4147,9 +4094,8 @@ select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 f Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 = 6)) +(6 rows) --Testcase 265: select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 from ft1 where c2 = 6 group by c2; @@ -4162,8 +4108,8 @@ select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 f --Testcase 266: explain (verbose, costs off) select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Unique Output: ((SubPlan 1)) -> Sort @@ -4173,14 +4119,12 @@ select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft Output: (SubPlan 1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Filter: ((t2.c2 % 6) = 0) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE (((c2 % 6) = 0)) SubPlan 1 -> Foreign Scan on public.ft1 t1 Output: count(*) FILTER (WHERE ((t2.c2 = 6) AND (t2.c1 < 10))) - Filter: (t1.c1 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(16 rows) + Remote SQL: SELECT NULL FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 6)) +(14 rows) --Testcase 267: select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; @@ -4193,8 +4137,8 @@ select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft --Testcase 268: explain (verbose, costs off) select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Unique Output: ((SubPlan 1)) -> Sort @@ -4202,16 +4146,14 @@ select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) fro Sort Key: ((SubPlan 1)) -> Foreign Scan on public.ft2 t2 Output: (SubPlan 1) - Filter: ((t2.c2 % 6) = 0) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE (((c2 % 6) = 0)) SubPlan 1 -> Aggregate Output: count(t1.c1) FILTER (WHERE ((t2.c2 = 6) AND (t2.c1 < 10))) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(16 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 6)) +(14 rows) --Testcase 269: select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; @@ -4235,25 +4177,24 @@ select sum(c1) filter (where (c1 / c1) * random() <= 1) from ft1 group by c2 ord Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 271: explain (verbose, costs off) select sum(c2) filter (where c2 in (select c2 from ft1 where c2 < 5)) from ft1; - QUERY PLAN -------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Aggregate Output: sum(ft1.c2) FILTER (WHERE (hashed SubPlan 1)) -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` SubPlan 1 -> Foreign Scan on public.ft1 ft1_1 Output: ft1_1.c2 - Filter: (ft1_1.c2 < 5) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 5)) +(9 rows) -- Ordered-sets within aggregate --Testcase 272: @@ -4270,9 +4211,8 @@ select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10 Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c6, c1 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2, c6 FROM odbc_fdw_post.`T1` WHERE ((c2 < 10)) +(10 rows) --Testcase 273: select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10::numeric) within group (order by c1) from ft1 where c2 < 10 group by c2 having percentile_cont(c2/10::numeric) within group (order by c1) < 500 order by c2; @@ -4289,8 +4229,8 @@ select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10 --Testcase 274: explain (verbose, costs off) select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 having c1 = 6 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------- GroupAggregate Output: c1, rank(c1, c2) WITHIN GROUP (ORDER BY c1, c2), c2 Group Key: ft1.c1, ft1.c2 @@ -4299,9 +4239,8 @@ select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2 - Filter: (ft1.c1 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 6)) +(9 rows) --Testcase 275: select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 having c1 = 6 order by 1; @@ -4326,8 +4265,8 @@ set enable_hashagg to false; --Testcase 279: explain (verbose, costs off) select c2, least_agg(c1) from ft1 group by c2 order by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4336,7 +4275,7 @@ select c2, least_agg(c1) from ft1 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) -- Add function and aggregate into extension @@ -4350,8 +4289,8 @@ alter extension :DB_EXTENSIONNAME add aggregate least_agg(variadic items anyarra --Testcase 283: explain (verbose, costs off) select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4360,9 +4299,8 @@ select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Filter: (ft1.c2 < 100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 100)) +(9 rows) --Testcase 284: select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; @@ -4391,8 +4329,8 @@ alter extension :DB_EXTENSIONNAME drop aggregate least_agg(variadic items anyarr --Testcase 288: explain (verbose, costs off) select c2, least_agg(c1) from ft1 group by c2 order by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4401,7 +4339,7 @@ select c2, least_agg(c1) from ft1 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) -- Cleanup @@ -4450,16 +4388,15 @@ create operator class my_op_class for type int using btree family my_op_family a --Testcase 298: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) AND ((c2 = 6)) +(6 rows) -- Update local stats on ft2 ANALYZE ft2; @@ -4483,16 +4420,15 @@ alter extension :DB_EXTENSIONNAME add operator public.>^(int, int); --Testcase 306: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) AND ((c2 = 6)) +(6 rows) --Testcase 307: select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; @@ -4520,16 +4456,15 @@ alter extension :DB_EXTENSIONNAME drop operator public.>^(int, int); --Testcase 315: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) AND ((c2 = 6)) +(6 rows) -- Cleanup --Testcase 316: @@ -4549,8 +4484,8 @@ drop operator public.<^(int, int); --Testcase 322: explain (verbose, costs off) select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2); - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate Output: count(t1.c3) -> Nested Loop Left Join @@ -4558,12 +4493,12 @@ select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2); Join Filter: ((t1.c1)::double precision = (random() * (t2.c2)::double precision)) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c2 -> Foreign Scan on public.ft2 t2 Output: t2.c2 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (13 rows) -- Subquery in FROM clause having aggregate @@ -4584,7 +4519,7 @@ select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x w Hash Cond: (ft1.c2 = x.a) -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` -> Hash Output: x.b, x.a -> Subquery Scan on x @@ -4594,7 +4529,7 @@ select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x w Group Key: ft1_1.c2 -> Foreign Scan on public.ft1 ft1_1 Output: ft1_1.c1, ft1_1.c2, ft1_1.c3, ft1_1.c4, ft1_1.c5, ft1_1.c6, ft1_1.c7, ft1_1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (23 rows) --Testcase 324: @@ -4631,12 +4566,12 @@ select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) gr Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (18 rows) --Testcase 326: @@ -4653,8 +4588,8 @@ select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) gr --Testcase 327: explain (verbose, costs off) select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1); - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Aggregate Output: count(*), sum(ft4.c1), avg(ft5.c1) -> Hash Full Join @@ -4662,15 +4597,13 @@ select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 betwee Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(15 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(13 rows) --Testcase 328: select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1); @@ -4684,17 +4617,15 @@ select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 betwee --Testcase 329: explain (verbose, costs off) select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Sort - Output: ((sum(c2) * ((random() <= '1'::double precision))::integer)) - Sort Key: ((sum(ft1.c2) * ((random() <= '1'::double precision))::integer)) - -> Aggregate - Output: (sum(c2) * ((random() <= '1'::double precision))::integer) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(8 rows) + Output: (((sum(c2)) * ((random() <= '1'::double precision))::integer)) + Sort Key: (((sum(ft1.c2)) * ((random() <= '1'::double precision))::integer)) + -> Foreign Scan + Output: ((sum(c2)) * ((random() <= '1'::double precision))::integer) + Remote SQL: SELECT sum(c2) FROM odbc_fdw_post.`T1` +(6 rows) --Testcase 330: select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1; @@ -4709,8 +4640,8 @@ set enable_hashagg to false; --Testcase 332: explain (verbose, costs off) select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum from ft2 t2 group by t2.c1) qry where t1.c2 * 2 = qry.sum and t1.c2 < 3 and t1."C_1" < 100 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------------- Sort Output: t1.c2, qry.sum Sort Key: t1.c2 @@ -4718,8 +4649,7 @@ select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum fro Output: t1.c2, qry.sum -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1", t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: ((t1.c2 < 3) AND (t1."C_1" < 100)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) AND ((`C_1` < 100)) -> Subquery Scan on qry Output: qry.sum, t2.c1 Filter: ((t1.c2 * 2) = qry.sum) @@ -4731,8 +4661,8 @@ select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum fro Sort Key: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(21 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` +(20 rows) --Testcase 333: select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum from ft2 t2 group by t2.c1) qry where t1.c2 * 2 = qry.sum and t1.c2 < 3 and t1."C_1" < 100 order by 1; @@ -4769,19 +4699,16 @@ ORDER BY ref_0."C_1"; Output: ref_0.c2, ref_0."C_1", ref_1.c3, (ref_0.c2) -> Foreign Scan on "S 1"."T1" ref_0 Output: ref_0."C_1", ref_0.c2, ref_0.c3, ref_0.c4, ref_0.c5, ref_0.c6, ref_0.c7, ref_0.c8 - Filter: (ref_0."C_1" < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 10)) -> Foreign Scan on public.ft1 ref_1 Output: ref_1.c3, ref_0.c2 - Filter: (ref_1.c3 = '00001'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((c3 = '00001')) -> Materialize Output: ref_3.c3 -> Foreign Scan on public.ft2 ref_3 Output: ref_3.c3 - Filter: (ref_3.c3 = '00001'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(21 rows) + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((c3 = '00001')) +(18 rows) --Testcase 336: SELECT ref_0.c2, subq_1.* @@ -4812,8 +4739,8 @@ ORDER BY ref_0."C_1"; --Testcase 337: explain (verbose, costs off) select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2.c1) from ft1 right join ft2 on (ft1.c1 = ft2.c1)) q(a, b, c) on (ft4.c1 <= q.b); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Aggregate Output: sum(q.a), count(q.b) -> Nested Loop Left Join @@ -4822,7 +4749,7 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. Join Filter: ((ft4.c1)::numeric <= q.b) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Materialize Output: q.a, q.b -> Subquery Scan on q @@ -4834,12 +4761,12 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. Hash Cond: (ft2.c1 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (26 rows) --Testcase 338: @@ -4854,8 +4781,8 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. --Testcase 339: explain (verbose, costs off) select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: c2, (sum(c1)) Sort Key: ft1.c2 @@ -4865,9 +4792,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls la Group Key: () -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) +(10 rows) --Testcase 340: select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last; @@ -4882,8 +4808,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls la --Testcase 341: explain (verbose, costs off) select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: c2, (sum(c1)) Sort Key: ft1.c2 @@ -4893,9 +4819,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last Group Key: () -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) +(10 rows) --Testcase 342: select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last; @@ -4910,8 +4835,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last --Testcase 343: explain (verbose, costs off) select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------- Sort Output: c2, c6, (sum(c1)) Sort Key: ft1.c2, ft1.c6 @@ -4921,9 +4846,8 @@ select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) orde Hash Key: ft1.c6 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2, c6 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) +(10 rows) --Testcase 344: select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last; @@ -4940,8 +4864,8 @@ select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) orde --Testcase 345: explain (verbose, costs off) select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: c2, (sum(c1)), (GROUPING(c2)) Sort Key: ft1.c2 @@ -4950,9 +4874,8 @@ select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nu Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) +(9 rows) --Testcase 346: select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last; @@ -4967,8 +4890,8 @@ select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nu --Testcase 347: explain (verbose, costs off) select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Unique Output: ((sum(c1) / 1000)), c2 -> Sort @@ -4979,9 +4902,8 @@ select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft2.c2 < 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(12 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 6)) +(11 rows) --Testcase 348: select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; @@ -4995,8 +4917,8 @@ select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; --Testcase 349: explain (verbose, costs off) select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Sort Output: c2, (sum(c2)), (count(c2) OVER (?)), ((c2 % 2)) Sort Key: ft2.c2 @@ -5010,9 +4932,8 @@ select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 gr Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft2.c2 < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(15 rows) + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 10)) +(14 rows) --Testcase 350: select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1; @@ -5033,8 +4954,8 @@ select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 gr --Testcase 351: explain (verbose, costs off) select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Sort Output: c2, (array_agg(c2) OVER (?)), ((c2 % 2)) Sort Key: ft1.c2 @@ -5048,9 +4969,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 wher Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(15 rows) + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 10)) +(14 rows) --Testcase 352: select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1; @@ -5071,8 +4991,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 wher --Testcase 353: explain (verbose, costs off) select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Sort Output: c2, (array_agg(c2) OVER (?)), ((c2 % 2)) Sort Key: ft1.c2 @@ -5086,9 +5006,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 range between curre Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(15 rows) + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 10)) +(14 rows) --Testcase 354: select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1; @@ -5114,21 +5033,19 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 range between curre PREPARE st1(int, int) AS SELECT t1.c3, t2.c3 FROM ft1 t1, ft2 t2 WHERE t1.c1 = $1 AND t2.c1 = $2; --Testcase 356: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st1(1, 2); - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------- Nested Loop Output: t1.c3, t2.c3 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) -> Materialize Output: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: (t2.c1 = 2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(12 rows) + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 2)) +(10 rows) --Testcase 357: EXECUTE st1(1, 1); @@ -5149,8 +5066,8 @@ EXECUTE st1(101, 101); PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c4) = '1970-01-17'::date) ORDER BY c1; --Testcase 360: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------ Sort Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 Sort Key: t1.c1 @@ -5160,8 +5077,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); Hash Cond: (t1.c3 = t2.c3) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 < 20) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 20)) -> Hash Output: t2.c3 -> HashAggregate @@ -5169,9 +5085,8 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); Group Key: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: ((t2.c1 > 10) AND (date(t2.c4) = '01-17-1970'::date)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(20 rows) + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 10)) AND ((date(c4) = '1970-01-17')) +(18 rows) --Testcase 361: EXECUTE st2(10, 20); @@ -5192,8 +5107,8 @@ EXECUTE st2(101, 121); PREPARE st3(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c5) = '1970-01-17'::date) ORDER BY c1; --Testcase 364: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------ Sort Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 Sort Key: t1.c1 @@ -5203,8 +5118,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); Hash Cond: (t1.c3 = t2.c3) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 < 20) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 20)) -> Hash Output: t2.c3 -> HashAggregate @@ -5212,9 +5126,8 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); Group Key: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: ((t2.c1 > 10) AND (date(t2.c5) = '01-17-1970'::date)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(20 rows) + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 10)) AND ((date(c5) = '1970-01-17')) +(18 rows) --Testcase 365: EXECUTE st3(10, 20); @@ -5234,63 +5147,58 @@ EXECUTE st3(20, 30); PREPARE st4(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 = $1; --Testcase 368: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 369: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 370: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 371: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 372: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) -- once we try it enough times, should switch to generic plan --Testcase 373: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = $1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) -- value of $1 should not be sent to remote @@ -5298,62 +5206,57 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); PREPARE st5(text,int) AS SELECT * FROM ft1 t1 WHERE c8 = $1 and c1 = $2; --Testcase 375: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 376: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 377: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 378: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 379: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 380: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c8 = $1) AND (t1.c1 = $2)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 381: @@ -5368,13 +5271,12 @@ EXECUTE st5('foo', 1); PREPARE st6 AS SELECT * FROM ft1 t1 WHERE t1.c1 = t1.c2; --Testcase 383: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = c2)) +(3 rows) --Testcase 384: PREPARE st7 AS INSERT INTO ft1 (c1,c2,c3) VALUES (1001,101,'foo'); @@ -5383,7 +5285,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft1 - Remote SQL: INSERT INTO `odbc_fdw_post`.`T1`(`C_1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.`T1`(`C_1`, c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1001, 101, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::text (4 rows) @@ -5392,13 +5294,12 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; -- ALTER FOREIGN TABLE ft1 OPTIONS (SET table 'T 0'); --Testcase 386: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = c2)) +(3 rows) --Testcase 387: EXECUTE st6; @@ -5420,7 +5321,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft1 - Remote SQL: INSERT INTO `odbc_fdw_post`.`T1`(`C_1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.`T1`(`C_1`, c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1001, 101, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::text (4 rows) @@ -5431,28 +5332,28 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; PREPARE st8 AS SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 390: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 391: -- ALTER SERVER :DB_SERVERNAME OPTIONS (DROP extensions); --Testcase 392: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 393: @@ -5477,14 +5378,14 @@ DEALLOCATE st8; --Testcase 395: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.tableoid = 'pg_class'::regclass LIMIT 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.tableoid = '1259'::oid) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 396: @@ -5497,13 +5398,13 @@ SELECT * FROM ft1 t1 WHERE t1.tableoid = 'ft1'::regclass LIMIT 1; --Testcase 397: EXPLAIN (VERBOSE, COSTS OFF) SELECT tableoid::regclass, * FROM ft1 t1 LIMIT 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Limit Output: ((tableoid)::regclass), c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: (tableoid)::regclass, c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (5 rows) --Testcase 398: @@ -5516,12 +5417,12 @@ SELECT tableoid::regclass, * FROM ft1 t1 LIMIT 1; --Testcase 399: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.ctid = '(0,2)'; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.ctid = '(0,2)'::tid) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 400: @@ -5534,13 +5435,13 @@ SELECT * FROM ft1 t1 WHERE t1.ctid = '(0,2)'; --Testcase 401: EXPLAIN (VERBOSE, COSTS OFF) SELECT ctid, * FROM ft1 t1 LIMIT 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Limit Output: ctid, c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: ctid, c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (5 rows) --Testcase 402: @@ -5621,118 +5522,113 @@ create foreign table ft3 (f1 text collate "C", f2 text, f3 varchar(10)) -- can be sent to remote --Testcase 415: explain (verbose, costs off) select * from ft3 where f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f1 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f1 = 'foo')) +(3 rows) --Testcase 416: explain (verbose, costs off) select * from ft3 where f1 COLLATE "C" = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f1 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f1 = 'foo')) +(3 rows) --Testcase 417: explain (verbose, costs off) select * from ft3 where f2 = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f2 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f2 = 'foo')) +(3 rows) --Testcase 418: explain (verbose, costs off) select * from ft3 where f3 = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f3)::text = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 419: explain (verbose, costs off) select * from ft3 f, ft3 l where f.f3 = l.f3 and l.f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Nested Loop Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3 Join Filter: ((f.f3)::text = (l.f3)::text) -> Foreign Scan on public.ft3 f Output: f.f1, f.f2, f.f3 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 -> Foreign Scan on public.ft3 l Output: l.f1, l.f2, l.f3 - Filter: (l.f1 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(10 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f1 = 'foo')) +(9 rows) -- can't be sent to remote --Testcase 420: explain (verbose, costs off) select * from ft3 where f1 COLLATE "POSIX" = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f1)::text = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 421: explain (verbose, costs off) select * from ft3 where f1 = 'foo' COLLATE "C"; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: (ft3.f1 = 'foo'::text COLLATE "C") - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 422: explain (verbose, costs off) select * from ft3 where f2 COLLATE "C" = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f2)::text = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 423: explain (verbose, costs off) select * from ft3 where f2 = 'foo' COLLATE "C"; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: (ft3.f2 = 'foo'::text COLLATE "C") - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 424: explain (verbose, costs off) select * from ft3 f, ft3 l where f.f3 = l.f3 COLLATE "POSIX" and l.f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Nested Loop Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3 Join Filter: ((f.f3)::text = (l.f3)::text) -> Foreign Scan on public.ft3 f Output: f.f1, f.f2, f.f3 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 -> Foreign Scan on public.ft3 l Output: l.f1, l.f2, l.f3 - Filter: (l.f1 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(10 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f1 = 'foo')) +(9 rows) -- =================================================================== -- test writable foreign table stuff @@ -5743,14 +5639,14 @@ INSERT INTO ft2 (c1,c2,c3) SELECT c1+1000,c2+100, c3 || c3 FROM ft2 LIMIT 20; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft2 - Remote SQL: INSERT INTO `odbc_fdw_post`.`T1`(`C_1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.`T1`(`C_1`, c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Subquery Scan on "*SELECT*" Output: "*SELECT*"."?column?", "*SELECT*"."?column?_1", "*SELECT*"."?column?_2", NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::text -> Limit Output: ((ft2_1.c1 + 1000)), ((ft2_1.c2 + 100)), ((ft2_1.c3 || ft2_1.c3)) -> Foreign Scan on public.ft2 ft2_1 Output: (ft2_1.c1 + 1000), (ft2_1.c2 + 100), (ft2_1.c3 || ft2_1.c3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 426: @@ -5771,30 +5667,28 @@ INSERT INTO ft2 (c1,c2,c3) VALUES (1104,204,'ddd'), (1105,205,'eee'); --Testcase 429: EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ?, `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ?, c3 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: c1, (c2 + 300), (c3 || '_update3'::text), c4, c5, c6, c7, c8, c1 - Filter: ((ft2.c1 % 10) = 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 3)) +(5 rows) --Testcase 430: UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3; --Testcase 431: EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ?, `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ?, c3 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: c1, (c2 + 400), (c3 || '_update7'::text), c4, c5, c6, c7, c8, c1 - Filter: ((ft2.c1 % 10) = 7) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 7)) +(5 rows) --Testcase 432: UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7; @@ -5912,20 +5806,19 @@ UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ?, `c3` = ?, `c7` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ?, c3 = ?, c7 = ? WHERE `C_1` = ? -> Hash Join Output: ft2.c1, (ft2.c2 + 500), (ft2.c3 || '_update9'::text), ft2.c4, ft2.c5, ft2.c6, 'ft2 '::character(10), ft2.c8, ft2.c1, ft1.* Hash Cond: (ft2.c2 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c8 FROM odbc_fdw_post.`T1` -> Hash Output: ft1.*, ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.*, ft1.c1 - Filter: ((ft1.c1 % 10) = 9) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 9)) +(13 rows) --Testcase 434: UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT @@ -5933,15 +5826,14 @@ UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT --Testcase 435: EXPLAIN (verbose, costs off) DELETE FROM ft2 WHERE c1 % 10 = 5; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: c1 - Filter: ((ft2.c1 % 10) = 5) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 5)) +(5 rows) --Testcase 436: SELECT c1, c4 FROM ft2 WHERE c1 % 10 = 5; @@ -6056,23 +5948,22 @@ DELETE FROM ft2 WHERE c1 % 10 = 5; --Testcase 437: EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Hash Join Output: ft2.c1, ft1.* Hash Cond: (ft2.c2 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: ft1.*, ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.*, ft1.c1 - Filter: ((ft1.c1 % 10) = 2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 2)) +(13 rows) --Testcase 438: DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2; @@ -6907,7 +6798,7 @@ INSERT INTO ft2 (c1,c2,c3) VALUES (1200,999,'foo'); QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft2 - Remote SQL: INSERT INTO `odbc_fdw_post`.`T1`(`C_1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.`T1`(`C_1`, c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1200, 999, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::text (4 rows) @@ -6923,15 +6814,14 @@ SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; --Testcase 442: EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'bar' WHERE c1 = 1200; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c3 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: c1, c2, 'bar'::text, c4, c5, c6, c7, c8, c1 - Filter: (ft2.c1 = 1200) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1200)) +(5 rows) --Testcase 443: UPDATE ft2 SET c3 = 'bar' WHERE c1 = 1200; @@ -6944,15 +6834,14 @@ SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; --Testcase 444: EXPLAIN (verbose, costs off) DELETE FROM ft2 WHERE c1 = 1200; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: c1 - Filter: (ft2.c1 = 1200) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1200)) +(5 rows) --Testcase 445: SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; @@ -6971,17 +6860,16 @@ EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'foo' FROM ft4 INNER JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 1200 AND ft2.c2 = ft4.c1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c3 = ? WHERE `C_1` = ? -> Hash Join Output: ft2.c1, ft2.c2, 'foo'::text, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: (ft2.c1 > 1200) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 1200)) -> Hash Output: ft4.*, ft4.c1, ft5.*, ft5.c1 -> Hash Join @@ -6989,13 +6877,13 @@ UPDATE ft2 SET c3 = 'foo' Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(21 rows) --Testcase 448: UPDATE ft2 SET c3 = 'foo' @@ -7027,17 +6915,16 @@ EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft4 LEFT JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 1200 AND ft2.c1 % 10 = 0 AND ft2.c2 = ft4.c1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Hash Join Output: ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: ((ft2.c1 > 1200) AND ((ft2.c1 % 10) = 0)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 1200)) AND (((`C_1` % 10) = 0)) -> Hash Output: ft4.*, ft4.c1, ft5.* -> Hash Left Join @@ -7045,13 +6932,13 @@ DELETE FROM ft2 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(21 rows) --Testcase 450: DELETE FROM ft2 @@ -7071,17 +6958,16 @@ UPDATE ft2 AS target SET (c2, c7) = ( QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------- Update on public.ft2 target - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ?, `c7` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ?, c7 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 target Output: target.c1, $1, target.c3, target.c4, target.c5, target.c6, $2, target.c8, (SubPlan 1 (returns $1,$2)), target.c1 - Filter: (target.c1 > 1100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3, c4, c5, c6, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 1100)) SubPlan 1 (returns $1,$2) -> Foreign Scan on public.ft2 src Output: (src.c2 * 10), src.c7 Filter: (target.c1 = src.c1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2, c7 FROM odbc_fdw_post.`T1` +(10 rows) --Testcase 453: UPDATE ft2 AS target SET (c2, c7) = ( @@ -7105,14 +6991,14 @@ INSERT INTO ft2 (c1,c2,c3) --Testcase 457: EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'bar' WHERE postgres_fdw_abs(c1) > 2000; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c3 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: c1, c2, 'bar'::text, c4, c5, c6, c7, c8, c1 Filter: (postgres_fdw_abs(ft2.c1) > 2000) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 458: @@ -7137,17 +7023,16 @@ EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'baz' FROM ft4 INNER JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 2000 AND ft2.c2 === ft4.c1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c3 = ? WHERE `C_1` = ? -> Nested Loop Output: ft2.c1, ft2.c2, 'baz'::text, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.c1, ft4.*, ft5.* Join Filter: (ft2.c2 === ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: (ft2.c1 > 2000) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 2000)) -> Materialize Output: ft4.*, ft4.c1, ft5.* -> Hash Join @@ -7155,13 +7040,13 @@ UPDATE ft2 SET c3 = 'baz' Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(21 rows) --Testcase 460: UPDATE ft2 SET c3 = 'baz' @@ -7179,17 +7064,16 @@ EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft4 INNER JOIN ft5 ON (ft4.c1 === ft5.c1) WHERE ft2.c1 > 2000 AND ft2.c2 = ft4.c1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Hash Join Output: ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: (ft2.c1 > 2000) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 2000)) -> Hash Output: ft4.*, ft4.c1, ft5.* -> Nested Loop @@ -7197,13 +7081,13 @@ DELETE FROM ft2 Join Filter: (ft4.c1 === ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Materialize Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(21 rows) --Testcase 462: DELETE FROM ft2 @@ -7635,8 +7519,8 @@ select c2, count(*) from "S 1"."T1" where c2 < 500 group by 1 order by 1; -- ORDER BY DESC NULLS LAST options --Testcase 495: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 OFFSET 795 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7644,7 +7528,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 O Sort Key: ft1.c6 DESC NULLS LAST, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 496: @@ -7666,8 +7550,8 @@ SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 OFFSET 795 LIMIT 10; -- ORDER BY DESC NULLS FIRST options --Testcase 497: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 OFFSET 15 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7675,7 +7559,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 Sort Key: ft1.c6 DESC, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 498: @@ -7697,8 +7581,8 @@ SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 OFFSET 15 LIMIT 10; -- ORDER BY ASC NULLS FIRST options --Testcase 499: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 OFFSET 15 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7706,7 +7590,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 O Sort Key: ft1.c6 NULLS FIRST, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 500: @@ -7733,15 +7617,12 @@ SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 OFFSET 15 LIMIT 10; ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2positive CHECK (c2 >= 0); --Testcase 502: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 < 0; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: count(*) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 0) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan + Output: (count(*)) + Remote SQL: SELECT count(*) FROM odbc_fdw_post.`T1` WHERE ((c2 < 0)) +(3 rows) --Testcase 503: SELECT count(*) FROM ft1 WHERE c2 < 0; @@ -7783,15 +7664,12 @@ ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c2positive; ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2negative CHECK (c2 < 0); --Testcase 512: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 >= 0; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: count(*) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 >= 0) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan + Output: (count(*)) + Remote SQL: SELECT count(*) FROM odbc_fdw_post.`T1` WHERE ((c2 >= 0)) +(3 rows) --Testcase 513: SELECT count(*) FROM ft1 WHERE c2 >= 0; @@ -7856,10 +7734,10 @@ Options: check_option=cascaded --Testcase 524: EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view VALUES (0, 5); - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Insert on public.foreign_tbl - Remote SQL: INSERT INTO `odbc_fdw_post`.`base_tbl`(`a`, `b`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.base_tbl(a, b) VALUES (?, ?) -> Result Output: 0, 5 (4 rows) @@ -7873,10 +7751,10 @@ DETAIL: Failing row contains (10, 5). --Testcase 526: EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view VALUES (0, 15); - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Insert on public.foreign_tbl - Remote SQL: INSERT INTO `odbc_fdw_post`.`base_tbl`(`a`, `b`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.base_tbl(a, b) VALUES (?, ?) -> Result Output: 0, 15 (4 rows) @@ -7894,15 +7772,14 @@ SELECT * FROM foreign_tbl; --Testcase 529: EXPLAIN (VERBOSE, COSTS OFF) UPDATE rw_view SET b = b + 5; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Update on public.foreign_tbl - Remote SQL: UPDATE `odbc_fdw_post`.`base_tbl` SET `a` = ?, `b` = ? WHERE `a` = ? + Remote SQL: UPDATE odbc_fdw_post.base_tbl SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.foreign_tbl Output: foreign_tbl.a, (foreign_tbl.b + 5), foreign_tbl.a, foreign_tbl.* - Filter: (foreign_tbl.a < foreign_tbl.b) - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`base_tbl` -(6 rows) + Remote SQL: SELECT a, b FROM odbc_fdw_post.base_tbl WHERE ((a < b)) +(5 rows) --Testcase 530: UPDATE rw_view SET b = b + 5; -- should fail @@ -7911,15 +7788,14 @@ DETAIL: Failing row contains (20, 20). --Testcase 531: EXPLAIN (VERBOSE, COSTS OFF) UPDATE rw_view SET b = b + 15; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------- Update on public.foreign_tbl - Remote SQL: UPDATE `odbc_fdw_post`.`base_tbl` SET `a` = ?, `b` = ? WHERE `a` = ? + Remote SQL: UPDATE odbc_fdw_post.base_tbl SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.foreign_tbl Output: foreign_tbl.a, (foreign_tbl.b + 15), foreign_tbl.a, foreign_tbl.* - Filter: (foreign_tbl.a < foreign_tbl.b) - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`base_tbl` -(6 rows) + Remote SQL: SELECT a, b FROM odbc_fdw_post.base_tbl WHERE ((a < b)) +(5 rows) --Testcase 532: UPDATE rw_view SET b = b + 15; -- ok @@ -8003,12 +7879,11 @@ UPDATE rw_view SET b = b + 5; ---------------------------------------------------------------------------------------- Update on public.parent_tbl Foreign Update on public.foreign_tbl parent_tbl_1 - Remote SQL: UPDATE `odbc_fdw_post`.`child_tbl` SET `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.child_tbl SET b = ? WHERE id = ? -> Foreign Scan on public.foreign_tbl parent_tbl_1 Output: parent_tbl_1.a, (parent_tbl_1.b + 5), parent_tbl_1.id, parent_tbl_1.id - Filter: (parent_tbl_1.a < parent_tbl_1.b) - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`child_tbl` -(7 rows) + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.child_tbl WHERE ((a < b)) +(6 rows) --Testcase 546: UPDATE rw_view SET b = b + 5; -- should fail @@ -8019,12 +7894,11 @@ UPDATE rw_view SET b = b + 15; ----------------------------------------------------------------------------------------- Update on public.parent_tbl Foreign Update on public.foreign_tbl parent_tbl_1 - Remote SQL: UPDATE `odbc_fdw_post`.`child_tbl` SET `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.child_tbl SET b = ? WHERE id = ? -> Foreign Scan on public.foreign_tbl parent_tbl_1 Output: parent_tbl_1.a, (parent_tbl_1.b + 15), parent_tbl_1.id, parent_tbl_1.id - Filter: (parent_tbl_1.a < parent_tbl_1.b) - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`child_tbl` -(7 rows) + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.child_tbl WHERE ((a < b)) +(6 rows) --Testcase 548: UPDATE rw_view SET b = b + 15; -- ok @@ -8375,13 +8249,13 @@ SELECT f1, f2 from loc1; --Testcase 609: EXPLAIN (verbose, costs off) UPDATE rem1 set f1 = 10; -- all columns should be transmitted - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f1` = ?, `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f1 = ?, f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: 10, f2, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 610: @@ -8539,25 +8413,25 @@ CREATE TRIGGER trig_stmt_before --Testcase 646: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 647: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 648: @@ -8569,25 +8443,25 @@ CREATE TRIGGER trig_stmt_after --Testcase 650: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 651: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 652: @@ -8600,25 +8474,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 654: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 655: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 656: @@ -8630,25 +8504,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 658: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 659: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 660: @@ -8661,25 +8535,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 662: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f1` = ?, `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f1 = ?, f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 663: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 664: @@ -8691,25 +8565,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 666: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can't be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 667: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 668: @@ -8722,25 +8596,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 670: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 671: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 672: @@ -8752,25 +8626,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 674: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 675: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 676: @@ -8997,7 +8871,7 @@ select * from bar where f1 in (select f1 from foo) for update; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -9005,7 +8879,7 @@ select * from bar where f1 in (select f1 from foo) for update; Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 (19 rows) --Testcase 723: @@ -9033,7 +8907,7 @@ select * from bar where f1 in (select f1 from foo) for share; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -9041,7 +8915,7 @@ select * from bar where f1 in (select f1 from foo) for share; Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 (19 rows) --Testcase 725: @@ -9063,7 +8937,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Update on public.bar Update on public.bar Foreign Update on public.bar2 bar_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct2` SET `f2` = ? WHERE `f3` = ? + Remote SQL: UPDATE odbc_fdw_post.loct2 SET f2 = ? WHERE f3 = ? -> Hash Semi Join Output: bar.f1, (bar.f2 + 100), bar.ctid, foo.ctid, foo.*, foo.tableoid Hash Cond: (bar.f1 = foo.f1) @@ -9076,13 +8950,13 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 -> Hash Semi Join Output: bar_1.f1, (bar_1.f2 + 100), bar_1.f3, bar_1.f3, foo.ctid, foo.*, foo.tableoid Hash Cond: (bar_1.f1 = foo.f1) -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f1, bar_1.f2, bar_1.f3 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -9090,7 +8964,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 (31 rows) --Testcase 727: @@ -9114,12 +8988,12 @@ update bar set f2 = f2 + 100 from ( select f1 from foo union all select f1+3 from foo ) ss where bar.f1 = ss.f1; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Update on public.bar Update on public.bar Foreign Update on public.bar2 bar_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct2` SET `f2` = ? WHERE `f3` = ? + Remote SQL: UPDATE odbc_fdw_post.loct2 SET f2 = ? WHERE f3 = ? -> Hash Join Output: bar.f1, (bar.f2 + 100), bar.ctid, (ROW(foo.f1)) Hash Cond: (foo.f1 = bar.f1) @@ -9128,12 +9002,12 @@ where bar.f1 = ss.f1; Output: ROW(foo.f1), foo.f1 -> Foreign Scan on public.foo2 foo_1 Output: ROW(foo_1.f1), foo_1.f1 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 -> Seq Scan on public.foo foo_2 Output: ROW((foo_2.f1 + 3)), (foo_2.f1 + 3) -> Foreign Scan on public.foo2 foo_3 Output: ROW((foo_3.f1 + 3)), (foo_3.f1 + 3) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 -> Hash Output: bar.f1, bar.f2, bar.ctid -> Seq Scan on public.bar @@ -9146,17 +9020,17 @@ where bar.f1 = ss.f1; Output: ROW(foo.f1), foo.f1 -> Foreign Scan on public.foo2 foo_1 Output: ROW(foo_1.f1), foo_1.f1 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 -> Seq Scan on public.foo foo_2 Output: ROW((foo_2.f1 + 3)), (foo_2.f1 + 3) -> Foreign Scan on public.foo2 foo_3 Output: ROW((foo_3.f1 + 3)), (foo_3.f1 + 3) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 -> Hash Output: bar_1.f1, bar_1.f2, bar_1.f3 -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f1, bar_1.f2, bar_1.f3 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 (41 rows) --Testcase 730: @@ -9202,8 +9076,8 @@ analyze foo; --Testcase 739: explain (verbose, costs off) select foo.f1, foo2.f1 from foo join foo2 on (foo.f1 = foo2.f1) order by foo.f2 offset 10 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: foo.f1, foo2.f1, foo.f2 -> Sort @@ -9221,13 +9095,13 @@ explain (verbose, costs off) Sort Key: foo_2.f1 -> Foreign Scan on public.foo2 foo_2 Output: foo_2.f1, foo_2.f2 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loct1 -> Sort Output: foo2.f1 Sort Key: foo2.f1 -> Foreign Scan on public.foo2 Output: foo2.f1 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 (24 rows) --Testcase 740: @@ -9251,8 +9125,8 @@ select foo.f1, foo2.f1 from foo join foo2 on (foo.f1 = foo2.f1) order by foo.f2 --Testcase 741: explain (verbose, costs off) select foo.f1, foo2.f1 from foo left join foo2 on (foo.f1 = foo2.f1) order by foo.f2 offset 10 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: foo.f1, foo2.f1, foo.f2 -> Sort @@ -9270,13 +9144,13 @@ explain (verbose, costs off) Sort Key: foo_2.f1 -> Foreign Scan on public.foo2 foo_2 Output: foo_2.f1, foo_2.f2 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loct1 -> Sort Output: foo2.f1 Sort Key: foo2.f1 -> Foreign Scan on public.foo2 Output: foo2.f1 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 (24 rows) --Testcase 742: @@ -9308,37 +9182,36 @@ RESET enable_nestloop; --Testcase 745: explain (verbose, costs off) delete from foo where f1 < 5; - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Delete on public.foo Delete on public.foo Foreign Delete on public.foo2 foo_1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loct1` WHERE `f3` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loct1 WHERE f3 = ? -> Index Scan using i_foo_f1 on public.foo Output: foo.ctid Index Cond: (foo.f1 < 5) -> Foreign Scan on public.foo2 foo_1 Output: foo_1.f3 - Filter: (foo_1.f1 < 5) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` -(11 rows) + Remote SQL: SELECT f3 FROM odbc_fdw_post.loct1 WHERE ((f1 < 5)) +(10 rows) --Testcase 746: delete from foo where f1 < 5; --Testcase 747: explain (verbose, costs off) update bar set f2 = f2 + 100; - QUERY PLAN ----------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Update on public.bar Update on public.bar Foreign Update on public.bar2 bar_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct2` SET `f2` = ? WHERE `f3` = ? + Remote SQL: UPDATE odbc_fdw_post.loct2 SET f2 = ? WHERE f3 = ? -> Seq Scan on public.bar Output: bar.f1, (bar.f2 + 100), bar.ctid -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f1, (bar_1.f2 + 100), bar_1.f3, bar_1.f3 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 (9 rows) --Testcase 748: @@ -9355,17 +9228,17 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 751: explain (verbose, costs off) update bar set f2 = f2 + 100; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Update on public.bar Update on public.bar Foreign Update on public.bar2 bar_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct2` SET `f1` = ?, `f2` = ?, `f3` = ? WHERE `f3` = ? + Remote SQL: UPDATE odbc_fdw_post.loct2 SET f1 = ?, f2 = ?, f3 = ? WHERE f3 = ? -> Seq Scan on public.bar Output: bar.f1, (bar.f2 + 100), bar.ctid -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f1, (bar_1.f2 + 100), bar_1.f3, bar_1.f3, bar_1.* - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 (9 rows) --Testcase 752: @@ -9385,20 +9258,19 @@ psql:sql/13.4/ported_postgres_fdw.sql:2635: NOTICE: OLD: (7,277,77),NEW: (7,377 --Testcase 753: explain (verbose, costs off) delete from bar where f2 < 400; - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------- Delete on public.bar Delete on public.bar Foreign Delete on public.bar2 bar_1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loct2` WHERE `f3` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loct2 WHERE f3 = ? -> Seq Scan on public.bar Output: bar.ctid Filter: (bar.f2 < 400) -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f3, bar_1.* - Filter: (bar_1.f2 < 400) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` -(11 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 WHERE ((f2 < 400)) +(10 rows) --Testcase 754: delete from bar where f2 < 400; @@ -9445,12 +9317,12 @@ insert into remt2 values (2, 'bar'); --Testcase 767: explain (verbose, costs off) update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------- Update on public.parent Update on public.parent Foreign Update on public.remt1 parent_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct1_2` SET `b` = ? WHERE `a` = ? + Remote SQL: UPDATE odbc_fdw_post.loct1_2 SET b = ? WHERE a = ? -> Nested Loop Output: parent.a, (parent.b || remt2.b), parent.ctid, remt2.* Join Filter: (parent.a = remt2.a) @@ -9458,18 +9330,18 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; Output: parent.a, parent.b, parent.ctid -> Foreign Scan on public.remt2 Output: remt2.b, remt2.*, remt2.a - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct2_2` + Remote SQL: SELECT a, b FROM odbc_fdw_post.loct2_2 -> Nested Loop Output: parent_1.a, (parent_1.b || remt2.b), parent_1.a, remt2.* Join Filter: (parent_1.a = remt2.a) -> Foreign Scan on public.remt1 parent_1 Output: parent_1.a, parent_1.b - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct1_2` + Remote SQL: SELECT a, b FROM odbc_fdw_post.loct1_2 -> Materialize Output: remt2.b, remt2.*, remt2.a -> Foreign Scan on public.remt2 Output: remt2.b, remt2.*, remt2.a - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct2_2` + Remote SQL: SELECT a, b FROM odbc_fdw_post.loct2_2 (23 rows) --Testcase 768: @@ -9477,12 +9349,12 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; --Testcase 769: explain (verbose, costs off) delete from parent using remt2 where parent.a = remt2.a; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Delete on public.parent Delete on public.parent Foreign Delete on public.remt1 parent_1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loct1_2` WHERE `a` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loct1_2 WHERE a = ? -> Nested Loop Output: parent.ctid, remt2.* Join Filter: (parent.a = remt2.a) @@ -9490,18 +9362,18 @@ delete from parent using remt2 where parent.a = remt2.a; Output: parent.ctid, parent.a -> Foreign Scan on public.remt2 Output: remt2.*, remt2.a - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct2_2` + Remote SQL: SELECT a, b FROM odbc_fdw_post.loct2_2 -> Nested Loop Output: parent_1.a, remt2.* Join Filter: (parent_1.a = remt2.a) -> Foreign Scan on public.remt1 parent_1 Output: parent_1.a, parent_1.b - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct1_2` + Remote SQL: SELECT a FROM odbc_fdw_post.loct1_2 -> Materialize Output: remt2.*, remt2.a -> Foreign Scan on public.remt2 Output: remt2.*, remt2.a - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct2_2` + Remote SQL: SELECT a, b FROM odbc_fdw_post.loct2_2 (23 rows) --Testcase 770: @@ -9713,20 +9585,19 @@ insert into utrtest values (2, 'qux'); --Testcase 828: explain (verbose, costs off) update utrtest set a = 1 where a = 1 or a = 2; - QUERY PLAN ----------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------- Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Foreign Scan on public.remp utrtest_1 Output: 1, utrtest_1.b, utrtest_1.id, utrtest_1.id - Filter: ((utrtest_1.a = 1) OR (utrtest_1.a = 2)) - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT b, id FROM odbc_fdw_post.loct_2 WHERE (((a = 1) OR (a = 2))) -> Seq Scan on public.locp utrtest_2 Output: 1, utrtest_2.b, utrtest_2.id, utrtest_2.ctid Filter: ((utrtest_2.a = 1) OR (utrtest_2.a = 2)) -(11 rows) +(10 rows) -- The new values are concatenated with ' triggered !' --Testcase 829: @@ -9769,15 +9640,15 @@ insert into utrtest values (2, 'qux'); --Testcase 838: explain (verbose, costs off) update utrtest set a = 1; - QUERY PLAN ----------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Foreign Scan on public.remp utrtest_1 Output: 1, utrtest_1.b, utrtest_1.id, utrtest_1.id - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT b, id FROM odbc_fdw_post.loct_2 -> Seq Scan on public.locp utrtest_2 Output: 1, utrtest_2.b, utrtest_2.id, utrtest_2.ctid (9 rows) @@ -9800,14 +9671,14 @@ update utrtest set a = 1 from (values (1), (2)) s(x) where a = s.x; ------------------------------------------------------------------------------ Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Nested Loop Output: 1, utrtest_1.b, utrtest_1.id, utrtest_1.id, "*VALUES*".* Join Filter: (utrtest_1.a = "*VALUES*".column1) -> Foreign Scan on public.remp utrtest_1 Output: utrtest_1.a, utrtest_1.b, utrtest_1.id - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.loct_2 -> Values Scan on "*VALUES*" Output: "*VALUES*".*, "*VALUES*".column1 -> Hash Join @@ -9850,17 +9721,17 @@ psql:sql/13.4/ported_postgres_fdw.sql:2931: ERROR: COPY and foreign partition r --Testcase 854: explain (verbose, costs off) update utrtest set a = 3; - QUERY PLAN ----------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Update on public.utrtest Update on public.locp utrtest_1 Foreign Update on public.remp utrtest_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? -> Seq Scan on public.locp utrtest_1 Output: 3, utrtest_1.b, utrtest_1.id, utrtest_1.ctid -> Foreign Scan on public.remp utrtest_2 Output: 3, utrtest_2.b, utrtest_2.id, utrtest_2.id - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT b, id FROM odbc_fdw_post.loct_2 (9 rows) --Testcase 855: @@ -9875,7 +9746,7 @@ update utrtest set a = 3 from (values (2), (3)) s(x) where a = s.x; Update on public.utrtest Update on public.locp utrtest_1 Foreign Update on public.remp utrtest_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? -> Hash Join Output: 3, utrtest_1.b, utrtest_1.id, utrtest_1.ctid, "*VALUES*".* Hash Cond: (utrtest_1.a = "*VALUES*".column1) @@ -9890,7 +9761,7 @@ update utrtest set a = 3 from (values (2), (3)) s(x) where a = s.x; Join Filter: (utrtest_2.a = "*VALUES*".column1) -> Foreign Scan on public.remp utrtest_2 Output: utrtest_2.a, utrtest_2.b, utrtest_2.id - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.loct_2 -> Values Scan on "*VALUES*" Output: "*VALUES*".*, "*VALUES*".column1 (21 rows) diff --git a/expected/13.4/mysql/select.out b/expected/13.4/mysql/select.out index 8f8bfa3..d77709e 100644 --- a/expected/13.4/mysql/select.out +++ b/expected/13.4/mysql/select.out @@ -61,17 +61,16 @@ EXPLAIN VERBOSE SELECT * FROM onek WHERE onek.unique1 < 10 ORDER BY onek.unique1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 Sort Key: onek.unique1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 - Filter: (onek.unique1 < 10) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 < 10)) +(7 rows) --Testcase 8: SELECT * FROM onek @@ -99,17 +98,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using >; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek.unique1 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM odbc_fdw_regress.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 10: SELECT onek.unique1, onek.stringu1 FROM onek @@ -147,17 +145,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 > 980 ORDER BY stringu1 using <; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek.stringu1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM odbc_fdw_regress.onek WHERE ((unique1 > 980)) +(7 rows) SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 > 980 @@ -194,17 +191,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 > 980 ORDER BY string4 using <, unique1 using >; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.string4, onek.unique1 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 13: SELECT onek.unique1, onek.string4 FROM onek @@ -242,17 +238,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 > 980 ORDER BY string4 using >, unique1 using <; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.string4 DESC, onek.unique1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 15: SELECT onek.unique1, onek.string4 FROM onek @@ -290,17 +285,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using >, string4 using <; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.unique1 DESC, onek.string4 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 17: SELECT onek.unique1, onek.string4 FROM onek @@ -339,17 +333,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using <, string4 using >; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.unique1, onek.string4 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 19: SELECT onek.unique1, onek.string4 FROM onek @@ -399,17 +392,16 @@ SET enable_sort TO off; --Testcase 23: EXPLAIN VERBOSE SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY onek2.unique1; -- add ORDER BY to stablize test result - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 Sort Key: onek2.unique1 -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 - Filter: (onek2.unique1 < 10) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 < 10)) +(7 rows) --Testcase 24: SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY onek2.unique1; -- add ORDER BY to stablize test result @@ -435,17 +427,16 @@ EXPLAIN VERBOSE SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 < 20 ORDER BY unique1 using >; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort (cost=10000001074.83..10000001077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek2.unique1 DESC -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek2.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM odbc_fdw_regress.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 26: SELECT onek2.unique1, onek2.stringu1 FROM onek2 @@ -482,17 +473,16 @@ SELECT onek2.unique1, onek2.stringu1 FROM onek2 EXPLAIN VERBOSE SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 > 980 ORDER BY onek2.unique1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek2.unique1 -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek2.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM odbc_fdw_regress.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 28: SELECT onek2.unique1, onek2.stringu1 FROM onek2 @@ -531,12 +521,12 @@ EXPLAIN VERBOSE SELECT two, stringu1, ten, string4 INTO TABLE tmp FROM onek; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=136) Output: two, stringu1, ten, string4 Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` + Remote SQL: SELECT two, ten, stringu1, string4 FROM odbc_fdw_regress.onek (4 rows) --Testcase 33: @@ -558,7 +548,7 @@ select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j) -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4 Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek -> Hash (cost=0.03..0.03 rows=2 width=36) Output: "*VALUES*".column1, "*VALUES*".column2 -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=36) @@ -589,7 +579,7 @@ select * from onek, Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4, $1 Filter: (onek.unique1 = $3) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek InitPlan 2 (returns $1) -> Limit (cost=0.12..0.12 rows=1 width=4) Output: "*VALUES*".column1 @@ -642,7 +632,7 @@ select * from onek -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4 Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek -> Hash (cost=0.05..0.05 rows=4 width=8) Output: "*VALUES*".column1, "*VALUES*".column2 -> Values Scan on "*VALUES*" (cost=0.00..0.05 rows=4 width=8) @@ -685,7 +675,7 @@ SELECT q1, q2 FROM int8_tbl; -> Foreign Scan on public.int8_tbl (cost=25.00..30.00 rows=5 width=16) Output: int8_tbl.q1, int8_tbl.q2 Foreign Table Size: 5 b - Remote SQL: SELECT `q1`,`q2` FROM `odbc_fdw_regress`.`int8_tbl` + Remote SQL: SELECT q1, q2 FROM odbc_fdw_regress.int8_tbl (16 rows) --Testcase 41: @@ -723,7 +713,7 @@ SELECT * FROM foo ORDER BY f1; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 44: @@ -750,7 +740,7 @@ SELECT * FROM foo ORDER BY f1 ASC; -- same thing -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 46: @@ -777,7 +767,7 @@ SELECT * FROM foo ORDER BY f1 NULLS FIRST; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 48: @@ -804,7 +794,7 @@ SELECT * FROM foo ORDER BY f1 DESC; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 50: @@ -831,7 +821,7 @@ SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 52: @@ -854,10 +844,10 @@ SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; --Testcase 53: explain (costs off) select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +--------------------------------------- Foreign Scan on onek2 - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) + Filter: (stringu1 = 'ATAAAA'::name) (2 rows) --Testcase 54: @@ -871,20 +861,19 @@ select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; --Testcase 55: explain (costs off, analyze on, timing off, summary off) select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +----------------------------------------------- Foreign Scan on onek2 (actual rows=1 loops=1) - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) - Rows Removed by Filter: 999 -(3 rows) + Filter: (stringu1 = 'ATAAAA'::name) +(2 rows) --Testcase 56: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +--------------------------------------- Foreign Scan on onek2 - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) + Filter: (stringu1 = 'ATAAAA'::name) (2 rows) --Testcase 57: @@ -898,10 +887,10 @@ select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; --Testcase 58: explain (costs off) select * from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 59: @@ -914,10 +903,10 @@ select * from onek2 where unique2 = 11 and stringu1 < 'B'; --Testcase 60: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 61: @@ -931,11 +920,11 @@ select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; --Testcase 62: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; - QUERY PLAN -------------------------------------------------------------- + QUERY PLAN +---------------------------------------- LockRows -> Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (3 rows) --Testcase 63: @@ -949,10 +938,10 @@ select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; --Testcase 64: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'C'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'C'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'C'::name) (2 rows) --Testcase 65: @@ -968,10 +957,10 @@ SET enable_indexscan TO off; --Testcase 67: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 68: @@ -988,10 +977,10 @@ RESET enable_indexscan; explain (costs off) select unique1, unique2 from onek2 where (unique2 = 11 or unique1 = 0) and stringu1 < 'B'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND ((unique2 = 11) OR (unique1 = 0))) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 71: diff --git a/expected/13.4/mysql/update.out b/expected/13.4/mysql/update.out index 32e3d79..8a06ab2 100644 --- a/expected/13.4/mysql/update.out +++ b/expected/13.4/mysql/update.out @@ -29,10 +29,10 @@ CREATE FOREIGN TABLE upsert_test ( --Testcase 6: EXPLAIN VERBOSE INSERT INTO update_test VALUES (5, 10, 'foo'); - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------- Insert on public.update_test (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`update_test`(`a`, `b`, `c`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 5, 10, 'foo'::text, nextval('update_test_id_seq'::regclass) (4 rows) @@ -42,10 +42,10 @@ INSERT INTO update_test VALUES (5, 10, 'foo'); --Testcase 8: EXPLAIN VERBOSE INSERT INTO update_test(b, a) VALUES (15, 10); - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------- Insert on public.update_test (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`update_test`(`a`, `b`, `c`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 10, 15, NULL::text, nextval('update_test_id_seq'::regclass) (4 rows) @@ -55,12 +55,12 @@ INSERT INTO update_test(b, a) VALUES (15, 10); --Testcase 10: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 11: @@ -74,14 +74,14 @@ SELECT * FROM update_test; --Testcase 12: EXPLAIN VERBOSE UPDATE update_test SET a = DEFAULT, b = DEFAULT; - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..27.00 rows=2 width=48) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=48) Output: 10, NULL::integer, c, id, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT c, id FROM odbc_fdw_regress.update_test (6 rows) --Testcase 13: @@ -89,12 +89,12 @@ UPDATE update_test SET a = DEFAULT, b = DEFAULT; --Testcase 14: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 15: @@ -109,28 +109,27 @@ SELECT * FROM update_test; --Testcase 16: EXPLAIN VERBOSE UPDATE update_test AS t SET b = 10 WHERE t.a = 10; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------- Update on public.update_test t (cost=25.00..27.00 rows=2 width=48) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET b = ? WHERE id = ? -> Foreign Scan on public.update_test t (cost=25.00..27.00 rows=2 width=48) Output: a, 10, c, id, id - Filter: (t.a = 10) Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, c, id FROM odbc_fdw_regress.update_test WHERE ((a = 10)) +(6 rows) --Testcase 17: UPDATE update_test AS t SET b = 10 WHERE t.a = 10; --Testcase 18: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 19: @@ -144,28 +143,27 @@ SELECT * FROM update_test; --Testcase 20: EXPLAIN VERBOSE UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Update on public.update_test t (cost=25.00..27.00 rows=2 width=48) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET b = ? WHERE id = ? -> Foreign Scan on public.update_test t (cost=25.00..27.00 rows=2 width=48) Output: a, (b + 10), c, id, id - Filter: (t.a = 10) Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((a = 10)) +(6 rows) --Testcase 21: UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; --Testcase 22: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 23: @@ -183,16 +181,15 @@ SELECT * FROM update_test; EXPLAIN VERBOSE UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) WHERE update_test.b = v.j; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..27.00 rows=2 width=48) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=48) Output: 100, update_test.b, update_test.c, update_test.id, update_test.id - Filter: (update_test.b = 20) Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT b, c, id FROM odbc_fdw_regress.update_test WHERE ((b = 20)) +(6 rows) --Testcase 25: UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) @@ -200,12 +197,12 @@ UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) --Testcase 26: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 27: @@ -241,11 +238,11 @@ INSERT INTO update_test(a, b, c) SELECT a,b+1,c FROM update_test; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Insert on public.update_test (cost=25.00..27.02 rows=2 width=44) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`update_test`(`a`, `b`, `c`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..27.02 rows=2 width=44) Output: update_test_1.a, (update_test_1.b + 1), update_test_1.c, nextval('update_test_id_seq'::regclass) Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c FROM odbc_fdw_regress.update_test (6 rows) --Testcase 31: @@ -253,12 +250,12 @@ INSERT INTO update_test(a, b, c) SELECT a,b+1,c FROM update_test; --Testcase 32: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 33: @@ -274,31 +271,30 @@ SELECT * FROM update_test; --Testcase 34: EXPLAIN VERBOSE UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.01 rows=4 width=48) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ?, `c` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ?, c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=48) Output: 10, (b + 11), 'bugle'::text, id, id - Filter: (update_test.c = 'foo'::text) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT b, id FROM odbc_fdw_regress.update_test WHERE ((c = 'foo')) +(6 rows) --Testcase 35: UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; --Testcase 36: EXPLAIN VERBOSE SELECT * FROM update_test ORDER BY b; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------- Sort (cost=29.04..29.05 rows=4 width=44) Output: a, b, c, id Sort Key: update_test.b -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (7 rows) --Testcase 37: @@ -314,31 +310,30 @@ SELECT * FROM update_test ORDER BY b; --Testcase 38: EXPLAIN VERBOSE UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.02 rows=4 width=48) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ?, `c` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ?, c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.02 rows=4 width=48) Output: (a + 1), (a + b), 'car'::text, id, id - Filter: (update_test.a = 10) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, id FROM odbc_fdw_regress.update_test WHERE ((a = 10)) +(6 rows) --Testcase 39: UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; --Testcase 40: EXPLAIN VERBOSE SELECT * FROM update_test ORDER BY b; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------- Sort (cost=29.04..29.05 rows=4 width=44) Output: a, b, c, id Sort Key: update_test.b -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (7 rows) --Testcase 41: @@ -365,22 +360,20 @@ EXPLAIN VERBOSE UPDATE update_test SET (b,a) = (select a,b from update_test where b = 41 and c = 'car') WHERE a = 100 AND b = 20; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.00..58.00 rows=4 width=80) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.00 rows=4 width=8) Output: update_test_1.a, update_test_1.b - Filter: ((update_test_1.b = 41) AND (update_test_1.c = 'car'::text)) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b FROM odbc_fdw_regress.update_test WHERE ((b = 41)) AND ((c = 'car')) -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=80) Output: $1, $0, update_test.c, update_test.id, NULL::record, update_test.id - Filter: ((update_test.a = 100) AND (update_test.b = 20)) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(13 rows) + Remote SQL: SELECT c, id FROM odbc_fdw_regress.update_test WHERE ((a = 100)) AND ((b = 20)) +(11 rows) --Testcase 45: UPDATE update_test @@ -389,12 +382,12 @@ UPDATE update_test --Testcase 46: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 47: @@ -416,17 +409,17 @@ UPDATE update_test o QUERY PLAN -------------------------------------------------------------------------------------------- Update on public.update_test o (cost=25.00..145.04 rows=4 width=80) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test o (cost=25.00..145.04 rows=4 width=80) Output: $4, $3, o.c, o.id, (SubPlan 1 (returns $3,$4)), o.id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test SubPlan 1 (returns $3,$4) -> Foreign Scan on public.update_test i (cost=25.00..29.01 rows=4 width=8) Output: (i.a + 1), i.b Filter: ((NOT (i.c IS DISTINCT FROM o.c)) AND (i.a = o.a) AND (i.b = o.b)) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c FROM odbc_fdw_regress.update_test (12 rows) --Testcase 49: @@ -436,12 +429,12 @@ UPDATE update_test o --Testcase 50: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 51: @@ -461,16 +454,16 @@ UPDATE update_test SET (b,a) = (select a+1,b from update_test); QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.01..58.01 rows=4 width=80) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.01 rows=4 width=8) Output: (update_test_1.a + 1), update_test_1.b Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b FROM odbc_fdw_regress.update_test -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=80) Output: $1, $0, update_test.c, update_test.id, NULL::record, update_test.id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT c, id FROM odbc_fdw_regress.update_test (11 rows) --Testcase 53: @@ -484,19 +477,17 @@ UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000) QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.01..58.01 rows=4 width=80) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.01 rows=4 width=8) Output: (update_test_1.a + 1), update_test_1.b - Filter: (update_test_1.a = 1000) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b FROM odbc_fdw_regress.update_test WHERE ((a = 1000)) -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=80) Output: $1, $0, update_test.c, update_test.id, NULL::record, update_test.id - Filter: (update_test.a = 11) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(13 rows) + Remote SQL: SELECT c, id FROM odbc_fdw_regress.update_test WHERE ((a = 11)) +(11 rows) --Testcase 55: UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000) @@ -513,12 +504,12 @@ SELECT * FROM update_test; --Testcase 56: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 57: @@ -536,16 +527,15 @@ SELECT * FROM update_test; EXPLAIN VERBOSE UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j) WHERE update_test.a = v.i; - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.00 rows=4 width=48) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=48) Output: 21, 100, update_test.c, update_test.id, update_test.id - Filter: (update_test.a = 21) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT c, id FROM odbc_fdw_regress.update_test WHERE ((a = 21)) +(6 rows) --Testcase 59: UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j) @@ -586,25 +576,24 @@ UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car'; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.00 rows=4 width=48) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `c` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=48) Output: a, b, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'::text, id, id - Filter: (update_test.c = 'car'::text) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, id FROM odbc_fdw_regress.update_test WHERE ((c = 'car')) +(6 rows) --Testcase 65: UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car'; --Testcase 66: EXPLAIN VERBOSE SELECT a, b, char_length(c) FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=12) Output: a, b, char_length(c) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c FROM odbc_fdw_regress.update_test (4 rows) --Testcase 67: @@ -623,21 +612,21 @@ EXPLAIN (VERBOSE, COSTS OFF) UPDATE update_test t SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a) WHERE CURRENT_USER = SESSION_USER; - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Update on public.update_test t - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? -> Result Output: $1, $2, t.c, t.id, (SubPlan 1 (returns $1,$2)), t.id One-Time Filter: (CURRENT_USER = SESSION_USER) -> Foreign Scan on public.update_test t Output: t.a, t.b, t.c, t.id - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, c, id FROM odbc_fdw_regress.update_test SubPlan 1 (returns $1,$2) -> Foreign Scan on public.update_test s Output: s.b, s.a Filter: (s.a = t.a) - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b FROM odbc_fdw_regress.update_test (13 rows) --Testcase 69: @@ -647,12 +636,12 @@ UPDATE update_test t --Testcase 70: EXPLAIN VERBOSE SELECT a, b, char_length(c) FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=12) Output: a, b, char_length(c) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c FROM odbc_fdw_regress.update_test (4 rows) --Testcase 71: @@ -669,10 +658,10 @@ SELECT a, b, char_length(c) FROM update_test; --Testcase 72: EXPLAIN VERBOSE INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo'); - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.upsert_test (cost=0.00..0.03 rows=2 width=36) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`upsert_test`(`a`, `b`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.upsert_test(a, b) VALUES (?, ?) -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=36) Output: "*VALUES*".column1, "*VALUES*".column2 (4 rows) diff --git a/expected/13.4/postgresql/char.out b/expected/13.4/postgresql/char.out index 72c95f2..6175115 100644 --- a/expected/13.4/postgresql/char.out +++ b/expected/13.4/postgresql/char.out @@ -42,7 +42,7 @@ INSERT INTO char_tbl VALUES ('a'); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'a'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -55,7 +55,7 @@ INSERT INTO char_tbl VALUES ('A'); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'A'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -69,7 +69,7 @@ INSERT INTO char_tbl VALUES ('1'); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -82,7 +82,7 @@ INSERT INTO char_tbl VALUES (2); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '2'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -95,7 +95,7 @@ INSERT INTO char_tbl VALUES ('3'); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '3'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -109,7 +109,7 @@ INSERT INTO char_tbl VALUES (''); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: ' '::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -130,7 +130,7 @@ INSERT INTO char_tbl VALUES ('c '); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'c'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -145,7 +145,7 @@ SELECT f1 FROM CHAR_TBL; Foreign Scan on public.char_tbl (cost=25.00..32.00 rows=7 width=8) Output: f1 Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" + Remote SQL: SELECT f1 FROM public.char_tbl (4 rows) --Testcase 24: @@ -161,6 +161,8 @@ SELECT f1 FROM CHAR_TBL; c (7 rows) +-- For Char, varchar, text in MySQL, comparison is case-insensitive. +-- Result at MySQL will not same as Postgres. --Testcase 25: EXPLAIN VERBOSE SELECT c.f1 @@ -170,10 +172,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 <> 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 <> 'a')) +(4 rows) --Testcase 26: SELECT c.f1 @@ -198,10 +199,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 = 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 = 'a')) +(4 rows) --Testcase 28: SELECT c.f1 @@ -221,10 +221,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 < 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 < 'a')) +(4 rows) --Testcase 30: SELECT c.f1 @@ -247,10 +246,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 <= 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 <= 'a')) +(4 rows) --Testcase 32: SELECT c.f1 @@ -274,10 +272,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 > 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 > 'a')) +(4 rows) --Testcase 34: SELECT c.f1 @@ -298,10 +295,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 >= 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 >= 'a')) +(4 rows) --Testcase 36: SELECT c.f1 @@ -327,7 +323,7 @@ INSERT INTO CHAR_TBL VALUES ('a'); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=24) - Remote SQL: INSERT INTO "public"."char_tbl_2"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'a '::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -340,7 +336,7 @@ INSERT INTO CHAR_TBL VALUES ('ab'); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=24) - Remote SQL: INSERT INTO "public"."char_tbl_2"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'ab '::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -353,7 +349,7 @@ INSERT INTO CHAR_TBL VALUES ('abcd'); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=24) - Remote SQL: INSERT INTO "public"."char_tbl_2"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'abcd'::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -363,17 +359,17 @@ INSERT INTO CHAR_TBL VALUES ('abcd'); --Testcase 45: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcde'); -psql:sql/13.4/char.sql:154: ERROR: value too long for type character(4) +psql:sql/13.4/char.sql:156: ERROR: value too long for type character(4) --Testcase 46: INSERT INTO CHAR_TBL VALUES ('abcde'); -psql:sql/13.4/char.sql:156: ERROR: value too long for type character(4) +psql:sql/13.4/char.sql:158: ERROR: value too long for type character(4) --Testcase 47: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcd '); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=1 width=24) - Remote SQL: INSERT INTO "public"."char_tbl_2"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'abcd'::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -387,7 +383,7 @@ EXPLAIN VERBOSE SELECT f1 FROM CHAR_TBL; Foreign Scan on public.char_tbl (cost=25.00..29.00 rows=4 width=20) Output: f1 Foreign Table Size: 4 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl_2" + Remote SQL: SELECT f1 FROM public.char_tbl_2 (4 rows) --Testcase 50: @@ -402,7 +398,7 @@ SELECT f1 FROM CHAR_TBL; --Testcase 51: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/13.4/char.sql:168: NOTICE: drop cascades to 2 other objects +psql:sql/13.4/char.sql:170: NOTICE: drop cascades to 2 other objects DETAIL: drop cascades to user mapping for public on server postgres_server drop cascades to foreign table char_tbl --Testcase 52: diff --git a/expected/13.4/postgresql/date.out b/expected/13.4/postgresql/date.out index 69fbd69..b18158c 100644 --- a/expected/13.4/postgresql/date.out +++ b/expected/13.4/postgresql/date.out @@ -176,7 +176,7 @@ SELECT f1 as "date", Foreign Scan on public.date_tbl (cost=25.00..41.05 rows=15 width=116) Output: f1, date_part('year'::text, (f1)::timestamp without time zone), date_part('month'::text, (f1)::timestamp without time zone), date_part('day'::text, (f1)::timestamp without time zone), date_part('quarter'::text, (f1)::timestamp without time zone), date_part('decade'::text, (f1)::timestamp without time zone), date_part('century'::text, (f1)::timestamp without time zone), date_part('millennium'::text, (f1)::timestamp without time zone), date_part('isoyear'::text, (f1)::timestamp without time zone), date_part('week'::text, (f1)::timestamp without time zone), date_part('dow'::text, (f1)::timestamp without time zone), date_part('isodow'::text, (f1)::timestamp without time zone), date_part('doy'::text, (f1)::timestamp without time zone), date_part('julian'::text, (f1)::timestamp without time zone), date_part('epoch'::text, (f1)::timestamp without time zone) Foreign Table Size: 15 b - Remote SQL: SELECT "f1","id" FROM "public"."date_tbl" + Remote SQL: SELECT f1 FROM public.date_tbl (4 rows) --Testcase 29: diff --git a/expected/13.4/postgresql/delete.out b/expected/13.4/postgresql/delete.out index 0e9dc79..16820ba 100644 --- a/expected/13.4/postgresql/delete.out +++ b/expected/13.4/postgresql/delete.out @@ -27,13 +27,12 @@ EXPLAIN VERBOSE DELETE FROM delete_test AS dt WHERE dt.a > 75; QUERY PLAN --------------------------------------------------------------------------------- Delete on public.delete_test dt (cost=25.00..28.00 rows=3 width=4) - Remote SQL: DELETE FROM "public"."delete_test" WHERE "id" = ? + Remote SQL: DELETE FROM public.delete_test WHERE id = ? -> Foreign Scan on public.delete_test dt (cost=25.00..28.00 rows=3 width=4) Output: id - Filter: (dt.a > 75) Foreign Table Size: 3 b - Remote SQL: SELECT "id","a","b" FROM "public"."delete_test" -(7 rows) + Remote SQL: SELECT id FROM public.delete_test WHERE ((a > 75)) +(6 rows) --Testcase 6: DELETE FROM delete_test AS dt WHERE dt.a > 75; @@ -58,7 +57,7 @@ EXPLAIN VERBOSE SELECT id, a, char_length(b) FROM delete_test; Foreign Scan on public.delete_test (cost=25.00..27.00 rows=2 width=12) Output: id, a, char_length(b) Foreign Table Size: 2 b - Remote SQL: SELECT "id","a","b" FROM "public"."delete_test" + Remote SQL: SELECT id, a, b FROM public.delete_test (4 rows) --Testcase 10: @@ -75,13 +74,12 @@ EXPLAIN VERBOSE DELETE FROM delete_test WHERE a > 25; QUERY PLAN ------------------------------------------------------------------------------ Delete on public.delete_test (cost=25.00..27.00 rows=2 width=4) - Remote SQL: DELETE FROM "public"."delete_test" WHERE "id" = ? + Remote SQL: DELETE FROM public.delete_test WHERE id = ? -> Foreign Scan on public.delete_test (cost=25.00..27.00 rows=2 width=4) Output: id - Filter: (delete_test.a > 25) Foreign Table Size: 2 b - Remote SQL: SELECT "id","a","b" FROM "public"."delete_test" -(7 rows) + Remote SQL: SELECT id FROM public.delete_test WHERE ((a > 25)) +(6 rows) --Testcase 12: DELETE FROM delete_test WHERE a > 25; @@ -92,7 +90,7 @@ EXPLAIN VERBOSE SELECT id, a, char_length(b) FROM delete_test; Foreign Scan on public.delete_test (cost=25.00..26.00 rows=1 width=12) Output: id, a, char_length(b) Foreign Table Size: 1 b - Remote SQL: SELECT "id","a","b" FROM "public"."delete_test" + Remote SQL: SELECT id, a, b FROM public.delete_test (4 rows) --Testcase 14: diff --git a/expected/13.4/postgresql/float4.out b/expected/13.4/postgresql/float4.out index 0627c2f..6246647 100644 --- a/expected/13.4/postgresql/float4.out +++ b/expected/13.4/postgresql/float4.out @@ -245,7 +245,11 @@ SELECT (f1::float4) AS float4 FROM FLOAT4_TBL; NaN (1 row) --- +-- The comparison of floating-point values for equality is not safe +-- because of the rounding errors when converting between binary and decimal. +-- A floating-point value as written in an SQL statement may not be +-- the same as the value represented internally. +-- E.g: binary value of 1004.3 may be 1004.2999999999999 --Testcase 61: ALTER FOREIGN TABLE FLOAT4_TBL OPTIONS (SET table 'float4_tbl'); --Testcase 62: @@ -264,35 +268,37 @@ SELECT '' AS four, f1 FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3'; four | f1 ------+--------------- | 0 + | 1004.3 | -34.84 | 1.2345679e+20 | 1.2345679e-20 -(4 rows) +(5 rows) --Testcase 64: SELECT '' AS one, f1 FROM FLOAT4_TBL f WHERE f.f1 = '1004.3'; - one | f1 ------+-------- - | 1004.3 -(1 row) + one | f1 +-----+---- +(0 rows) --Testcase 65: SELECT '' AS three, f1 FROM FLOAT4_TBL f WHERE '1004.3' > f.f1; three | f1 -------+--------------- | 0 + | 1004.3 | -34.84 | 1.2345679e-20 -(3 rows) +(4 rows) --Testcase 66: SELECT '' AS three, f1 FROM FLOAT4_TBL f WHERE f.f1 < '1004.3'; three | f1 -------+--------------- | 0 + | 1004.3 | -34.84 | 1.2345679e-20 -(3 rows) +(4 rows) --Testcase 67: SELECT '' AS four, f.f1 FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1; @@ -357,7 +363,7 @@ SELECT '' AS three, f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f -- test divide by zero --Testcase 73: SELECT '' AS bad, f.f1 / '0.0' from FLOAT4_TBL f; -psql:sql/13.4/float4.sql:183: ERROR: division by zero +psql:sql/13.4/float4.sql:187: ERROR: division by zero --Testcase 74: SELECT '' AS five, f1 FROM FLOAT4_TBL; five | f1 @@ -418,7 +424,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('32767.6'::float4); --Testcase 84: SELECT f1::int2 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:216: ERROR: smallint out of range +psql:sql/13.4/float4.sql:220: ERROR: smallint out of range -- --Testcase 85: DELETE FROM FLOAT4_TBL; @@ -438,7 +444,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-32768.6'::float4); --Testcase 90: SELECT f1::int2 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:230: ERROR: smallint out of range +psql:sql/13.4/float4.sql:234: ERROR: smallint out of range -- --Testcase 91: DELETE FROM FLOAT4_TBL; @@ -458,7 +464,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('2147483647'::float4); --Testcase 96: SELECT f1::int4 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:244: ERROR: integer out of range +psql:sql/13.4/float4.sql:248: ERROR: integer out of range -- --Testcase 97: DELETE FROM FLOAT4_TBL; @@ -478,7 +484,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-2147483900'::float4); --Testcase 102: SELECT f1::int4 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:258: ERROR: integer out of range +psql:sql/13.4/float4.sql:262: ERROR: integer out of range -- --Testcase 103: DELETE FROM FLOAT4_TBL; @@ -498,7 +504,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('9223372036854775807'::float4); --Testcase 108: SELECT f1::int8 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:272: ERROR: bigint out of range +psql:sql/13.4/float4.sql:276: ERROR: bigint out of range -- --Testcase 109: DELETE FROM FLOAT4_TBL; @@ -518,7 +524,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-9223380000000000000'::float4); --Testcase 114: SELECT f1::int8 FROM FLOAT4_TBL; -psql:sql/13.4/float4.sql:286: ERROR: bigint out of range +psql:sql/13.4/float4.sql:290: ERROR: bigint out of range -- Test for correct input rounding in edge cases. -- These lists are from Paxson 1991, excluding subnormals and -- inputs of over 9 sig. digits. @@ -604,6 +610,6 @@ SELECT float4send(f1) FROM FLOAT4_TBL; DROP FOREIGN TABLE FLOAT4_TBL; --Testcase 137: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/13.4/float4.sql:351: NOTICE: drop cascades to user mapping for public on server postgres_server +psql:sql/13.4/float4.sql:355: NOTICE: drop cascades to user mapping for public on server postgres_server --Testcase 138: DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/expected/13.4/postgresql/float8.out b/expected/13.4/postgresql/float8.out index 083d69f..460c5c0 100644 --- a/expected/13.4/postgresql/float8.out +++ b/expected/13.4/postgresql/float8.out @@ -22,7 +22,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 '); QUERY PLAN ------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '0'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -35,7 +35,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 '); QUERY PLAN ------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1004.3'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -48,7 +48,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84'); QUERY PLAN ------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-34.84'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -61,7 +61,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200'); QUERY PLAN -------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1.2345678901234e+200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -74,7 +74,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200'); QUERY PLAN -------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1.2345678901234e-200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -178,7 +178,7 @@ SELECT '' AS five, f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 32: @@ -199,10 +199,9 @@ SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: (f.f1 <> '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 <> 1004.3)) +(4 rows) --Testcase 34: SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; @@ -221,10 +220,9 @@ SELECT '' AS one, f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: (f.f1 = '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 = 1004.3)) +(4 rows) --Testcase 36: SELECT '' AS one, f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; @@ -240,10 +238,9 @@ SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: ('1004.3'::double precision > f.f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((1004.3 > f1)) +(4 rows) --Testcase 38: SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; @@ -261,10 +258,9 @@ SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: (f.f1 < '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 < 1004.3)) +(4 rows) --Testcase 40: SELECT '' AS three, f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; @@ -282,10 +278,9 @@ SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: ('1004.3'::double precision >= f.f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((1004.3 >= f1)) +(4 rows) --Testcase 42: SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; @@ -304,10 +299,9 @@ SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3'; -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 - Filter: (f.f1 <= '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 <= 1004.3)) +(4 rows) --Testcase 44: SELECT '' AS four, f.f1 FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3'; @@ -328,10 +322,9 @@ SELECT '' AS three, f.f1, f.f1 * '-10' AS x -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (f1 * '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 46: SELECT '' AS three, f.f1, f.f1 * '-10' AS x @@ -353,10 +346,9 @@ SELECT '' AS three, f.f1, f.f1 + '-10' AS x -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (f1 + '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 48: SELECT '' AS three, f.f1, f.f1 + '-10' AS x @@ -378,10 +370,9 @@ SELECT '' AS three, f.f1, f.f1 / '-10' AS x -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (f1 / '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 50: SELECT '' AS three, f.f1, f.f1 / '-10' AS x @@ -403,10 +394,9 @@ SELECT '' AS three, f.f1, f.f1 - '-10' AS x -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (f1 - '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 52: SELECT '' AS three, f.f1, f.f1 - '-10' AS x @@ -427,10 +417,9 @@ SELECT '' AS one, f.f1 ^ '2.0' AS square_f1 -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, (f1 ^ '2'::double precision) - Filter: (f.f1 = '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 = 1004.3)) +(4 rows) --Testcase 54: SELECT '' AS one, f.f1 ^ '2.0' AS square_f1 @@ -450,7 +439,7 @@ SELECT '' AS five, f.f1, @f.f1 AS abs_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (@ f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 56: @@ -475,7 +464,7 @@ SELECT '' AS five, f.f1, trunc(f.f1) AS trunc_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, trunc(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 58: @@ -500,7 +489,7 @@ SELECT '' AS five, f.f1, round(f.f1) AS round_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, round(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 60: @@ -524,7 +513,7 @@ select ceil(f1) as ceil_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ceil(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 62: @@ -546,7 +535,7 @@ select ceiling(f1) as ceiling_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ceiling(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 64: @@ -569,7 +558,7 @@ select floor(f1) as floor_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: floor(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 66: @@ -592,7 +581,7 @@ select sign(f1) as sign_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: sign(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 68: @@ -651,10 +640,9 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (|/ f1) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 75: SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1 @@ -677,10 +665,9 @@ SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1 -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.02 rows=5 width=48) Output: ''::text, f1, exp(ln(f1)) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 77: SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1 @@ -701,7 +688,7 @@ SELECT '' AS five, f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=48) Output: ''::text, f1, (||/ f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 79: @@ -723,7 +710,7 @@ SELECT '' AS five, f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 81: @@ -745,13 +732,12 @@ UPDATE FLOAT8_TBL QUERY PLAN ------------------------------------------------------------------------------ Update on public.float8_tbl (cost=25.00..30.01 rows=5 width=16) - Remote SQL: UPDATE "public"."float8_tbl" SET "f1" = ? WHERE "id" = ? + Remote SQL: UPDATE public.float8_tbl SET f1 = ? WHERE id = ? -> Foreign Scan on public.float8_tbl (cost=25.00..30.01 rows=5 width=16) Output: (f1 * '-1'::double precision), id, id - Filter: (float8_tbl.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(7 rows) + Remote SQL: SELECT f1, id FROM public.float8_tbl WHERE ((f1 > 0)) +(6 rows) --Testcase 83: UPDATE FLOAT8_TBL @@ -765,7 +751,7 @@ SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, (f1 * '1e+200'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 85: @@ -779,7 +765,7 @@ SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, (f1 ^ '1e+200'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 87: @@ -797,10 +783,9 @@ SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, ln(f1) - Filter: (f.f1 = '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 = 0)) +(4 rows) --Testcase 91: SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; @@ -812,10 +797,9 @@ SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, ln(f1) - Filter: (f.f1 < '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 < 0)) +(4 rows) --Testcase 93: SELECT '' AS bad, ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; @@ -828,7 +812,7 @@ SELECT '' AS bad, exp(f.f1) from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, exp(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 95: @@ -842,7 +826,7 @@ SELECT '' AS bad, f.f1 / '0.0' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=40) Output: ''::text, (f1 / '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 97: @@ -856,7 +840,7 @@ SELECT '' AS five, f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=40) Output: ''::text, f1 Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 99: @@ -925,11 +909,11 @@ DELETE FROM FLOAT8_TBL; QUERY PLAN ----------------------------------------------------------------------------- Delete on public.float8_tbl (cost=25.00..30.00 rows=5 width=4) - Remote SQL: DELETE FROM "public"."float8_tbl" WHERE "id" = ? + Remote SQL: DELETE FROM public.float8_tbl WHERE id = ? -> Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=4) Output: id Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT id FROM public.float8_tbl (6 rows) --Testcase 110: @@ -940,7 +924,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0'); QUERY PLAN ------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '0'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -953,7 +937,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84'); QUERY PLAN ------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-34.84'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -966,7 +950,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30'); QUERY PLAN ------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1004.3'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -979,7 +963,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200'); QUERY PLAN --------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1.2345678901234e+200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -992,7 +976,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200'); QUERY PLAN --------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1.2345678901234e-200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1007,7 +991,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 122: diff --git a/expected/13.4/postgresql/function_pushdown.out b/expected/13.4/postgresql/function_pushdown.out new file mode 100644 index 0000000..30eab53 --- /dev/null +++ b/expected/13.4/postgresql/function_pushdown.out @@ -0,0 +1,1861 @@ +-- +-- postgreSql +-- +\set ECHO none +\i sql/13.4/function_pushdown.sql +-- +-- function push-down +-- +--Testcase 1: +CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; +--Testcase 2: +CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME + OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); +--Testcase 3: +CREATE USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); +--Testcase 4: +CREATE FOREIGN TABLE s1(id int, tag1 text, value1 float, value2 int, value3 float, value4 int, value5 numeric, str1 text, str2 text) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 's1'); +--Testcase 5: +CREATE FOREIGN TABLE tbl04 (id int OPTIONS (key 'true'), c1 float8, c2 bigint, c3 text, c4 boolean, c5 timestamp) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl04'); +--Testcase 6: +EXPLAIN VERBOSE +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=4) + Output: NULLIF(value2, 100) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 WHERE ((nullif(value2, 100) IS NULL)) +(4 rows) + +--Testcase 7: +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + nullif +-------- + + + +(3 rows) + +-- numeric function +--Testcase 8: +EXPLAIN VERBOSE +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: abs(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((abs(value1) > 1)) +(4 rows) + +--Testcase 9: +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + abs +----- + 1.1 + 2.2 + 3.3 +(3 rows) + +--Testcase 10: +EXPLAIN VERBOSE +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + QUERY PLAN +------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: acos(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((value1 < 1)) AND ((acos(value1) > 1)) +(4 rows) + +--Testcase 11: +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + acos +-------------------- + 1.4706289056333368 + 1.369438406004566 + 1.2661036727794992 +(3 rows) + +--Testcase 12: +EXPLAIN VERBOSE +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + QUERY PLAN +------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: asin(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((value1 < 1)) AND ((asin(value1) < 1)) +(4 rows) + +--Testcase 13: +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + asin +-------------------- + 0.1001674211615598 + 0.2013579207903308 + 0.3046926540153975 +(3 rows) + +--Testcase 14: +EXPLAIN VERBOSE +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + QUERY PLAN +----------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: atan((id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id FROM public.s1 WHERE ((atan(id) > 0.2)) +(4 rows) + +--Testcase 15: +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + atan +-------------------- + 0.7853981633974483 + 1.1071487177940904 + 1.2490457723982544 + 1.3258176636680326 + 1.373400766945016 +(5 rows) + +--Testcase 16: +EXPLAIN VERBOSE +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: atan2('3.141592653589793'::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id FROM public.s1 WHERE ((atan2(3.141592653589793, id) > 0.2)) +(4 rows) + +--Testcase 17: +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + atan2 +-------------------- + 1.5707963267948966 + 1.2626272556789118 + 1.0038848218538872 + 0.808448792630022 + 0.6657737500283538 + 0.5609821161086238 +(6 rows) + +--Testcase 18: +EXPLAIN VERBOSE +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ceil(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((ceil(value1) > 0)) +(4 rows) + +--Testcase 19: +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + ceil +------ + 1 + 1 + 1 + 2 + 3 + 4 +(6 rows) + +--Testcase 20: +EXPLAIN VERBOSE +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ceiling(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((ceiling(value1) > 0)) +(4 rows) + +--Testcase 21: +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + ceiling +--------- + 1 + 1 + 1 + 2 + 3 + 4 +(6 rows) + +--Testcase 22: +EXPLAIN VERBOSE +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: cos(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((cos(value1) > 0)) +(4 rows) + +--Testcase 23: +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + cos +-------------------- + 0.9950041652780258 + 0.9800665778412416 + 0.955336489125606 + 0.4535961214255773 +(4 rows) + +--Testcase 24: +EXPLAIN VERBOSE +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: cot(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((cot(value1) > 0)) +(4 rows) + +--Testcase 25: +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + cot +-------------------- + 9.966644423259238 + 4.933154875586893 + 3.2327281437658275 + 0.5089681052390643 + 6.259947539437359 +(5 rows) + +--Testcase 26: +EXPLAIN VERBOSE +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: degrees(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((degrees(value1) > 0)) +(4 rows) + +--Testcase 27: +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + degrees +-------------------- + 5.729577951308232 + 11.459155902616464 + 17.188733853924695 + 63.02535746439056 + 126.05071492878112 + 189.07607239317164 +(6 rows) + +--Testcase 28: +EXPLAIN VERBOSE +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: exp(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((exp(value1) > 0)) +(4 rows) + +--Testcase 29: +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + exp +-------------------- + 1.1051709180756477 + 1.2214027581601699 + 1.3498588075760032 + 3.0041660239464334 + 9.025013499434122 + 27.112638920657883 +(6 rows) + +--Testcase 30: +EXPLAIN VERBOSE +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: floor(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((floor(value1) > 0)) +(4 rows) + +--Testcase 31: +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + floor +------- + 1 + 2 + 3 +(3 rows) + +--Testcase 32: +EXPLAIN VERBOSE +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ln(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((ln(value1) > 0)) +(4 rows) + +--Testcase 33: +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + ln +--------------------- + 0.09531017980432493 + 0.7884573603642703 + 1.1939224684724346 +(3 rows) + +--Testcase 34: +EXPLAIN VERBOSE +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=64) + Output: value5, log('2'::numeric, value5) + Foreign Table Size: 6 b + Remote SQL: SELECT value5 FROM public.s1 WHERE ((log(2, value5) > 0)) +(4 rows) + +--Testcase 35: +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + value5 | log +--------+--------------------- + 1.1 | 0.13750352374993491 + 1.2 | 0.2630344058337938 + 1.3 | 0.3785116232537298 +(3 rows) + +--Testcase 37: +EXPLAIN VERBOSE +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: log(value1) + Filter: (log(s1.value1) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 38: +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + log +--------------------- + 0.04139268515822507 + 0.3424226808222063 + 0.5185139398778874 +(3 rows) + +--Testcase 39: +EXPLAIN VERBOSE +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: log10(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((log10(value1) > 0)) +(4 rows) + +--Testcase 40: +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + log10 +--------------------- + 0.04139268515822507 + 0.3424226808222063 + 0.5185139398778874 +(3 rows) + +--Testcase 41: +EXPLAIN VERBOSE +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=4) + Output: mod(value2, (id + 1)) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM public.s1 WHERE ((mod(value2, (id + 1)) > 0)) +(4 rows) + +--Testcase 42: +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + mod +----- + 1 + 2 +(2 rows) + +--Testcase 43: +EXPLAIN VERBOSE +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: pow((value2)::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM public.s1 WHERE ((pow(value2, id) > 0)) +(4 rows) + +--Testcase 44: +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + pow +-------------- + 1 + 100 + 10000 + 8000000 + 1600000000 + 320000000000 +(6 rows) + +--Testcase 45: +EXPLAIN VERBOSE +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: power((value2)::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM public.s1 WHERE ((power(value2, id) > 0)) +(4 rows) + +--Testcase 46: +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + power +-------------- + 1 + 100 + 10000 + 8000000 + 1600000000 + 320000000000 +(6 rows) + +--Testcase 47: +EXPLAIN VERBOSE +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: radians(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((radians(value1) > 0)) +(4 rows) + +--Testcase 48: +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + radians +----------------------- + 0.0017453292519943296 + 0.003490658503988659 + 0.005235987755982988 + 0.019198621771937627 + 0.038397243543875255 + 0.05759586531581287 +(6 rows) + +--Testcase 49: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: round(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((round(value1) > 0)) +(4 rows) + +--Testcase 50: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + round +------- + 1 + 2 + 3 +(3 rows) + +--Testcase 51: +EXPLAIN VERBOSE +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=16) + Output: sign(value3), value3 + Foreign Table Size: 6 b + Remote SQL: SELECT value3 FROM public.s1 WHERE ((sign(value3) = (-1))) +(4 rows) + +--Testcase 52: +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + sign | value3 +------+-------- + -1 | -0.1 + -1 | -0.2 + -1 | -0.3 + -1 | -1.1 + -1 | -2.2 + -1 | -3.3 +(6 rows) + +--Testcase 53: +EXPLAIN VERBOSE +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: sin(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((sin(value1) > 0)) +(4 rows) + +--Testcase 54: +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + sin +--------------------- + 0.09983341664682815 + 0.19866933079506122 + 0.29552020666133955 + 0.8912073600614354 + 0.8084964038195901 +(5 rows) + +--Testcase 55: +EXPLAIN VERBOSE +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: sqrt(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((sqrt(value1) > 0)) +(4 rows) + +--Testcase 56: +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + sqrt +--------------------- + 0.31622776601683794 + 0.4472135954999579 + 0.5477225575051661 + 1.0488088481701516 + 1.4832396974191326 + 1.816590212458495 +(6 rows) + +--Testcase 57: +EXPLAIN VERBOSE +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: tan(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((tan(value1) > 0)) +(4 rows) + +--Testcase 58: +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + tan +--------------------- + 0.10033467208545055 + 0.2027100355086725 + 0.30933624960962325 + 1.9647596572486523 + 0.15974574766003222 +(5 rows) + +--Testcase 59: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: round(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((round(value1) > 0)) +(4 rows) + +--Testcase 60: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + round +------- + 1 + 2 + 3 +(3 rows) + +-- date/time function: +--Testcase 61: +EXPLAIN VERBOSE +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: date(c5) + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM public.tbl04 WHERE ((date(c5) > '1970-01-01')) +(4 rows) + +--Testcase 62: +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + date +------------ + 01-01-2000 + 01-01-2000 + 01-01-2000 + 11-01-1990 + 11-01-2010 + 10-01-1999 + 10-01-2010 + 10-01-1999 + 10-01-2010 +(9 rows) + +-- string function: +--Testcase 63: +EXPLAIN VERBOSE +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: ascii(str1), ascii(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((ascii(str1) > 0)) +(4 rows) + +--Testcase 64: +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + ascii | ascii +-------+------- + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 +(6 rows) + +--Testcase 65: +-- for bit_length() function, postgre's core will optimize it to octet_length() * 8 and push it down +EXPLAIN VERBOSE +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=8) + Output: (octet_length(str1) * 8), (octet_length(str2) * 8) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE (((octet_length(str1) * 8) > 0)) +(4 rows) + +--Testcase 66: +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + bit_length | bit_length +------------+------------ + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 +(6 rows) + +--Testcase 67: +EXPLAIN VERBOSE +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2) + Filter: (btrim(s1.str2) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 68: +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 69: +EXPLAIN VERBOSE +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2, ' '::text) + Filter: (btrim(s1.str2, ' '::text) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 70: +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 71: +EXPLAIN VERBOSE +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: char_length(str1), char_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((char_length(str1) > 0)) +(4 rows) + +--Testcase 72: +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + char_length | char_length +-------------+------------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 73: +EXPLAIN VERBOSE +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: character_length(str1), character_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((character_length(str1) > 0)) +(4 rows) + +--Testcase 74: +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + character_length | character_length +------------------+------------------ + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 75: +EXPLAIN VERBOSE +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + QUERY PLAN +------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: concat(str1, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((concat(str1, str2) LIKE '---XYZ--- XYZ ')) +(4 rows) + +--Testcase 76: +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + concat +-------------------- + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ +(6 rows) + +--Testcase 77: +EXPLAIN VERBOSE +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: concat_ws(','::text, str1, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ ')) +(4 rows) + +--Testcase 78: +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + concat_ws +--------------------- + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ +(6 rows) + +--Testcase 79: +EXPLAIN VERBOSE +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "left"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((left(str1, 3) LIKE '---')) +(4 rows) + +--Testcase 80: +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + left +------ + --- + --- + --- + --- + --- + --- +(6 rows) + +--Testcase 81: +EXPLAIN VERBOSE +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: length(str1), length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((length(str1) > 0)) +(4 rows) + +--Testcase 82: +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + length | length +--------+-------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 83: +EXPLAIN VERBOSE +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: lower(str1), lower(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((lower(str1) LIKE '%xyz%')) +(4 rows) + +--Testcase 84: +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + lower | lower +-----------+----------- + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz +(6 rows) + +--Testcase 85: +EXPLAIN VERBOSE +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: lpad(str1, 20, 'ABCD'::text), lpad(str2, 20, 'ABCD'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((lpad(str1, 20, 'ABCD') LIKE '%XYZ%')) +(4 rows) + +--Testcase 86: +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + lpad | lpad +----------------------+---------------------- + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ +(6 rows) + +--Testcase 87: +EXPLAIN VERBOSE +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str2) + Filter: (ltrim(s1.str2) ~~ 'XYZ '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 88: +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + ltrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 89: +EXPLAIN VERBOSE +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str2, ' '::text) + Filter: (ltrim(s1.str2, ' '::text) ~~ 'XYZ '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 90: +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + ltrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 91: +EXPLAIN VERBOSE +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: octet_length(str1), octet_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((octet_length(str1) > 0)) +(4 rows) + +--Testcase 92: +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + octet_length | octet_length +--------------+-------------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 93: +EXPLAIN VERBOSE +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=4) + Output: "position"(str1, 'X'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((position('X' IN str1) > 0)) +(4 rows) + +--Testcase 94: +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + position +---------- + 4 + 4 + 4 + 4 + 4 + 4 +(6 rows) + +--Testcase 95: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: regexp_replace(str1, 'X..'::text, 'xyz'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%')) +(4 rows) + +--Testcase 96: +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + regexp_replace +---------------- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- +(6 rows) + +--Testcase 97: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: regexp_replace(str1, '[Y]'::text, 'y'::text, 'i'::text) + Filter: (regexp_replace(s1.str1, '[Y]'::text, 'y'::text, 'i'::text) ~~ '%XyZ%'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 98: +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + regexp_replace +---------------- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- +(6 rows) + +--Testcase 99: +EXPLAIN VERBOSE +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: repeat(str1, 3), repeat(str2, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((repeat(str2, 3) LIKE '%X%')) +(4 rows) + +--Testcase 100: +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + repeat | repeat +-----------------------------+----------------------------- + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ +(6 rows) + +--Testcase 101: +EXPLAIN VERBOSE +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + QUERY PLAN +------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: replace(str1, 'XYZ'::text, 'ABC'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((replace(str1, 'XYZ', 'ABC') LIKE '%A%')) +(4 rows) + +--Testcase 102: +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + replace +----------- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- +(6 rows) + +--Testcase 103: +EXPLAIN VERBOSE +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: reverse(str1), reverse(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((reverse(str1) LIKE '%ZYX%')) +(4 rows) + +--Testcase 104: +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + reverse | reverse +-----------+----------- + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX +(6 rows) + +--Testcase 105: +EXPLAIN VERBOSE +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: "right"(str1, 4), "right"(str2, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((right(str1, 4) LIKE 'Z%')) +(4 rows) + +--Testcase 106: +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + right | right +-------+------- + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z +(6 rows) + +--Testcase 107: +EXPLAIN VERBOSE +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: rpad(str1, 16, str2), rpad(str1, 4, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((rpad(str1, 16, str2) LIKE '---XYZ---%')) +(4 rows) + +--Testcase 108: +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + rpad | rpad +------------------+------ + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X +(6 rows) + +--Testcase 109: +EXPLAIN VERBOSE +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str2) + Filter: (rtrim(s1.str2) ~~ '%XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 110: +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + rtrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 111: +EXPLAIN VERBOSE +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str2, ' '::text) + Filter: (rtrim(s1.str2, ' '::text) ~~ '%XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 112: +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + rtrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 113: +EXPLAIN VERBOSE +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: substr(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((substr(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 114: +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + substr +--------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 115: +EXPLAIN VERBOSE +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: substr(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 WHERE ((substr(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 116: +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + substr +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 117: +EXPLAIN VERBOSE +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((substring(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 118: +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + substring +----------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 119: +EXPLAIN VERBOSE +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 WHERE ((substring(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 120: +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + substring +----------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 121: +EXPLAIN VERBOSE +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((substring(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 122: +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + substring +----------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 123: +EXPLAIN VERBOSE +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 WHERE ((substring(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 124: +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + substring +----------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 125: +EXPLAIN VERBOSE +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2) + Filter: (btrim(s1.str2) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 126: +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 127: +EXPLAIN VERBOSE +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str1, '-'::text) + Filter: (btrim(s1.str1, '-'::text) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 128: +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 129: +EXPLAIN VERBOSE +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str1, '-'::text) + Filter: (ltrim(s1.str1, '-'::text) ~~ 'XYZ---'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 130: +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + ltrim +-------- + XYZ--- + XYZ--- + XYZ--- + XYZ--- + XYZ--- + XYZ--- +(6 rows) + +--Testcase 131: +EXPLAIN VERBOSE +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str1, '-'::text) + Filter: (btrim(s1.str1, '-'::text) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 132: +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 133: +EXPLAIN VERBOSE +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str1, '-'::text) + Filter: (rtrim(s1.str1, '-'::text) ~~ '---XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 134: +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + rtrim +-------- + ---XYZ + ---XYZ + ---XYZ + ---XYZ + ---XYZ + ---XYZ +(6 rows) + +--Testcase 135: +EXPLAIN VERBOSE +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: upper(tag1) + Foreign Table Size: 6 b + Remote SQL: SELECT tag1 FROM public.s1 WHERE ((upper(tag1) LIKE 'A')) +(4 rows) + +--Testcase 136: +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + upper +------- + A + A + A +(3 rows) + +-- explicit cast function: +--Testcase 137: +EXPLAIN VERBOSE +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=40) + Output: cos(((value1)::numeric)::double precision), (value1)::numeric + Filter: (cos(((s1.value1)::numeric)::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 138: +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 139: +EXPLAIN VERBOSE +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.09 rows=6 width=24) + Output: cos(((value1)::numeric(10,0))::double precision), (value1)::numeric(10,0) + Filter: (cos(((s1.value1)::numeric(10,0))::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 140: +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 1 | 0 + 1 | 0 + 1 | 0 + 0.5403023058681398 | 1 +(4 rows) + +--Testcase 141: +EXPLAIN VERBOSE +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=40) + Output: cos(((value1)::numeric)::double precision), (value1)::numeric + Filter: (cos(((s1.value1)::numeric)::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 142: +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 143: +EXPLAIN VERBOSE +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.09 rows=6 width=24) + Output: cos(((value1)::numeric(10,1))::double precision), (value1)::numeric(10,1) + Filter: (cos(((s1.value1)::numeric(10,1))::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 144: +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 145: +EXPLAIN VERBOSE +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: (value2)::character(1) + Filter: ((s1.value2)::character(1) ~~ '1'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 146: +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + value2 +-------- + 1 + 1 + 1 +(3 rows) + +--Testcase 147: +EXPLAIN VERBOSE +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=32) + Output: (value2)::character varying + Filter: (((s1.value2)::character varying)::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 148: +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 149: +EXPLAIN VERBOSE +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=28) + Output: (value2)::character(6) + Filter: ((s1.value2)::character(6) ~~ '100 '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 150: +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 151: +EXPLAIN VERBOSE +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=28) + Output: (value2)::character varying(6) + Filter: (((s1.value2)::character varying(6))::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 152: +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 153: +EXPLAIN VERBOSE +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=32) + Output: (value2)::text + Filter: ((s1.value2)::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 154: +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 155: +EXPLAIN VERBOSE +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=2) + Output: (value2)::smallint + Filter: ((s1.value2)::smallint > 20) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 156: +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + value2 +-------- + 100 + 100 + 100 + 200 + 200 + 200 +(6 rows) + +--Testcase 157: +EXPLAIN VERBOSE +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + QUERY PLAN +------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c1)::integer + Filter: ((tbl04.c1)::integer > 20) + Foreign Table Size: 9 b + Remote SQL: SELECT c1 FROM public.tbl04 +(5 rows) + +--Testcase 158: +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + c1 +------- + 31 + 2566 + 55 + 45021 + 122 + 75 + 6867 +(7 rows) + +--Testcase 159: +EXPLAIN VERBOSE +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=8) + Output: (c2)::double precision + Filter: ((tbl04.c2)::double precision > '20'::double precision) + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM public.tbl04 +(5 rows) + +--Testcase 160: +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + c2 +--------- + 128912 + 6565 + 1829812 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 161: +EXPLAIN VERBOSE +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c2)::real + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM public.tbl04 WHERE ((CAST(c2 AS real) > 20)) +(4 rows) + +--Testcase 162: +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + c2 +-------------- + 128912 + 6565 + 1.829812e+06 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 163: +EXPLAIN VERBOSE +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c2)::real + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM public.tbl04 WHERE ((CAST(c2 AS real) > 20)) +(4 rows) + +--Testcase 164: +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + c2 +-------------- + 128912 + 6565 + 1.829812e+06 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 165: +EXPLAIN VERBOSE +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c5)::date + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM public.tbl04 WHERE ((CAST(c5 AS date) > '2001-01-01')) +(4 rows) + +--Testcase 166: +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + c5 +------------ + 11-01-2010 + 10-01-2010 + 10-01-2010 +(3 rows) + +--Testcase 167: +EXPLAIN VERBOSE +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=8) + Output: (c5)::time without time zone + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM public.tbl04 WHERE ((CAST(c5 AS time) > '00:00:00')) +(4 rows) + +--Testcase 168: +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + c5 +---------- + 10:10:00 + 10:10:00 +(2 rows) + +--Testcase 169: +DROP FOREIGN TABLE s1; +--Testcase 170: +DROP FOREIGN TABLE tbl04; +--Testcase 171: +DROP USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME; +--Testcase 172: +DROP SERVER :DB_SERVERNAME CASCADE; +--Testcase 173: +DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/expected/13.4/postgresql/insert.out b/expected/13.4/postgresql/insert.out index aa851a3..bbf525b 100644 --- a/expected/13.4/postgresql/insert.out +++ b/expected/13.4/postgresql/insert.out @@ -23,7 +23,7 @@ insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT); QUERY PLAN ------------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, NULL::integer, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -37,10 +37,10 @@ Error while executing the query --Testcase 7: EXPLAIN VERBOSE insert into inserttest (col2, col3) values (3, DEFAULT); - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 3, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -50,10 +50,10 @@ insert into inserttest (col2, col3) values (3, DEFAULT); --Testcase 9: EXPLAIN VERBOSE insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT); - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 5, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -63,10 +63,10 @@ insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT); --Testcase 11: EXPLAIN VERBOSE insert into inserttest values (DEFAULT, 5, 'test'); - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 5, 'test'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -76,10 +76,10 @@ insert into inserttest values (DEFAULT, 5, 'test'); --Testcase 13: EXPLAIN VERBOSE insert into inserttest values (DEFAULT, 7); - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 7, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -89,12 +89,12 @@ insert into inserttest values (DEFAULT, 7); --Testcase 15: EXPLAIN VERBOSE select col1, col2, col3 from inserttest; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..29.00 rows=4 width=40) Output: col1, col2, col3 Foreign Table Size: 4 b - Remote SQL: SELECT "col1","col2","col3","id" FROM "public"."inserttest" + Remote SQL: SELECT col1, col2, col3 FROM public.inserttest (4 rows) select col1, col2, col3 from inserttest; @@ -156,12 +156,12 @@ LINE 1: insert into inserttest (col1) values (DEFAULT, DEFAULT); --Testcase 24: EXPLAIN VERBOSE select col1, col2, col3 from inserttest; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..29.00 rows=4 width=40) Output: col1, col2, col3 Foreign Table Size: 4 b - Remote SQL: SELECT "col1","col2","col3","id" FROM "public"."inserttest" + Remote SQL: SELECT col1, col2, col3 FROM public.inserttest (4 rows) --Testcase 25: @@ -184,7 +184,7 @@ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT), QUERY PLAN -------------------------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.02..0.07 rows=3 width=44) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) InitPlan 1 (returns $0) -> Result (cost=0.00..0.01 rows=1 width=4) Output: 2 @@ -201,12 +201,12 @@ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT), --Testcase 28: EXPLAIN VERBOSE select col1, col2, col3 from inserttest; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..32.00 rows=7 width=40) Output: col1, col2, col3 Foreign Table Size: 7 b - Remote SQL: SELECT "col1","col2","col3","id" FROM "public"."inserttest" + Remote SQL: SELECT col1, col2, col3 FROM public.inserttest (4 rows) --Testcase 29: @@ -231,7 +231,7 @@ insert into inserttest values(30, 50, repeat('x', 10000)); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Insert on public.inserttest (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 30, 50, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -241,12 +241,12 @@ insert into inserttest values(30, 50, repeat('x', 10000)); --Testcase 32: EXPLAIN VERBOSE select col1, col2, char_length(col3) from inserttest; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..33.02 rows=8 width=12) Output: col1, col2, char_length(col3) Foreign Table Size: 8 b - Remote SQL: SELECT "col1","col2","col3","id" FROM "public"."inserttest" + Remote SQL: SELECT col1, col2, col3 FROM public.inserttest (4 rows) --Testcase 33: diff --git a/expected/13.4/postgresql/new_test.out b/expected/13.4/postgresql/new_test.out index 76e14a6..0fa585b 100644 --- a/expected/13.4/postgresql/new_test.out +++ b/expected/13.4/postgresql/new_test.out @@ -13,18 +13,18 @@ CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); --Testcase 3: -CREATE USER MAPPING FOR public SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); +CREATE USER MAPPING FOR public SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); --Primary key options --Testcase 4: -CREATE FOREIGN TABLE tbl01 (id bigint OPTIONS (key 'true'), c1 int) +CREATE FOREIGN TABLE tbl01 (id bigint OPTIONS (key 'true'), c1 int) SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl01'); --Testcase 5: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (166565, 1); - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Insert on public.tbl01 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."tbl01"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '166565'::bigint, 1 (4 rows) @@ -34,10 +34,10 @@ INSERT INTO tbl01 VALUES (166565, 1); --Testcase 7: EXPLAIN VERBOSE INSERT INTO tbl01 (c1) VALUES (3); - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Insert on public.tbl01 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."tbl01"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: NULL::bigint, 3 (4 rows) @@ -51,10 +51,10 @@ Error while executing the query --Testcase 9: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (null, 4); - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Insert on public.tbl01 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."tbl01"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: NULL::bigint, 4 (4 rows) @@ -68,10 +68,10 @@ Error while executing the query --Testcase 11: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (166565, 7); - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Insert on public.tbl01 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."tbl01"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '166565'::bigint, 7 (4 rows) @@ -91,7 +91,7 @@ INSERT INTO tbl02 VALUES (repeat('a', 255), 1, 12112.12, true); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Insert on public.tbl02 (cost=0.00..0.01 rows=1 width=1037) - Remote SQL: INSERT INTO "public"."tbl02"("id", "c1", "c2", "c3") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=1037) Output: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::character(255), 1, '12112.12'::double precision, true (4 rows) @@ -101,10 +101,10 @@ INSERT INTO tbl02 VALUES (repeat('a', 255), 1, 12112.12, true); --Testcase 16: EXPLAIN VERBOSE INSERT INTO tbl02 VALUES (NULL, 2, -12.23, false); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.tbl02 (cost=0.00..0.01 rows=1 width=1037) - Remote SQL: INSERT INTO "public"."tbl02"("id", "c1", "c2", "c3") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=1037) Output: NULL::character(255), 2, '-12.23'::double precision, false (4 rows) @@ -118,10 +118,10 @@ Error while executing the query --Testcase 18: EXPLAIN VERBOSE INSERT INTO tbl02(c1) VALUES (3); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.tbl02 (cost=0.00..0.01 rows=1 width=45) - Remote SQL: INSERT INTO "public"."tbl02"("id", "c1", "c2", "c3") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=45) Output: NULL::bpchar, 3, NULL::double precision, NULL::boolean (4 rows) @@ -137,6 +137,7 @@ Error while executing the query ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp01'); --Testcase 20: ALTER FOREIGN TABLE tbl02 ALTER COLUMN c2 SET NOT NULL; +--Testcase 77: \dS+ tbl02 Foreign table "public.tbl02" Column | Type | Collation | Nullable | Default | FDW options | Storage | Stats target | Description @@ -150,7 +151,7 @@ FDW options: (schema 'public', "table" 'tbl02_tmp01') --Testcase 21: INSERT INTO tbl02(id, c2) VALUES ('b', NULL); -- fail -psql:sql/13.4/new_test.sql:62: ERROR: Executing ODBC query +psql:sql/13.4/new_test.sql:63: ERROR: Executing ODBC query ERROR: null value in column "c2" of relation "tbl02_tmp01" violates not-null constraint DETAIL: Failing row contains (b ..., null, null, null).; Error while executing the query @@ -165,6 +166,7 @@ SELECT * FROM tbl02; -- no result ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp02'); --Testcase 23: ALTER FOREIGN TABLE tbl02 ALTER c1 OPTIONS (key 'true'); -- now, id and c1 are key +--Testcase 78: \dS+ tbl02 Foreign table "public.tbl02" Column | Type | Collation | Nullable | Default | FDW options | Storage | Stats target | Description @@ -178,8 +180,9 @@ FDW options: (schema 'public', "table" 'tbl02_tmp02') --Testcase 73 INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- ok +--Testcase 79: INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- fail -psql:sql/13.4/new_test.sql:75: ERROR: Executing ODBC query +psql:sql/13.4/new_test.sql:78: ERROR: Executing ODBC query ERROR: duplicate key value violates unique constraint "tbl02_tmp02_pkey" DETAIL: Key (id, c1)=(a , 12112) already exists.; @@ -189,12 +192,12 @@ INSERT INTO tbl02(id, c1) VALUES ('a', 13113.13); -- ok --Testcase 24: EXPLAIN VERBOSE SELECT * FROM tbl02; - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------- Foreign Scan on public.tbl02 (cost=25.00..27.00 rows=2 width=1037) Output: id, c1, c2, c3 Foreign Table Size: 2 b - Remote SQL: SELECT "id","c1","c2","c3" FROM "public"."tbl02_tmp02" + Remote SQL: SELECT id, c1, c2, c3 FROM public.tbl02_tmp02 (4 rows) --Testcase 25: @@ -214,7 +217,7 @@ INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 0); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.tbl03 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."tbl03"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl03(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'Sat Jan 01 00:00:00 2000'::timestamp without time zone, 0 (4 rows) @@ -227,14 +230,14 @@ INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 1); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.tbl03 (cost=0.00..0.01 rows=1 width=12) - Remote SQL: INSERT INTO "public"."tbl03"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl03(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'Sat Jan 01 00:00:00 2000'::timestamp without time zone, 1 (4 rows) --Testcase 36: INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 1); --fail -psql:sql/13.4/new_test.sql:96: ERROR: Executing ODBC query +psql:sql/13.4/new_test.sql:98: ERROR: Executing ODBC query ERROR: duplicate key value violates unique constraint "tbl03_pkey" DETAIL: Key (id)=(2000-01-01 00:00:00) already exists.; Error while executing the query @@ -245,14 +248,13 @@ CREATE FOREIGN TABLE tbl04 (id INT OPTIONS (key 'true'), c1 float8, c2 bigint, --Testcase 38: EXPLAIN VERBOSE SELECT * FROM tbl04 WHERE abs(c1) > 3233; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) Output: id, c1, c2, c3, c4, c5 - Filter: (abs(tbl04.c1) > '3233'::double precision) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((abs(c1) > 3233)) +(4 rows) --Testcase 39: SELECT * FROM tbl04 WHERE abs(c1) > 3233; @@ -265,14 +267,13 @@ SELECT * FROM tbl04 WHERE abs(c1) > 3233; --Testcase 40: EXPLAIN VERBOSE SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=20) Output: id, c1, c2 - Filter: ((tbl04.c1 >= '0'::double precision) AND (tbl04.c2 > 0) AND (sqrt((tbl04.c2)::double precision) > sqrt(tbl04.c1))) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c1 >= 0)) AND ((c2 > 0)) AND ((sqrt(c2) > sqrt(c1))) +(4 rows) --Testcase 41: SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; @@ -289,14 +290,13 @@ SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; --Testcase 42: EXPLAIN VERBOSE SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: c1, c2 - Filter: ((tbl04.c3 || tbl04.c3) <> 'things thing'::text) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT c1, c2 FROM public.tbl04 WHERE (((c3 || c3) <> 'things thing')) +(4 rows) --Testcase 43: SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; @@ -316,14 +316,13 @@ SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; --Testcase 44: EXPLAIN VERBOSE SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=44) Output: c1, id, (c3 || c3) - Filter: ((abs(tbl04.c2))::double precision <> abs(tbl04.c1)) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT id, c1, c3 FROM public.tbl04 WHERE ((abs(c2) <> abs(c1))) +(4 rows) --Testcase 45: SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); @@ -343,14 +342,13 @@ SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); --Testcase 46: EXPLAIN VERBOSE SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.05 rows=9 width=44) Output: (id + id), c2, (c3 || 'afas'::text) - Filter: (floor((tbl04.c2)::double precision) > '0'::double precision) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT id, c2, c3 FROM public.tbl04 WHERE ((floor(c2) > 0)) +(4 rows) --Testcase 47: SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; @@ -370,14 +368,13 @@ SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; --Testcase 48: EXPLAIN VERBOSE SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=49) Output: c2, c3, c4, c5 - Filter: (tbl04.c5 > 'Sat Jan 01 00:00:00 2000'::timestamp without time zone) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT c2, c3, c4, c5 FROM public.tbl04 WHERE ((c5 > '2000-01-01 00:00:00')) +(4 rows) --Testcase 49: SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; @@ -391,14 +388,13 @@ SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; --Testcase 50: EXPLAIN VERBOSE SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=17) Output: c5, c4, c2 - Filter: (tbl04.c5 = ANY ('{"Sat Jan 01 00:00:00 2000","Mon Nov 01 00:00:00 2010"}'::timestamp without time zone[])) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT c2, c4, c5 FROM public.tbl04 WHERE (c5 IN ('2000-01-01 00:00:00', '2010-11-01 00:00:00')) +(4 rows) --Testcase 51: SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); @@ -410,6 +406,264 @@ SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); Mon Nov 01 00:00:00 2010 | f | 22342 (4 rows) +--Testcase 245: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id IN (1, 2, 3)) +(4 rows) + +--Testcase 246: +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(3 rows) + +--Testcase 247: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + QUERY PLAN +------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id NOT IN (1, 2, 3)) +(4 rows) + +--Testcase 248: +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(6 rows) + +--Testcase 249: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); + QUERY PLAN +--------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id IN (1, 3) OR (id = c2))) +(4 rows) + +--Testcase 250: +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(2 rows) + +--Testcase 251: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + QUERY PLAN +--------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id NOT IN (1, 3)) AND ((id <> c2)) +(4 rows) + +--Testcase 252: +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(7 rows) + +--Testcase 253: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id NOT IN (c2, 2, 3)) +(4 rows) + +--Testcase 254: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+--------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(7 rows) + +--Testcase 255: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id = c2) AND (id = 2) AND (id = 3)) +(4 rows) + +--Testcase 256: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----+----+----+----+---- +(0 rows) + +--Testcase 257: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id <> c2) OR (id <> 2) OR (id <> 3)) +(4 rows) + +--Testcase 258: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(9 rows) + +--Testcase 259: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); + QUERY PLAN +---------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id IN (c2, 2, 3)) +(4 rows) + +--Testcase 260: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+---------+----+-------------------------- + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(2 rows) + +--Testcase 261: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); + QUERY PLAN +------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id NOT IN (1, 2, 3)) +(4 rows) + +--Testcase 262: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(6 rows) + +--Testcase 263: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id = 1) AND (id = 2) AND (id = 3)) +(4 rows) + +--Testcase 264: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----+----+----+----+---- +(0 rows) + +--Testcase 265: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id <> 1) OR (id <> 2) OR (id <> 3)) +(4 rows) + +--Testcase 266: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(9 rows) + +--Testcase 267: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id IN (1, 2, 3)) +(4 rows) + +--Testcase 268: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(3 rows) + --Testcase 52: EXPLAIN VERBOSE SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); @@ -419,16 +673,15 @@ SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true Output: tbl04.c3, tbl04.c5, tbl04.c1 Filter: (SubPlan 1) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c3, c5 FROM public.tbl04 SubPlan 1 -> Materialize (cost=25.00..34.05 rows=9 width=4) Output: tbl04_1.id -> Foreign Scan on public.tbl04 tbl04_1 (cost=25.00..34.00 rows=9 width=4) Output: tbl04_1.id - Filter: tbl04_1.c4 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(13 rows) + Remote SQL: SELECT id FROM public.tbl04 WHERE (c4) +(12 rows) --Testcase 53: SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); @@ -452,14 +705,13 @@ SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 ! Output: tbl04.c1, tbl04.c5, tbl04.c3, tbl04.c2 Filter: (((hashed SubPlan 1) AND (tbl04.c1 > '0'::double precision)) OR (tbl04.c2 < 0)) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2, c3, c5 FROM public.tbl04 SubPlan 1 -> Foreign Scan on public.tbl04 tbl04_1 (cost=25.00..34.00 rows=9 width=8) Output: tbl04_1.c1 - Filter: tbl04_1.c4 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(11 rows) + Remote SQL: SELECT c1 FROM public.tbl04 WHERE (c4) +(10 rows) --Testcase 55: SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 != false) AND c1 > 0 OR c2 < 0; @@ -472,14 +724,14 @@ SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 ! --Testcase 56: EXPLAIN VERBOSE SELECT variance(c1), variance(c2) FROM tbl04; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.05..34.06 rows=1 width=40) Output: variance(c1), variance(c2) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2 FROM public.tbl04 (6 rows) --Testcase 57: @@ -492,16 +744,15 @@ SELECT variance(c1), variance(c2) FROM tbl04; --Testcase 58: EXPLAIN VERBOSE SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Aggregate (cost=34.02..34.03 rows=1 width=8) Output: variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=8) Output: id, c1, c2, c3, c4, c5 - Filter: (tbl04.c3 <> 'aef'::text) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(7 rows) + Remote SQL: SELECT c1 FROM public.tbl04 WHERE ((c3 <> 'aef')) +(6 rows) --Testcase 59: SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; @@ -513,14 +764,14 @@ SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; --Testcase 60: EXPLAIN VERBOSE SELECT max(id), min(c1), variance(c2) FROM tbl04; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.07..34.08 rows=1 width=44) Output: max(id), min(c1), variance(c2) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=20) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 (6 rows) --Testcase 61: @@ -533,14 +784,14 @@ SELECT max(id), min(c1), variance(c2) FROM tbl04; --Testcase 62: EXPLAIN VERBOSE SELECT variance(c2), variance(c1) FROM tbl04; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.05..34.06 rows=1 width=40) Output: variance(c2), variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2 FROM public.tbl04 (6 rows) --Testcase 63: @@ -553,16 +804,15 @@ SELECT variance(c2), variance(c1) FROM tbl04; --Testcase 64: EXPLAIN VERBOSE SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Aggregate (cost=34.05..34.06 rows=1 width=16) Output: sum(c1), variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=8) Output: id, c1, c2, c3, c4, c5 - Filter: (tbl04.id <= 10) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(7 rows) + Remote SQL: SELECT c1 FROM public.tbl04 WHERE ((id <= 10)) +(6 rows) --Testcase 65: SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; @@ -575,15 +825,15 @@ SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; --Testcase 66: EXPLAIN VERBOSE SELECT count(c1), sum(c2), variance(c2) FROM tbl04 HAVING (count(c1) > 0); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.10..34.11 rows=1 width=72) Output: count(c1), sum(c2), variance(c2) Filter: (count(tbl04.c1) > 0) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2 FROM public.tbl04 (7 rows) --Testcase 67: @@ -596,15 +846,15 @@ SELECT count(c1), sum(c2), variance(c2) FROM tbl04 HAVING (count(c1) > 0); --Testcase 68: EXPLAIN VERBOSE SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 AND variance(c2) > 55.54; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.12..34.14 rows=1 width=64) Output: ((count(c1))::numeric + sum(c2)), (variance(c2) / 2.12) Filter: ((count(tbl04.c4) <> 0) AND (variance(tbl04.c2) > 55.54)) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=17) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2, c4 FROM public.tbl04 (7 rows) --Testcase 69: @@ -614,9 +864,1897 @@ SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 2022757 | 171661843805.39832285 (1 row) +--Testcase 241: +EXPLAIN VERBOSE +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); + QUERY PLAN +----------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (count(c1)), (sum(c2)) + Filter: ((count(tbl04.c1)) > 0) + Foreign Table Size: 9 b + Remote SQL: SELECT count(c1), sum(c2) FROM public.tbl04 +(5 rows) + +--Testcase 242: +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); + count | sum +-------+--------- + 9 | 2022748 +(1 row) + +--Testcase 243: +EXPLAIN VERBOSE +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=32) + Output: (((count(c1))::numeric + sum(c2))) + Filter: (((count(tbl04.c4)) <> 0) AND ((avg(tbl04.c2)) > 55.54)) + Foreign Table Size: 9 b + Remote SQL: SELECT (count(c1) + sum(c2)), count(c4), avg(c2) FROM public.tbl04 +(5 rows) + +--Testcase 244: +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + ?column? +---------- + 2022757 +(1 row) + +--aggregation function push-down: +-- avg +--Testcase 80: +EXPLAIN VERBOSE +SELECT avg(c1), avg(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (avg(c1)), ((avg(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT avg(c1), (avg(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 81: +SELECT avg(c1), avg(c2) + 1 FROM tbl04; + avg | ?column? +-------------------+--------------------- + 6068.354677777777 | 224750.777777777778 +(1 row) + +-- avg(DISTINCT) +--Testcase 82: +EXPLAIN VERBOSE +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (avg(DISTINCT c1)), (avg(DISTINCT c2)) + Foreign Table Size: 9 b + Remote SQL: SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM public.tbl04 +(4 rows) + +--Testcase 83: +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + avg | avg +-------------------+--------------------- + 6068.354677777777 | 224749.777777777778 +(1 row) + +-- bit_and +--Testcase 84: +EXPLAIN VERBOSE +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=12) + Output: (bit_and(id)), ((bit_and(c2) + 1)) + Foreign Table Size: 9 b + Remote SQL: SELECT bit_and(id), (bit_and(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 85: +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; + bit_and | ?column? +---------+---------- + 0 | 1 +(1 row) + +-- bit_and(DISTINCT) +--Testcase 86: +EXPLAIN VERBOSE +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.05 rows=1 width=12) + Output: bit_and(DISTINCT id), bit_and(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c2 FROM public.tbl04 +(6 rows) + +--Testcase 87: +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + bit_and | bit_and +---------+--------- + 0 | 0 +(1 row) + +-- bit_or +--Testcase 88: +EXPLAIN VERBOSE +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=12) + Output: (bit_or(id)), ((bit_or(c2) + 1)) + Foreign Table Size: 9 b + Remote SQL: SELECT bit_or(id), (bit_or(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 89: +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; + bit_or | ?column? +--------+---------- + 15 | 1835008 +(1 row) + +-- bit_or(DISTINCT) +--Testcase 90: +EXPLAIN VERBOSE +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.05 rows=1 width=12) + Output: bit_or(DISTINCT id), bit_or(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c2 FROM public.tbl04 +(6 rows) + +--Testcase 91: +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + bit_or | bit_or +--------+--------- + 15 | 1835007 +(1 row) + +-- count +--Testcase 92: +EXPLAIN VERBOSE +SELECT count(c1), count(c2), count(c3) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan (cost=1.00..1.00 rows=1 width=24) + Output: (count(c1)), (count(c2)), (count(c3)) + Foreign Table Size: 9 b + Remote SQL: SELECT count(c1), count(c2), count(c3) FROM public.tbl04 +(4 rows) + +--Testcase 93: +SELECT count(c1), count(c2), count(c3) FROM tbl04; + count | count | count +-------+-------+------- + 9 | 9 | 9 +(1 row) + +-- count(DISTINCT) +--Testcase 94: +EXPLAIN VERBOSE +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=24) + Output: (count(DISTINCT c1)), (count(DISTINCT c2)), (count(DISTINCT c3)) + Foreign Table Size: 9 b + Remote SQL: SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM public.tbl04 +(4 rows) + +--Testcase 95: +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + count | count | count +-------+-------+------- + 9 | 9 | 5 +(1 row) + +-- max/min +--Testcase 241: +EXPLAIN VERBOSE +SELECT max(c1), min(c1) FROM tbl04; + QUERY PLAN +--------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=16) + Output: (max(c1)), (min(c1)) + Foreign Table Size: 9 b + Remote SQL: SELECT max(c1), min(c1) FROM public.tbl04 +(4 rows) + +--Testcase 242: +SELECT max(c1), min(c1) FROM tbl04; + max | min +----------+---------- + 45021.21 | -121.122 +(1 row) + +-- max/min (DISTINCT) +--Testcase 243: +EXPLAIN VERBOSE +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=16) + Output: (max(DISTINCT c1)), (min(DISTINCT c1)) + Foreign Table Size: 9 b + Remote SQL: SELECT max(DISTINCT c1), min(DISTINCT c1) FROM public.tbl04 +(4 rows) + +--Testcase 244: +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + max | min +----------+---------- + 45021.21 | -121.122 +(1 row) + +-- stddev +--Testcase 96: +EXPLAIN VERBOSE +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev(c1), (stddev(c2) + '1'::numeric) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 97: +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; + stddev | ?column? +-------------------+----------------- + 14787.10013608647 | 603261.39888878 +(1 row) + +-- stddev(DISTINCT) +--Testcase 98: +EXPLAIN VERBOSE +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev(DISTINCT c1), stddev(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 99: +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + stddev | stddev +-------------------+----------------- + 14787.10013608647 | 603260.39888878 +(1 row) + +-- stddev_pop +--Testcase 100: +EXPLAIN VERBOSE +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (stddev_pop(c1)), ((stddev_pop(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT stddev_pop(c1), (stddev_pop(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 101: +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; + stddev_pop | ?column? +--------------------+----------------- + 13941.411707081685 | 568760.35850074 +(1 row) + +-- stddev_pop(DISTINCT) +--Testcase 102: +EXPLAIN VERBOSE +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 103: +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + stddev_pop | stddev_pop +--------------------+----------------- + 13941.411707081685 | 568759.35850074 +(1 row) + +-- stddev_samp +--Testcase 104: +EXPLAIN VERBOSE +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (stddev_samp(c1)), ((stddev_samp(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT stddev_samp(c1), (stddev_samp(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 105: +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; + stddev_samp | ?column? +-------------------+----------------- + 14787.10013608647 | 603261.39888878 +(1 row) + +-- stddev_samp(DISTINCT) +--Testcase 106: +EXPLAIN VERBOSE +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 107: +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + stddev_samp | stddev_samp +-------------------+----------------- + 14787.10013608647 | 603260.39888878 +(1 row) + +-- sum +--Testcase 108: +EXPLAIN VERBOSE +SELECT sum(c1), sum(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (sum(c1)), ((sum(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT sum(c1), (sum(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 109: +SELECT sum(c1), sum(c2) + 1 FROM tbl04; + sum | ?column? +------------+---------- + 54615.1921 | 2022749 +(1 row) + +-- sum(DISTINCT) +--Testcase 110: +EXPLAIN VERBOSE +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (sum(DISTINCT c1)), (sum(DISTINCT c2)) + Foreign Table Size: 9 b + Remote SQL: SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM public.tbl04 +(4 rows) + +--Testcase 111: +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + sum | sum +------------+--------- + 54615.1921 | 2022748 +(1 row) + +-- var_pop +--Testcase 112: +EXPLAIN VERBOSE +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (var_pop(c1)), ((var_pop(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT var_pop(c1), (var_pop(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 113: +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; + var_pop | ?column? +--------------------+----------------------- + 194362960.38635424 | 323487207883.17283951 +(1 row) + +-- var_pop(DISTINCT) +--Testcase 114: +EXPLAIN VERBOSE +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: var_pop(DISTINCT c1), var_pop(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 115: +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + var_pop | var_pop +--------------------+----------------------- + 194362960.38635424 | 323487207882.17283951 +(1 row) + +-- var_samp +--Testcase 116: +EXPLAIN VERBOSE +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (var_samp(c1)), ((var_samp(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT var_samp(c1), (var_samp(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 117: +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; + var_samp | ?column? +-------------------+----------------------- + 218658330.4346485 | 363923108868.44444444 +(1 row) + +-- var_samp(DISTINCT) +--Testcase 118: +EXPLAIN VERBOSE +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: var_samp(DISTINCT c1), var_samp(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 119: +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + var_samp | var_samp +-------------------+----------------------- + 218658330.4346485 | 363923108867.44444444 +(1 row) + +-- variance(DISTINCT) +--Testcase 120: +EXPLAIN VERBOSE +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: variance(DISTINCT c1), variance(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 121: +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + variance | variance +-------------------+----------------------- + 218658330.4346485 | 363923108867.44444444 +(1 row) + +-- non-push down case: +--Testcase 122: +EXPLAIN VERBOSE +SELECT corr(id, c1) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=8) + Output: corr((id)::double precision, c1) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1 FROM public.tbl04 +(6 rows) + +--Testcase 123: +SELECT corr(id, c1) FROM tbl04; + corr +--------------------- + 0.20164072965667135 +(1 row) + +-- =================================================================== +-- WHERE push-down +-- =================================================================== +-- add some null record +--Testcase 124: +INSERT INTO tbl04 VALUES (11, -1.12, NULL, '(!)JAWLFJ', false, '2010-11-01 00:00:00'); +--Testcase 125: +INSERT INTO tbl04 VALUES (12, 45021.21, 2121, 'example', NULL, '1999-10-01 00:00:00'); +--Testcase 126: +INSERT INTO tbl04 VALUES (13, 121.9741, 23241, 'thing', NULL, '2010-10-01 00:00:00'); +--Testcase 127: +INSERT INTO tbl04 VALUES (14, 75, 316, 'example', NULL, '1999-10-01 10:10:00'); +--Testcase 128: +INSERT INTO tbl04 VALUES (15, 6867.34, 8916, NULL, false, '2010-10-01 10:10:00'); +-- Logical operator +--Testcase 129: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((c1 >= 0) OR ((c2 > 0) AND (NOT c4)))) +(4 rows) + +--Testcase 130: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + id | c1 | c2 +----+----------+-------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 131: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((c1 >= 0) OR c4)) +(4 rows) + +--Testcase 132: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 133: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (c4) AND ((c1 >= 0)) +(4 rows) + +--Testcase 134: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + id | c1 | c2 +----+-------+-------- + 1 | 31.12 | 128912 +(1 row) + +--Testcase 135: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((NOT c4)) +(4 rows) + +--Testcase 136: +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 15 | 6867.34 | 8916 +(9 rows) + +-- Comparison operator +--Testcase 137: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id > 1)) +(4 rows) + +--Testcase 138: +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + id | c1 | c2 +----+----------+--------- + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 139: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id >= 1)) +(4 rows) + +--Testcase 140: +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 141: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id < 2)) +(4 rows) + +--Testcase 142: +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + id | c1 | c2 +----+-------+-------- + 1 | 31.12 | 128912 +(1 row) + +--Testcase 143: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id <= 2)) +(4 rows) + +--Testcase 144: +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + id | c1 | c2 +----+---------+-------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 +(2 rows) + +--Testcase 145: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id = 2)) +(4 rows) + +--Testcase 146: +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + id | c1 | c2 +----+---------+------ + 2 | 2565.56 | 6565 +(1 row) + +--Testcase 147: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id <> 2)) +(4 rows) + +--Testcase 148: +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 149: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id <> 2)) +(4 rows) + +--Testcase 150: +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 151: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((id < 1) OR (id > 5))) +(4 rows) + +--Testcase 152: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + id | c1 | c2 +----+----------+------- + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 153: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id <= c2)) AND ((id >= c1)) +(4 rows) + +--Testcase 154: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + id | c1 | c2 +----+----------+--------- + 3 | -121.122 | 1829812 + 5 | -1.12 | 22342 +(2 rows) + +--Testcase 155: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + QUERY PLAN +--------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((id < 1) OR (id > 5))) AND (((id < 5) OR (id > 1))) +(4 rows) + +--Testcase 156: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + id | c1 | c2 +----+----------+------- + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 157: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((((id >= c1) AND (id <= c2)) OR ((id >= c2) AND (id <= c1)))) +(4 rows) + +--Testcase 158: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + id | c1 | c2 +----+----------+--------- + 3 | -121.122 | 1829812 + 5 | -1.12 | 22342 +(2 rows) + +--Testcase 159: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: (tbl04.c1 IS DISTINCT FROM '2'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 +(5 rows) + +--Testcase 160: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 161: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: (tbl04.c1 IS DISTINCT FROM (tbl04.id)::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 +(5 rows) + +--Testcase 162: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 163: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c3 IS NULL)) +(4 rows) + +--Testcase 164: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + id | c1 | c2 +----+---------+------ + 15 | 6867.34 | 8916 +(1 row) + +--Testcase 165: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + QUERY PLAN +---------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c3 IS NOT NULL)) +(4 rows) + +--Testcase 166: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 +(13 rows) + +--Testcase 167: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c4 IS TRUE)) +(4 rows) + +--Testcase 168: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 +(2 rows) + +--Testcase 169: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c4 IS FALSE)) +(4 rows) + +--Testcase 170: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 171: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + QUERY PLAN +---------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c4 IS NOT TRUE)) +(4 rows) + +--Testcase 172: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 173: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c4 IS NOT FALSE)) +(4 rows) + +--Testcase 174: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 +(5 rows) + +--Testcase 175: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=13) + Output: id, c1, c4 + Filter: (tbl04.c4 IS UNKNOWN) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c4 FROM public.tbl04 +(5 rows) + +--Testcase 176: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + id | c1 | c4 +----+----------+---- + 12 | 45021.21 | + 13 | 121.9741 | + 14 | 75 | +(3 rows) + +--Testcase 177: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=13) + Output: id, c1, c4 + Filter: (tbl04.c4 IS NOT UNKNOWN) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c4 FROM public.tbl04 +(5 rows) + +--Testcase 178: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down + id | c1 | c4 +----+----------+---- + 1 | 31.12 | t + 2 | 2565.56 | f + 3 | -121.122 | t + 4 | 55.23 | f + 5 | -1.12 | f + 6 | 45021.21 | f + 7 | 121.9741 | f + 8 | 75 | f + 9 | 6867.34 | f + 11 | -1.12 | f + 15 | 6867.34 | f +(11 rows) + +-- Mathematical operator +--Testcase 179: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id * 100 + 100 > c2; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((((id * 100) + 100) > c2)) +(4 rows) + +--Testcase 180: +SELECT id, c1, c2 FROM tbl04 WHERE c1 * 100 + 100 > c2; + id | c1 | c2 +----+----------+------ + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(8 rows) + +--Testcase 181: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((c2 - c1) < 0)) +(4 rows) + +--Testcase 182: +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + id | c1 | c2 +----+----------+------ + 6 | 45021.21 | 2121 + 12 | 45021.21 | 2121 +(2 rows) + +--Testcase 183: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: ((tbl04.c2 / 100) > 0) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 +(5 rows) + +--Testcase 184: +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 185: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((c2 % 2) = 1)) +(4 rows) + +--Testcase 186: +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 +(6 rows) + +--Testcase 187: +EXPLAIN VERBOSE +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, ((id)::double precision ^ '2'::double precision) + Filter: (((tbl04.id)::double precision ^ '2'::double precision) > '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 188: +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + id | ?column? +----+---------- + 3 | 9 + 4 | 16 + 5 | 25 + 6 | 36 + 7 | 49 + 8 | 64 + 9 | 81 + 11 | 121 + 12 | 144 + 13 | 169 + 14 | 196 + 15 | 225 +(12 rows) + +--Testcase 189: +EXPLAIN VERBOSE +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, (|/ (id)::double precision) + Filter: ((|/ (tbl04.id)::double precision) < '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 190: +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + id | ?column? +----+-------------------- + 1 | 1 + 2 | 1.4142135623730951 + 3 | 1.7320508075688772 + 4 | 2 + 5 | 2.23606797749979 + 6 | 2.449489742783178 + 7 | 2.6457513110645907 + 8 | 2.8284271247461903 + 9 | 3 + 11 | 3.3166247903554 + 12 | 3.4641016151377544 + 13 | 3.605551275463989 + 14 | 3.7416573867739413 + 15 | 3.872983346207417 +(14 rows) + +--Testcase 191: +EXPLAIN VERBOSE +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, (||/ (id)::double precision) + Filter: ((||/ (tbl04.id)::double precision) < '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 192: +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + id | ?column? +----+-------------------- + 1 | 1 + 2 | 1.2599210498948734 + 3 | 1.4422495703074083 + 4 | 1.5874010519681996 + 5 | 1.7099759466766968 + 6 | 1.8171205928321394 + 7 | 1.9129311827723894 + 8 | 2 + 9 | 2.080083823051904 + 11 | 2.2239800905693157 + 12 | 2.2894284851066633 + 13 | 2.3513346877207577 + 14 | 2.4101422641752306 + 15 | 2.46621207433047 +(14 rows) + +--Testcase 193: +EXPLAIN VERBOSE +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=12) + Output: id, (@ c2) + Filter: ((@ tbl04.c2) < 1000) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c2 FROM public.tbl04 +(5 rows) + +--Testcase 194: +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + id | ?column? +----+---------- + 4 | 523 + 8 | 316 + 14 | 316 +(3 rows) + +--Testcase 195: +EXPLAIN VERBOSE +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id & 123) + Filter: ((tbl04.id & 123) < 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 196: +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + id | ?column? +----+---------- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 0 + 5 | 1 + 6 | 2 + 7 | 3 +(7 rows) + +--Testcase 197: +EXPLAIN VERBOSE +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=12) + Output: id, ('123'::bigint | c2) + Filter: (('123'::bigint | tbl04.c2) > 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c2 FROM public.tbl04 +(5 rows) + +--Testcase 198: +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + id | ?column? +----+---------- + 1 | 129019 + 2 | 6655 + 3 | 1829887 + 4 | 635 + 5 | 22399 + 6 | 2171 + 7 | 23291 + 8 | 383 + 9 | 8959 + 12 | 2171 + 13 | 23291 + 14 | 383 + 15 | 8959 +(13 rows) + +--Testcase 199: +EXPLAIN VERBOSE +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id # 324) + Filter: ((tbl04.id # 324) > 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 200: +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + id | ?column? +----+---------- + 1 | 325 + 2 | 326 + 3 | 327 + 4 | 320 + 5 | 321 + 6 | 322 + 7 | 323 + 8 | 332 + 9 | 333 + 11 | 335 + 12 | 328 + 13 | 329 + 14 | 330 + 15 | 331 +(14 rows) + +--Testcase 201: +EXPLAIN VERBOSE +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (~ id) + Filter: ((~ tbl04.id) < '-2'::integer) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 202: +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + id | ?column? +----+---------- + 2 | -3 + 3 | -4 + 4 | -5 + 5 | -6 + 6 | -7 + 7 | -8 + 8 | -9 + 9 | -10 + 11 | -12 + 12 | -13 + 13 | -14 + 14 | -15 + 15 | -16 +(13 rows) + +--Testcase 203: +EXPLAIN VERBOSE +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id << 2) + Filter: ((tbl04.id << 2) < 10) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 204: +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + id | ?column? +----+---------- + 1 | 4 + 2 | 8 +(2 rows) + +--Testcase 205: +EXPLAIN VERBOSE +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id >> 2) + Filter: ((tbl04.id >> 2) = 0) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 206: +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + id | ?column? +----+---------- + 1 | 0 + 2 | 0 + 3 | 0 +(3 rows) + +-- String operator +--Testcase 207: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: is_normalized(tbl04.c3, 'nfc'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 208: +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + c3 +------------ + anystring + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(13 rows) + +--Testcase 209: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (NOT is_normalized(tbl04.c3, 'nfkc'::text)) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 210: +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + c3 +---- +(0 rows) + +-- Pattern matching operator +--Testcase 211: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 WHERE ((c3 LIKE '%hi%')) +(4 rows) + +--Testcase 212: +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + c3 +------- + thing + thing + thing + thing +(4 rows) + +--Testcase 213: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 WHERE ((c3 NOT LIKE '%hi%')) +(4 rows) + +--Testcase 214: +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + c3 +------------ + anystring + example + !)@(#)!_#! + (!)JAWLFJ + example + example + (!)JAWLFJ + example + example +(9 rows) + +--Testcase 215: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~~* '%Hi%'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 216: +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + c3 +------- + thing + thing + thing + thing +(4 rows) + +--Testcase 217: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~~* '%Hi%'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 218: +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + c3 +------------ + anystring + example + !)@(#)!_#! + (!)JAWLFJ + example + example + (!)JAWLFJ + example + example +(9 rows) + +--Testcase 219: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~ '^(?:.*(?:y|w).*)$'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 220: +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 221: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~ '^(?:.*(?:y|w).*)$'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 222: +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +--Testcase 223: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~ 'any.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 224: +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 225: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~* 'ANY.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 226: +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 227: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~ 'any.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 228: +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +--Testcase 229: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~* 'ANY.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 230: +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +-- test for specific type +--Testcase 231: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE inet; +--Testcase 232: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 + 1 > inet '192.168.1.100'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 + '1'::bigint) > '192.168.1.100'::inet) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM public.tbl04 +(5 rows) + +--Testcase 233: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE json; +--Testcase 234: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 ->> 'tag'::text) = 'test data'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM public.tbl04 +(5 rows) + +--Testcase 235: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE jsonb; +--Testcase 236: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 ->> 'tag'::text) = 'test data'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM public.tbl04 +(5 rows) + +--Testcase 237: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE point; +--Testcase 238: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 >> point '(1, 3)'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: (tbl04.c3 >> '(1,3)'::point) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM public.tbl04 +(5 rows) + +-- reset c3 column type +--Testcase 239: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE text; +-- Reset data for tbl04; +--Testcase 240: +DELETE FROM tbl04 WHERE id > 10; --Testcase 70: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/13.4/new_test.sql:185: NOTICE: drop cascades to 5 other objects +psql:sql/13.4/new_test.sql:778: NOTICE: drop cascades to 5 other objects DETAIL: drop cascades to user mapping for public on server postgres_server drop cascades to foreign table tbl01 drop cascades to foreign table tbl02 diff --git a/expected/13.4/postgresql/ported_postgres_fdw.out b/expected/13.4/postgresql/ported_postgres_fdw.out index bb2b249..7f3e3ba 100644 --- a/expected/13.4/postgresql/ported_postgres_fdw.out +++ b/expected/13.4/postgresql/ported_postgres_fdw.out @@ -622,8 +622,8 @@ SELECT * FROM ft1 ORDER BY c3, c1 OFFSET 100 LIMIT 10; -- single table with alias - also test that tableoid sort is not pushed to remote side --Testcase 40: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tableoid OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8, tableoid -> Sort @@ -631,7 +631,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tabl Sort Key: t1.c3, t1.c1, t1.tableoid -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, tableoid - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 41: @@ -653,8 +653,8 @@ SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tableoid OFFSET 100 LIMIT 10; -- whole-row reference --Testcase 42: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: t1.*, c3, c1 -> Sort @@ -662,7 +662,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET Sort Key: t1.c3, t1.c1 -> Foreign Scan on public.ft1 t1 Output: t1.*, c3, c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 43: @@ -691,12 +691,12 @@ SELECT * FROM ft1 WHERE false; -- with WHERE clause --Testcase 45: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1'; - QUERY PLAN --------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c7 >= '1'::bpchar) AND (t1.c1 = 101) AND ((t1.c6)::text = '1'::text)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Filter: ((t1.c6)::text = '1'::text) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c7 >= '1')) AND (("C_1" = 101)) (4 rows) --Testcase 46: @@ -709,15 +709,14 @@ SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1'; -- with FOR UPDATE/SHARE --Testcase 47: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- LockRows Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* - Filter: (t1.c1 = 101) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 101)) +(5 rows) --Testcase 48: SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; @@ -728,15 +727,14 @@ SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; --Testcase 49: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- LockRows Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* - Filter: (t1.c1 = 102) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 102)) +(5 rows) --Testcase 50: SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE; @@ -812,8 +810,8 @@ SET enable_nestloop TO false; --Testcase 58: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2."C_1" FROM ft2 t1 JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------- Limit Output: t1.c1, t2."C_1" -> Merge Join @@ -824,13 +822,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t2."C_1" Sort Key: t2."C_1" -> Foreign Scan on "S 1"."T1" t2 Output: t2."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (17 rows) --Testcase 59: @@ -854,8 +852,8 @@ SELECT t1.c1, t2."C_1" FROM ft2 t1 JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFS --Testcase 60: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2."C_1" FROM ft2 t1 LEFT JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------- Limit Output: t1.c1, t2."C_1" -> Merge Left Join @@ -866,13 +864,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t2."C_1" Sort Key: t2."C_1" -> Foreign Scan on "S 1"."T1" t2 Output: t2."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (17 rows) --Testcase 61: @@ -896,8 +894,8 @@ SELECT t1.c1, t2."C_1" FROM ft2 t1 LEFT JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") --Testcase 62: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1" FROM "S 1"."T1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Limit Output: t1."C_1" -> Merge Left Join @@ -908,7 +906,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t3.c1 -> Merge Join @@ -919,13 +917,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (28 rows) --Testcase 63: @@ -950,8 +948,8 @@ SELECT t1."C_1" FROM "S 1"."T1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c --Testcase 64: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 left join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Limit Output: t1."C_1", t2.c1, t3.c1 -> Merge Left Join @@ -962,7 +960,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t3.c1, t2.c1 -> Merge Left Join @@ -973,13 +971,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t2.c1 Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (28 rows) --Testcase 65: @@ -1002,8 +1000,8 @@ SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 left join ft1 t2 full join ft2 --Testcase 66: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 full join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Limit Output: t1."C_1", t2.c1, t3.c1 -> Merge Full Join @@ -1014,7 +1012,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t2.c1, t3.c1 Sort Key: t3.c1 @@ -1026,13 +1024,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (29 rows) --Testcase 67: @@ -1060,123 +1058,115 @@ RESET enable_nestloop; -- =================================================================== --Testcase 70: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 1; -- Var, OpExpr(b), Const - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 71: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 100 AND t1.c2 = 0; -- BoolExpr - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c1 = 100) AND (t1.c2 = 0)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 100)) AND ((c2 = 0)) +(3 rows) --Testcase 72: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NULL; -- NullTest - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 IS NULL) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" IS NULL)) +(3 rows) --Testcase 73: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NOT NULL; -- NullTest - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 IS NOT NULL) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" IS NOT NULL)) +(3 rows) --Testcase 74: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE round(abs(c1), 0) = 1; -- FuncExpr - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (round((abs(t1.c1))::numeric, 0) = '1'::numeric) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((round(abs("C_1"), 0) = 1)) +(3 rows) --Testcase 75: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = -c1; -- OpExpr(l) - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = (- t1.c1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = (- "C_1"))) +(3 rows) --Testcase 76: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE 1 = c1!; -- OpExpr(r) - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ('1'::numeric = ((t1.c1)::bigint !)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 77: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c1 IS NOT NULL) IS DISTINCT FROM (c1 IS NOT NULL); -- DistinctExpr - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c1 IS NOT NULL) IS DISTINCT FROM (t1.c1 IS NOT NULL)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 78: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = ANY(ARRAY[c2, 1, c1 + 0]); -- ScalarArrayOpExpr - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = ANY (ARRAY[t1.c2, 1, (t1.c1 + 0)])) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ("C_1" IN (c2, 1, ("C_1" + 0))) +(3 rows) --Testcase 79: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- SubscriptingRef - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = (ARRAY[t1.c1, t1.c2, 3])[1]) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 80: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c6 = E'foo''s\\bar'; -- check special chars - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c6)::text = 'foo''s\bar'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 81: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c8 = 'foo'; -- can't be sent to remote - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c8 = 'foo'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) +(3 rows) -- parameterized remote path for foreign table --Testcase 82: @@ -1189,14 +1179,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Hash Cond: (a.c2 = b.c1) -> Foreign Scan on "S 1"."T1" a Output: a."C_1", a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8 - Filter: (a."C_1" = 47) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 47)) -> Hash Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 -> Foreign Scan on public.ft2 b Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(12 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" +(11 rows) --Testcase 83: SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2; @@ -1210,8 +1199,8 @@ SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2; EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 a, ft2 b WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = upper(a.c7); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------- Merge Join Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 Merge Cond: ((a.c1 = b.c1) AND ((upper((a.c7)::text)) = ((b.c7)::text))) @@ -1220,15 +1209,14 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: a.c1, (upper((a.c7)::text)) -> Foreign Scan on public.ft2 a Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, upper((a.c7)::text) - Filter: ((a.c2 = 6) AND (a.c8 = 'foo'::text)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c2 = 6)) AND ((c8 = 'foo')) -> Sort Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8, ((b.c7)::text) Sort Key: b.c1, ((b.c7)::text) -> Foreign Scan on public.ft2 b Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8, b.c7 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(16 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" +(15 rows) --Testcase 85: SELECT * FROM ft2 a, ft2 b @@ -1363,27 +1351,27 @@ SELECT * FROM ft2 WHERE c1 = ANY (ARRAY(SELECT c1 FROM ft1 WHERE c1 < 5)); --Testcase 88: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 ORDER BY ft2.c1, random(); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Sort Output: c1, c2, c3, c4, c5, c6, c7, c8, (random()) Sort Key: ft2.c1, (random()) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8, random() - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (6 rows) --Testcase 89: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 ORDER BY ft2.c1, ft2.c3 collate "C"; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Sort Output: c1, c2, c3, c4, c5, c6, c7, c8, ((c3)::text) Sort Key: ft2.c1, ft2.c3 COLLATE "C" -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8, c3 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (6 rows) -- user-defined operator/function @@ -1404,15 +1392,12 @@ CREATE OPERATOR === ( --Testcase 92: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: count(c3) - -> Foreign Scan on public.ft1 t1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = abs(t1.c2)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan + Output: (count(c3)) + Remote SQL: SELECT count(c3) FROM public."T1" WHERE (("C_1" = abs(c2))) +(3 rows) --Testcase 93: SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); @@ -1424,15 +1409,12 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); --Testcase 94: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: count(c3) - -> Foreign Scan on public.ft1 t1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan + Output: (count(c3)) + Remote SQL: SELECT count(c3) FROM public."T1" WHERE (("C_1" = c2)) +(3 rows) --Testcase 95: SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; @@ -1445,14 +1427,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; --Testcase 96: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = postgres_fdw_abs(t1.c2)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 97: @@ -1465,14 +1447,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); --Testcase 98: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 99: @@ -1486,8 +1468,8 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 100: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -1496,7 +1478,7 @@ EXPLAIN (VERBOSE, COSTS OFF) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (9 rows) --Testcase 101: @@ -1518,14 +1500,14 @@ ALTER EXTENSION :DB_EXTENSIONNAME ADD OPERATOR === (int, int); --Testcase 105: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = postgres_fdw_abs(t1.c2)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 106: @@ -1538,14 +1520,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); --Testcase 107: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 108: @@ -1559,8 +1541,8 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 109: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -1569,7 +1551,7 @@ EXPLAIN (VERBOSE, COSTS OFF) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (9 rows) --Testcase 110: @@ -1590,8 +1572,8 @@ SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; --Testcase 111: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -1602,12 +1584,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (16 rows) --Testcase 112: @@ -1630,8 +1612,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 113: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t3 ON (t3.c1 = t1.c1) ORDER BY t1.c3, t1.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3, t1.c3 -> Sort @@ -1642,7 +1624,7 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t Hash Cond: (t2.c1 = t1.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: t1.c1, t1.c3, t3.c3, t3.c1 -> Hash Join @@ -1650,12 +1632,12 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t Hash Cond: (t1.c1 = t3.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (24 rows) --Testcase 114: @@ -1678,8 +1660,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t --Testcase 115: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -1690,12 +1672,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (16 rows) --Testcase 116: @@ -1718,8 +1700,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. --Testcase 117: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1730,17 +1712,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 118: @@ -1765,22 +1747,20 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 119: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10; - QUERY PLAN --------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Hash Left Join Output: t1.c1, t1.c2, ft5.c1, ft5.c2 Hash Cond: (t1.c1 = ft5.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: (t1.c1 < 10) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2 FROM public."T3" WHERE ((c1 < 10)) -> Hash Output: ft5.c1, ft5.c2 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2 - Filter: (ft5.c1 < 10) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(13 rows) + Remote SQL: SELECT c1, c2 FROM public."T4" WHERE ((c1 < 10)) +(11 rows) --Testcase 120: SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10; @@ -1798,23 +1778,21 @@ SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE (t2.c1 < 10 OR t2.c1 IS NULL) AND t1.c1 < 10; - QUERY PLAN --------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Hash Left Join Output: t1.c1, t1.c2, ft5.c1, ft5.c2 Hash Cond: (t1.c1 = ft5.c1) Filter: ((ft5.c1 < 10) OR (ft5.c1 IS NULL)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: (t1.c1 < 10) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2 FROM public."T3" WHERE ((c1 < 10)) -> Hash Output: ft5.c1, ft5.c2 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2 - Filter: (ft5.c1 < 10) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(14 rows) + Remote SQL: SELECT c1, c2 FROM public."T4" WHERE ((c1 < 10)) +(12 rows) --Testcase 122: SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) @@ -1831,8 +1809,8 @@ SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE --Testcase 123: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2.c1, t1.c1 OFFSET 10 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -1843,12 +1821,12 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2 Hash Cond: (t2.c1 = t1.c1) -> Foreign Scan on public.ft4 t2 Output: t2.c1, t2.c2, t2.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t1.c1 -> Foreign Scan on public.ft5 t1 Output: t1.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (16 rows) --Testcase 124: @@ -1871,8 +1849,8 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2 --Testcase 125: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1883,17 +1861,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGH Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t3 Output: t3.c1, t3.c2, t3.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (21 rows) --Testcase 126: @@ -1916,8 +1894,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGH --Testcase 127: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 45 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -1928,12 +1906,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (16 rows) --Testcase 128: @@ -1957,8 +1935,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. --Testcase 129: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort Output: ft4.c1, ft5.c1 Sort Key: ft4.c1, ft5.c1 @@ -1967,15 +1945,13 @@ SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(16 rows) + Remote SQL: SELECT c1 FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(14 rows) --Testcase 130: SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1; @@ -1994,23 +1970,21 @@ SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL --Testcase 131: EXPLAIN (VERBOSE, COSTS OFF) SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Limit Output: 1 -> Merge Full Join Output: 1 -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT NULL FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Materialize Output: ft5.c1, ft5.c2, ft5.c3 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2, ft5.c3 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(14 rows) + Remote SQL: SELECT NULL FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(12 rows) --Testcase 132: SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10; @@ -2033,8 +2007,8 @@ SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELE --Testcase 133: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort Output: ft4.c1, t2.c1, t3.c1 Sort Key: ft4.c1, t2.c1, t3.c1 @@ -2046,20 +2020,18 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 Hash Cond: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t2 Output: t2.c1, t2.c2, t2.c3 - Filter: ((t2.c1 >= 50) AND (t2.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: t3.c1 -> Foreign Scan on public.ft5 t3 Output: t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" -(24 rows) + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(22 rows) --Testcase 134: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; @@ -2077,8 +2049,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 --Testcase 135: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------ Sort Output: ft4.c1, ft4_1.c1, ft5.c1 Sort Key: ft4.c1, ft4_1.c1, ft5.c1 @@ -2091,21 +2063,18 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 Filter: ((ft4_1.c1 IS NULL) OR (ft4_1.c1 IS NOT NULL)) -> Foreign Scan on public.ft4 ft4_1 Output: ft4_1.c1, ft4_1.c2, ft4_1.c3 - Filter: ((ft4_1.c1 >= 50) AND (ft4_1.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" -(26 rows) + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(23 rows) --Testcase 136: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; @@ -2125,8 +2094,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 --Testcase 137: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1; - QUERY PLAN --------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- LockRows Output: "T3".c1, ft4.c1, ft5.c1, "T3".*, ft4.*, ft5.* -> Sort @@ -2136,8 +2105,7 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER Output: "T3".c1, ft4.c1, ft5.c1, "T3".*, ft4.*, ft5.* -> Foreign Scan on "S 1"."T3" Output: "T3".c1, "T3".* - Filter: ("T3".c1 = 50) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" WHERE ((c1 = 50)) -> Materialize Output: ft4.c1, ft4.*, ft5.c1, ft5.* -> Hash Full Join @@ -2146,15 +2114,13 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER Filter: ((ft4.c1 IS NULL) OR (ft4.c1 IS NOT NULL)) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.* - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1, ft5.* -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.* - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(27 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(24 rows) --Testcase 138: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1; @@ -2174,8 +2140,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER --Testcase 139: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1, t3.c1 -> Sort @@ -2189,19 +2155,18 @@ SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 a Hash Cond: (t1.c1 = (t2.c1 + 1)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: ((t1.c1 >= 50) AND (t1.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" -> Hash Output: t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" -(25 rows) + Remote SQL: SELECT c1 FROM public."T3" +(24 rows) --Testcase 140: SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10; @@ -2223,8 +2188,8 @@ SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 a --Testcase 141: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -2235,17 +2200,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 142: @@ -2268,8 +2233,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 143: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2280,17 +2245,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t3 Output: t3.c1, t3.c2, t3.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (21 rows) --Testcase 144: @@ -2313,8 +2278,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT --Testcase 145: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -2325,17 +2290,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 146: @@ -2358,8 +2323,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 147: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2370,17 +2335,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 148: @@ -2403,8 +2368,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 149: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -2415,17 +2380,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 150: @@ -2448,8 +2413,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 151: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2460,17 +2425,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (21 rows) --Testcase 152: @@ -2493,8 +2458,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 153: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Right Join @@ -2505,17 +2470,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 154: @@ -2538,8 +2503,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT --Testcase 155: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2551,12 +2516,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 Filter: ((t1.c1 = t2.c1) OR (t1.c1 IS NULL)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (17 rows) --Testcase 156: @@ -2579,8 +2544,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 --Testcase 157: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t1.c3 -> Hash Full Join @@ -2589,12 +2554,12 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE Filter: (postgres_fdw_abs(t1.c1) > 0) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (14 rows) --Testcase 158: @@ -2604,8 +2569,8 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE --Testcase 159: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t1.c3 -> Hash Full Join @@ -2614,12 +2579,12 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE Filter: (postgres_fdw_abs(t1.c1) > 0) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (14 rows) --Testcase 160: @@ -2629,8 +2594,8 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE --Testcase 161: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE OF t1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2643,12 +2608,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (18 rows) --Testcase 162: @@ -2670,8 +2635,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 163: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2684,12 +2649,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (18 rows) --Testcase 164: @@ -2712,8 +2677,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 165: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE OF t1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2726,12 +2691,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (18 rows) --Testcase 166: @@ -2753,8 +2718,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 167: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2767,12 +2732,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (18 rows) --Testcase 168: @@ -2795,8 +2760,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 169: EXPLAIN (VERBOSE, COSTS OFF) WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) SELECT c1_1, c2_1 FROM t ORDER BY c1_3, c1_1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Limit Output: t.c1_1, t.c2_1, t.c1_3 CTE t @@ -2805,12 +2770,12 @@ WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t.c1_1, t.c2_1, t.c1_3 Sort Key: t.c1_3, t.c1_1 @@ -2838,8 +2803,8 @@ WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t --Testcase 171: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Limit Output: t1.ctid, t1.*, t2.*, t1.c1, t1.c3 -> Sort @@ -2850,20 +2815,20 @@ SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER B Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.ctid, t1.*, t1.c1, t1.c3 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.*, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.*, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (16 rows) -- SEMI JOIN, not pushed down --Testcase 172: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) ORDER BY t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1 -> Sort @@ -2875,7 +2840,7 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c1 -> HashAggregate @@ -2883,7 +2848,7 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) Group Key: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (20 rows) --Testcase 173: @@ -2906,8 +2871,8 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) --Testcase 174: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c2) ORDER BY t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1 -> Sort @@ -2918,12 +2883,12 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2 Hash Cond: (t1.c1 = t2.c2) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c2 -> Foreign Scan on public.ft2 t2 Output: t2.c2 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (16 rows) --Testcase 175: @@ -2946,8 +2911,8 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2 --Testcase 176: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2957,12 +2922,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 1 Output: t1.c1, t2.c1 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (15 rows) --Testcase 177: @@ -2985,8 +2950,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 1 --Testcase 178: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2997,12 +2962,12 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft5 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" -> Hash Output: t2.c1 -> Foreign Scan on public.ft6 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (16 rows) --Testcase 179: @@ -3016,8 +2981,8 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t --Testcase 180: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -3028,12 +2993,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1. Hash Cond: (t1.c8 = t2.c8) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c8 FROM public."T1" -> Hash Output: t2.c1, t2.c8 -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c8 FROM public."T1" (16 rows) --Testcase 181: @@ -3056,8 +3021,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1. --Testcase 182: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -3068,14 +3033,13 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c8 = 'foo'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" WHERE ((c8 = 'foo')) -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(17 rows) + Remote SQL: SELECT "C_1" FROM public."T1" +(16 rows) --Testcase 183: SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; @@ -3100,8 +3064,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 --Testcase 184: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2.c8 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -3115,13 +3079,13 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2. Sort Key: t1.c1, t1.c8 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3, c8 FROM public."T1" -> Sort Output: t2.c1, t2.c8 Sort Key: t2.c1, t2.c8 -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c8 FROM public."T1" (20 rows) --Testcase 185: @@ -3144,8 +3108,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2. --Testcase 186: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) UNION SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) AS t (t1c1, t2c1) GROUP BY t1c1 ORDER BY t1c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, (avg((t1.c1 + t2.c1))) -> Sort @@ -3163,23 +3127,23 @@ SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Join Output: t1_1.c1, t2_1.c1 Hash Cond: (t1_1.c1 = t2_1.c1) -> Foreign Scan on public.ft1 t1_1 Output: t1_1.c1, t1_1.c2, t1_1.c3, t1_1.c4, t1_1.c5, t1_1.c6, t1_1.c7, t1_1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2_1.c1 -> Foreign Scan on public.ft2 t2_1 Output: t2_1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (34 rows) --Testcase 187: @@ -3202,8 +3166,8 @@ SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 --Testcase 188: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM ft1 t2, ft2 t3 WHERE t2.c1 = t3.c1 AND t2.c2 = t1.c2) q ORDER BY t1."C_1" OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------- Limit Output: t1."C_1" -> Sort @@ -3213,7 +3177,7 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f Output: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1", t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Unique Output: t2.c1, t3.c1 -> Merge Join @@ -3225,13 +3189,13 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f -> Foreign Scan on public.ft1 t2 Output: t2.c1 Filter: (t2.c2 = t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (28 rows) --Testcase 189: @@ -3256,22 +3220,20 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f --Testcase 190: EXPLAIN (VERBOSE, COSTS OFF) SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Nested Loop Left Join Output: (13), ft2.c1 Join Filter: (13 = ft2.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: ((ft2.c1 >= 10) AND (ft2.c1 <= 15)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" >= 10)) AND (("C_1" <= 15)) -> Materialize Output: (13) -> Foreign Scan on public.ft1 Output: 13 - Filter: (ft1.c1 = 13) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(13 rows) + Remote SQL: SELECT NULL FROM public."T1" WHERE (("C_1" = 13)) +(11 rows) --Testcase 191: SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15; @@ -3289,8 +3251,8 @@ SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 O --Testcase 192: EXPLAIN (VERBOSE, COSTS OFF) SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------ Hash Right Join Output: ft4.c1, (13), ft1.c1, ft2.c1 Hash Cond: (ft1.c1 = ft4.c1) @@ -3298,21 +3260,18 @@ SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT Output: ft1.c1, ft2.c1, 13 -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Filter: (ft1.c1 = 12) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" = 12)) -> Materialize Output: ft2.c1 -> Foreign Scan on public.ft2 Output: ft2.c1 - Filter: (ft2.c1 = 12) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" = 12)) -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 10) AND (ft4.c1 <= 15)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" -(21 rows) + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 10)) AND ((c1 <= 15)) +(18 rows) --Testcase 193: SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15 ORDER BY ft4.c1; @@ -3329,8 +3288,8 @@ UPDATE ft5 SET c3 = null where c1 % 9 = 0; --Testcase 195: EXPLAIN (VERBOSE, COSTS OFF) SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Sort Output: ft5.*, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 Sort Key: ft5.c1 @@ -3339,14 +3298,13 @@ SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 10) AND (ft4.c1 <= 30)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2 FROM public."T3" WHERE ((c1 >= 10)) AND ((c1 <= 30)) -> Hash Output: ft5.*, ft5.c1, ft5.c2, ft5.c3 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1, ft5.c2, ft5.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(15 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(14 rows) --Testcase 196: SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1; @@ -3402,28 +3360,26 @@ SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = f Sort Key: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3, ft4.* - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Sort Output: ft5.c1, ft5.c2, ft5.c3, ft5.* Sort Key: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2, ft5.c3, ft5.* - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2, c3 FROM public."T4" -> Sort Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8, ft1.* Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8, ft1.* - Filter: (ft1.c1 < 100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" < 100)) -> Sort Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.* Sort Key: ft2.c1 -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.* - Filter: (ft2.c1 < 100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(48 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" < 100)) +(46 rows) --Testcase 202: SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = ft4.c1 @@ -3464,8 +3420,8 @@ ALTER VIEW v5 OWNER TO regress_view_owner; --Testcase 211: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Limit Output: ft4.c1, ft5.c2, ft5.c1 -> Sort @@ -3476,12 +3432,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: ft5.c2, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c2, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2 FROM public."T4" (16 rows) --Testcase 212: @@ -3505,8 +3461,8 @@ ALTER VIEW v4 OWNER TO regress_view_owner; --Testcase 214: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Limit Output: ft4.c1, ft5.c2, ft5.c1 -> Sort @@ -3517,12 +3473,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: ft5.c2, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c2, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2 FROM public."T4" (16 rows) --Testcase 215: @@ -3544,8 +3500,8 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 --Testcase 216: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Limit Output: ft4.c1, t2.c2, t2.c1 -> Sort @@ -3556,12 +3512,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c Hash Cond: (ft4.c1 = t2.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2 FROM public."T4" (16 rows) --Testcase 217: @@ -3585,8 +3541,8 @@ ALTER VIEW v4 OWNER TO CURRENT_USER; --Testcase 219: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Limit Output: ft4.c1, t2.c2, t2.c1 -> Sort @@ -3597,12 +3553,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c Hash Cond: (ft4.c1 = t2.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2 FROM public."T4" (16 rows) --Testcase 220: @@ -3647,9 +3603,8 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 5) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(12 rows) + Remote SQL: SELECT "C_1", c2, c6 FROM public."T1" WHERE ((c2 < 5)) +(11 rows) --Testcase 225: select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2; @@ -3679,9 +3634,8 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 5) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2, c6 FROM public."T1" WHERE ((c2 < 5)) +(13 rows) --Testcase 227: select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2 limit 1; @@ -3694,36 +3648,34 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran --Testcase 228: explain (verbose, costs off) select sum(c1 * (random() <= 1)::int) as sum, avg(c1) from ft1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Aggregate Output: sum((c1 * ((random() <= '1'::double precision))::integer)), avg(c1) -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (5 rows) -- Aggregate over join query --Testcase 229: explain (verbose, costs off) select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Aggregate Output: count(*), sum(t1.c1), avg(t2.c1) -> Nested Loop Output: t1.c1, t2.c1 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c2 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 = 6)) -> Materialize Output: t2.c1, t2.c2 -> Foreign Scan on public.ft1 t2 Output: t2.c1, t2.c2 - Filter: (t2.c2 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 = 6)) +(12 rows) --Testcase 230: select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6; @@ -3746,20 +3698,20 @@ select sum(t1.c1), count(t2.c1) from ft1 t1 inner join ft2 t2 on (t1.c1 = t2.c1) Join Filter: (((((t1.c1 * t2.c1) / (t1.c1 * t2.c1)))::double precision * random()) <= '1'::double precision) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (14 rows) -- GROUP BY clause having expressions --Testcase 232: explain (verbose, costs off) select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------ Sort Output: ((c2 / 2)), ((sum(c2) * ((c2 / 2)))) Sort Key: ((ft1.c2 / 2)) @@ -3768,7 +3720,7 @@ select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; Group Key: (ft1.c2 / 2) -> Foreign Scan on public.ft1 Output: (c2 / 2), c2 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (9 rows) --Testcase 233: @@ -3786,8 +3738,8 @@ select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; --Testcase 234: explain (verbose, costs off) select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, sqrt(c1) order by 1, 2) x; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Aggregate Output: count(ft1.c2), sum(ft1.c2) -> Sort @@ -3798,7 +3750,7 @@ select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, s Group Key: ft1.c2, sqrt((ft1.c1)::double precision) -> Foreign Scan on public.ft1 Output: ft1.c2, sqrt((ft1.c1)::double precision), ft1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (11 rows) --Testcase 235: @@ -3822,7 +3774,7 @@ select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) --Testcase 237: @@ -3845,8 +3797,8 @@ select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by --Testcase 238: explain (verbose, costs off) select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::int order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: ((c2 * ((random() <= '1'::double precision))::integer)) Sort Key: ((ft2.c2 * ((random() <= '1'::double precision))::integer)) @@ -3855,15 +3807,15 @@ select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::i Group Key: (ft2.c2 * ((random() <= '1'::double precision))::integer) -> Foreign Scan on public.ft2 Output: (c2 * ((random() <= '1'::double precision))::integer) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (9 rows) -- GROUP BY clause in various forms, cardinal, alias and constant expression --Testcase 239: explain (verbose, costs off) select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------ Sort Output: (count(c2)), c2, 5, 7.0, 9 Sort Key: ft1.c2 @@ -3872,7 +3824,7 @@ select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2 Group Key: ft1.c2, 5, 9 -> Foreign Scan on public.ft1 Output: c2, 5, 9 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (9 rows) --Testcase 240: @@ -3896,8 +3848,8 @@ select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2 --Testcase 241: explain (verbose, costs off) select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: c2, c2, (sum(c1)) Sort Key: (sum(ft1.c1)) @@ -3906,9 +3858,8 @@ select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); Group Key: ft1.c2, ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c2, c1 - Filter: (ft1.c2 > 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 > 6)) +(9 rows) --Testcase 242: select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); @@ -3923,8 +3874,8 @@ select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); --Testcase 243: explain (verbose, costs off) select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 order by c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Sort Output: c2, (sum(c1)) Sort Key: ft2.c2 @@ -3934,7 +3885,7 @@ select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 Filter: ((avg(ft2.c1) < '500'::numeric) AND (sum(ft2.c1) < 49800)) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (10 rows) --Testcase 244: @@ -3959,7 +3910,7 @@ select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having Filter: ((avg(ft1.c1) < '500'::numeric) AND ((((avg(ft1.c1) / avg(ft1.c1)))::double precision * random()) <= '1'::double precision)) -> Foreign Scan on public.ft1 Output: ft1.c5, sqrt((ft1.c2)::double precision), ft1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c5 FROM public."T1" (9 rows) --Testcase 246: @@ -3984,7 +3935,7 @@ select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 Filter: (avg((ft1.c1 * ((random() <= '1'::double precision))::integer)) > '100'::numeric) -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (10 rows) -- Remote aggregate in combination with a local Param (for the output @@ -3992,16 +3943,14 @@ select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 --Testcase 248: explain (verbose, costs off) select exists(select 1 from pg_enum), sum(c1) from ft1; - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: $0, sum(ft1.c1) + QUERY PLAN +-------------------------------------------------- + Foreign Scan + Output: $0, (sum(ft1.c1)) + Remote SQL: SELECT sum("C_1") FROM public."T1" InitPlan 1 (returns $0) -> Seq Scan on pg_catalog.pg_enum - -> Foreign Scan on public.ft1 - Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) +(5 rows) --Testcase 249: select exists(select 1 from pg_enum), sum(c1) from ft1; @@ -4013,8 +3962,8 @@ select exists(select 1 from pg_enum), sum(c1) from ft1; --Testcase 250: explain (verbose, costs off) select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------- GroupAggregate Output: ($0), sum(ft1.c1) Group Key: $0 @@ -4022,7 +3971,7 @@ select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; -> Seq Scan on pg_catalog.pg_enum -> Foreign Scan on public.ft1 Output: $0, ft1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (8 rows) --Testcase 251: @@ -4037,8 +3986,8 @@ select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; --Testcase 252: explain (verbose, costs off) select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------- Sort Output: (array_agg(c1 ORDER BY c1)), c2 Sort Key: (array_agg(ft1.c1 ORDER BY ft1.c1)) @@ -4050,9 +3999,8 @@ select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Filter: (ft1.c1 < 100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(13 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 100)) +(12 rows) --Testcase 253: select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; @@ -4074,15 +4022,14 @@ select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; --Testcase 254: explain (verbose, costs off) select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate Output: array_agg(c5 ORDER BY c1 DESC) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 50) AND (ft2.c2 = 6)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c5 FROM public."T1" WHERE (("C_1" < 50)) AND ((c2 = 6)) +(5 rows) --Testcase 255: select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; @@ -4095,8 +4042,8 @@ select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; --Testcase 256: explain (verbose, costs off) select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1; - QUERY PLAN --------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Sort Output: (array_agg(DISTINCT (t1.c1 % 5))), ((t2.c1 % 3)) Sort Key: (array_agg(DISTINCT (t1.c1 % 5))) @@ -4112,12 +4059,12 @@ select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2 Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (21 rows) --Testcase 257: @@ -4132,8 +4079,8 @@ select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2 --Testcase 258: explain (verbose, costs off) select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1; - QUERY PLAN --------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))), ((t2.c1 % 3)) Sort Key: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))) @@ -4149,12 +4096,12 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (21 rows) --Testcase 259: @@ -4185,12 +4132,12 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (21 rows) --Testcase 261: @@ -4205,8 +4152,8 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 --Testcase 262: explain (verbose, costs off) select sum(c1) filter (where c1 < 100 and c2 > 5) from ft1 group by c2 order by 1 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Sort Output: (sum(c1) FILTER (WHERE ((c1 < 100) AND (c2 > 5)))), c2 Sort Key: (sum(ft1.c1) FILTER (WHERE ((ft1.c1 < 100) AND (ft1.c2 > 5)))) @@ -4215,7 +4162,7 @@ select sum(c1) filter (where c1 < 100 and c2 > 5) from ft1 group by c2 order by Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) --Testcase 263: @@ -4245,9 +4192,8 @@ select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 f Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 = 6)) +(6 rows) --Testcase 265: select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 from ft1 where c2 = 6 group by c2; @@ -4260,8 +4206,8 @@ select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 f --Testcase 266: explain (verbose, costs off) select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------ Unique Output: ((SubPlan 1)) -> Sort @@ -4271,14 +4217,12 @@ select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft Output: (SubPlan 1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Filter: ((t2.c2 % 6) = 0) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (((c2 % 6) = 0)) SubPlan 1 -> Foreign Scan on public.ft1 t1 Output: count(*) FILTER (WHERE ((t2.c2 = 6) AND (t2.c1 < 10))) - Filter: (t1.c1 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(16 rows) + Remote SQL: SELECT NULL FROM public."T1" WHERE (("C_1" = 6)) +(14 rows) --Testcase 267: select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; @@ -4291,8 +4235,8 @@ select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft --Testcase 268: explain (verbose, costs off) select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- Unique Output: ((SubPlan 1)) -> Sort @@ -4300,16 +4244,14 @@ select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) fro Sort Key: ((SubPlan 1)) -> Foreign Scan on public.ft2 t2 Output: (SubPlan 1) - Filter: ((t2.c2 % 6) = 0) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (((c2 % 6) = 0)) SubPlan 1 -> Aggregate Output: count(t1.c1) FILTER (WHERE ((t2.c2 = 6) AND (t2.c1 < 10))) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(16 rows) + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" = 6)) +(14 rows) --Testcase 269: select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; @@ -4333,25 +4275,24 @@ select sum(c1) filter (where (c1 / c1) * random() <= 1) from ft1 group by c2 ord Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) --Testcase 271: explain (verbose, costs off) select sum(c2) filter (where c2 in (select c2 from ft1 where c2 < 5)) from ft1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Aggregate Output: sum(ft1.c2) FILTER (WHERE (hashed SubPlan 1)) -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" SubPlan 1 -> Foreign Scan on public.ft1 ft1_1 Output: ft1_1.c2 - Filter: (ft1_1.c2 < 5) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT c2 FROM public."T1" WHERE ((c2 < 5)) +(9 rows) -- Ordered-sets within aggregate --Testcase 272: @@ -4368,9 +4309,8 @@ select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10 Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c6, c1 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2, c6 FROM public."T1" WHERE ((c2 < 10)) +(10 rows) --Testcase 273: select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10::numeric) within group (order by c1) from ft1 where c2 < 10 group by c2 having percentile_cont(c2/10::numeric) within group (order by c1) < 500 order by c2; @@ -4387,8 +4327,8 @@ select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10 --Testcase 274: explain (verbose, costs off) select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 having c1 = 6 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- GroupAggregate Output: c1, rank(c1, c2) WITHIN GROUP (ORDER BY c1, c2), c2 Group Key: ft1.c1, ft1.c2 @@ -4397,9 +4337,8 @@ select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2 - Filter: (ft1.c1 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" = 6)) +(9 rows) --Testcase 275: select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 having c1 = 6 order by 1; @@ -4424,8 +4363,8 @@ set enable_hashagg to false; --Testcase 279: explain (verbose, costs off) select c2, least_agg(c1) from ft1 group by c2 order by c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4434,7 +4373,7 @@ select c2, least_agg(c1) from ft1 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) -- Add function and aggregate into extension @@ -4448,8 +4387,8 @@ alter extension :DB_EXTENSIONNAME add aggregate least_agg(variadic items anyarra --Testcase 283: explain (verbose, costs off) select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4458,9 +4397,8 @@ select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Filter: (ft1.c2 < 100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 100)) +(9 rows) --Testcase 284: select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; @@ -4489,8 +4427,8 @@ alter extension :DB_EXTENSIONNAME drop aggregate least_agg(variadic items anyarr --Testcase 288: explain (verbose, costs off) select c2, least_agg(c1) from ft1 group by c2 order by c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4499,7 +4437,7 @@ select c2, least_agg(c1) from ft1 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) -- Cleanup @@ -4548,16 +4486,15 @@ create operator class my_op_class for type int using btree family my_op_family a --Testcase 298: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 100)) AND ((c2 = 6)) +(6 rows) -- Update local stats on ft2 ANALYZE ft2; @@ -4581,16 +4518,15 @@ alter extension :DB_EXTENSIONNAME add operator public.>^(int, int); --Testcase 306: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 100)) AND ((c2 = 6)) +(6 rows) --Testcase 307: select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; @@ -4618,16 +4554,15 @@ alter extension :DB_EXTENSIONNAME drop operator public.>^(int, int); --Testcase 315: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 100)) AND ((c2 = 6)) +(6 rows) -- Cleanup --Testcase 316: @@ -4647,8 +4582,8 @@ drop operator public.<^(int, int); --Testcase 322: explain (verbose, costs off) select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2); - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate Output: count(t1.c3) -> Nested Loop Left Join @@ -4656,12 +4591,12 @@ select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2); Join Filter: ((t1.c1)::double precision = (random() * (t2.c2)::double precision)) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Materialize Output: t2.c2 -> Foreign Scan on public.ft2 t2 Output: t2.c2 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (13 rows) -- Subquery in FROM clause having aggregate @@ -4682,7 +4617,7 @@ select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x w Hash Cond: (ft1.c2 = x.a) -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" -> Hash Output: x.b, x.a -> Subquery Scan on x @@ -4692,7 +4627,7 @@ select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x w Group Key: ft1_1.c2 -> Foreign Scan on public.ft1 ft1_1 Output: ft1_1.c1, ft1_1.c2, ft1_1.c3, ft1_1.c4, ft1_1.c5, ft1_1.c6, ft1_1.c7, ft1_1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (23 rows) --Testcase 324: @@ -4729,12 +4664,12 @@ select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) gr Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (18 rows) --Testcase 326: @@ -4751,8 +4686,8 @@ select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) gr --Testcase 327: explain (verbose, costs off) select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1); - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Aggregate Output: count(*), sum(ft4.c1), avg(ft5.c1) -> Hash Full Join @@ -4760,15 +4695,13 @@ select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 betwee Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(15 rows) + Remote SQL: SELECT c1 FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(13 rows) --Testcase 328: select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1); @@ -4782,17 +4715,15 @@ select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 betwee --Testcase 329: explain (verbose, costs off) select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Sort - Output: ((sum(c2) * ((random() <= '1'::double precision))::integer)) - Sort Key: ((sum(ft1.c2) * ((random() <= '1'::double precision))::integer)) - -> Aggregate - Output: (sum(c2) * ((random() <= '1'::double precision))::integer) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(8 rows) + Output: (((sum(c2)) * ((random() <= '1'::double precision))::integer)) + Sort Key: (((sum(ft1.c2)) * ((random() <= '1'::double precision))::integer)) + -> Foreign Scan + Output: ((sum(c2)) * ((random() <= '1'::double precision))::integer) + Remote SQL: SELECT sum(c2) FROM public."T1" +(6 rows) --Testcase 330: select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1; @@ -4807,8 +4738,8 @@ set enable_hashagg to false; --Testcase 332: explain (verbose, costs off) select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum from ft2 t2 group by t2.c1) qry where t1.c2 * 2 = qry.sum and t1.c2 < 3 and t1."C_1" < 100 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Sort Output: t1.c2, qry.sum Sort Key: t1.c2 @@ -4816,8 +4747,7 @@ select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum fro Output: t1.c2, qry.sum -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1", t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: ((t1.c2 < 3) AND (t1."C_1" < 100)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 3)) AND (("C_1" < 100)) -> Subquery Scan on qry Output: qry.sum, t2.c1 Filter: ((t1.c2 * 2) = qry.sum) @@ -4829,8 +4759,8 @@ select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum fro Sort Key: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(21 rows) + Remote SQL: SELECT "C_1" FROM public."T1" +(20 rows) --Testcase 333: select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum from ft2 t2 group by t2.c1) qry where t1.c2 * 2 = qry.sum and t1.c2 < 3 and t1."C_1" < 100 order by 1; @@ -4867,19 +4797,16 @@ ORDER BY ref_0."C_1"; Output: ref_0.c2, ref_0."C_1", ref_1.c3, (ref_0.c2) -> Foreign Scan on "S 1"."T1" ref_0 Output: ref_0."C_1", ref_0.c2, ref_0.c3, ref_0.c4, ref_0.c5, ref_0.c6, ref_0.c7, ref_0.c8 - Filter: (ref_0."C_1" < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 10)) -> Foreign Scan on public.ft1 ref_1 Output: ref_1.c3, ref_0.c2 - Filter: (ref_1.c3 = '00001'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c3 FROM public."T1" WHERE ((c3 = '00001')) -> Materialize Output: ref_3.c3 -> Foreign Scan on public.ft2 ref_3 Output: ref_3.c3 - Filter: (ref_3.c3 = '00001'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(21 rows) + Remote SQL: SELECT c3 FROM public."T1" WHERE ((c3 = '00001')) +(18 rows) --Testcase 336: SELECT ref_0.c2, subq_1.* @@ -4910,8 +4837,8 @@ ORDER BY ref_0."C_1"; --Testcase 337: explain (verbose, costs off) select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2.c1) from ft1 right join ft2 on (ft1.c1 = ft2.c1)) q(a, b, c) on (ft4.c1 <= q.b); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Aggregate Output: sum(q.a), count(q.b) -> Nested Loop Left Join @@ -4920,7 +4847,7 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. Join Filter: ((ft4.c1)::numeric <= q.b) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Materialize Output: q.a, q.b -> Subquery Scan on q @@ -4932,12 +4859,12 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. Hash Cond: (ft2.c1 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (26 rows) --Testcase 338: @@ -4952,8 +4879,8 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. --Testcase 339: explain (verbose, costs off) select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: c2, (sum(c1)) Sort Key: ft1.c2 @@ -4963,9 +4890,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls la Group Key: () -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 3)) +(10 rows) --Testcase 340: select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last; @@ -4980,8 +4906,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls la --Testcase 341: explain (verbose, costs off) select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: c2, (sum(c1)) Sort Key: ft1.c2 @@ -4991,9 +4917,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last Group Key: () -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 3)) +(10 rows) --Testcase 342: select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last; @@ -5008,8 +4933,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last --Testcase 343: explain (verbose, costs off) select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Sort Output: c2, c6, (sum(c1)) Sort Key: ft1.c2, ft1.c6 @@ -5019,9 +4944,8 @@ select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) orde Hash Key: ft1.c6 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2, c6 FROM public."T1" WHERE ((c2 < 3)) +(10 rows) --Testcase 344: select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last; @@ -5038,8 +4962,8 @@ select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) orde --Testcase 345: explain (verbose, costs off) select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: c2, (sum(c1)), (GROUPING(c2)) Sort Key: ft1.c2 @@ -5048,9 +4972,8 @@ select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nu Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 3)) +(9 rows) --Testcase 346: select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last; @@ -5065,8 +4988,8 @@ select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nu --Testcase 347: explain (verbose, costs off) select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Unique Output: ((sum(c1) / 1000)), c2 -> Sort @@ -5077,9 +5000,8 @@ select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft2.c2 < 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(12 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 6)) +(11 rows) --Testcase 348: select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; @@ -5093,8 +5015,8 @@ select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; --Testcase 349: explain (verbose, costs off) select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Sort Output: c2, (sum(c2)), (count(c2) OVER (?)), ((c2 % 2)) Sort Key: ft2.c2 @@ -5108,9 +5030,8 @@ select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 gr Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft2.c2 < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(15 rows) + Remote SQL: SELECT c2 FROM public."T1" WHERE ((c2 < 10)) +(14 rows) --Testcase 350: select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1; @@ -5131,8 +5052,8 @@ select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 gr --Testcase 351: explain (verbose, costs off) select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Sort Output: c2, (array_agg(c2) OVER (?)), ((c2 % 2)) Sort Key: ft1.c2 @@ -5146,9 +5067,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 wher Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(15 rows) + Remote SQL: SELECT c2 FROM public."T1" WHERE ((c2 < 10)) +(14 rows) --Testcase 352: select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1; @@ -5169,8 +5089,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 wher --Testcase 353: explain (verbose, costs off) select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Sort Output: c2, (array_agg(c2) OVER (?)), ((c2 % 2)) Sort Key: ft1.c2 @@ -5184,9 +5104,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 range between curre Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(15 rows) + Remote SQL: SELECT c2 FROM public."T1" WHERE ((c2 < 10)) +(14 rows) --Testcase 354: select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1; @@ -5212,21 +5131,19 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 range between curre PREPARE st1(int, int) AS SELECT t1.c3, t2.c3 FROM ft1 t1, ft2 t2 WHERE t1.c1 = $1 AND t2.c1 = $2; --Testcase 356: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st1(1, 2); - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------- Nested Loop Output: t1.c3, t2.c3 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c3 FROM public."T1" WHERE (("C_1" = 1)) -> Materialize Output: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: (t2.c1 = 2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(12 rows) + Remote SQL: SELECT c3 FROM public."T1" WHERE (("C_1" = 2)) +(10 rows) --Testcase 357: EXECUTE st1(1, 1); @@ -5247,8 +5164,8 @@ EXECUTE st1(101, 101); PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c4) = '1970-01-17'::date) ORDER BY c1; --Testcase 360: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Sort Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 Sort Key: t1.c1 @@ -5258,8 +5175,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); Hash Cond: (t1.c3 = t2.c3) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 < 20) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" < 20)) -> Hash Output: t2.c3 -> HashAggregate @@ -5267,9 +5183,8 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); Group Key: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: ((t2.c1 > 10) AND (date(t2.c4) = '01-17-1970'::date)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(20 rows) + Remote SQL: SELECT c3 FROM public."T1" WHERE (("C_1" > 10)) AND ((date(c4) = '1970-01-17')) +(18 rows) --Testcase 361: EXECUTE st2(10, 20); @@ -5290,8 +5205,8 @@ EXECUTE st2(101, 121); PREPARE st3(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c5) = '1970-01-17'::date) ORDER BY c1; --Testcase 364: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Sort Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 Sort Key: t1.c1 @@ -5301,8 +5216,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); Hash Cond: (t1.c3 = t2.c3) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 < 20) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" < 20)) -> Hash Output: t2.c3 -> HashAggregate @@ -5310,9 +5224,8 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); Group Key: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: ((t2.c1 > 10) AND (date(t2.c5) = '01-17-1970'::date)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(20 rows) + Remote SQL: SELECT c3 FROM public."T1" WHERE (("C_1" > 10)) AND ((date(c5) = '1970-01-17')) +(18 rows) --Testcase 365: EXECUTE st3(10, 20); @@ -5332,63 +5245,58 @@ EXECUTE st3(20, 30); PREPARE st4(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 = $1; --Testcase 368: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 369: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 370: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 371: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 372: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) -- once we try it enough times, should switch to generic plan --Testcase 373: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = $1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) -- value of $1 should not be sent to remote @@ -5396,62 +5304,57 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); PREPARE st5(text,int) AS SELECT * FROM ft1 t1 WHERE c8 = $1 and c1 = $2; --Testcase 375: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 376: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 377: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 378: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 379: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 380: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c8 = $1) AND (t1.c1 = $2)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 381: @@ -5466,13 +5369,12 @@ EXECUTE st5('foo', 1); PREPARE st6 AS SELECT * FROM ft1 t1 WHERE t1.c1 = t1.c2; --Testcase 383: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = c2)) +(3 rows) --Testcase 384: PREPARE st7 AS INSERT INTO ft1 (c1,c2,c3) VALUES (1001,101,'foo'); @@ -5481,7 +5383,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft1 - Remote SQL: INSERT INTO "public"."T1"("C_1", "c2", "c3", "c4", "c5", "c6", "c7", "c8") VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO public."T1"("C_1", c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1001, 101, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::text (4 rows) @@ -5490,13 +5392,12 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; -- ALTER FOREIGN TABLE ft1 OPTIONS (SET table 'T 0'); --Testcase 386: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = c2)) +(3 rows) --Testcase 387: EXECUTE st6; @@ -5518,7 +5419,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft1 - Remote SQL: INSERT INTO "public"."T1"("C_1", "c2", "c3", "c4", "c5", "c6", "c7", "c8") VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO public."T1"("C_1", c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1001, 101, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::text (4 rows) @@ -5529,28 +5430,28 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; PREPARE st8 AS SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 390: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 391: -- ALTER SERVER :DB_SERVERNAME OPTIONS (DROP extensions); --Testcase 392: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 393: @@ -5575,14 +5476,14 @@ DEALLOCATE st8; --Testcase 395: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.tableoid = 'pg_class'::regclass LIMIT 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.tableoid = '1259'::oid) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (6 rows) --Testcase 396: @@ -5595,13 +5496,13 @@ SELECT * FROM ft1 t1 WHERE t1.tableoid = 'ft1'::regclass LIMIT 1; --Testcase 397: EXPLAIN (VERBOSE, COSTS OFF) SELECT tableoid::regclass, * FROM ft1 t1 LIMIT 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Limit Output: ((tableoid)::regclass), c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: (tableoid)::regclass, c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (5 rows) --Testcase 398: @@ -5614,12 +5515,12 @@ SELECT tableoid::regclass, * FROM ft1 t1 LIMIT 1; --Testcase 399: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.ctid = '(0,2)'; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.ctid = '(0,2)'::tid) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 400: @@ -5632,13 +5533,13 @@ SELECT * FROM ft1 t1 WHERE t1.ctid = '(0,2)'; --Testcase 401: EXPLAIN (VERBOSE, COSTS OFF) SELECT ctid, * FROM ft1 t1 LIMIT 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Limit Output: ctid, c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: ctid, c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (5 rows) --Testcase 402: @@ -5719,118 +5620,113 @@ create foreign table ft3 (f1 text collate "C", f2 text, f3 varchar(10)) -- can be sent to remote --Testcase 415: explain (verbose, costs off) select * from ft3 where f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f1 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo')) +(3 rows) --Testcase 416: explain (verbose, costs off) select * from ft3 where f1 COLLATE "C" = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f1 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo')) +(3 rows) --Testcase 417: explain (verbose, costs off) select * from ft3 where f2 = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f2 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f2 = 'foo')) +(3 rows) --Testcase 418: explain (verbose, costs off) select * from ft3 where f3 = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f3)::text = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 419: explain (verbose, costs off) select * from ft3 f, ft3 l where f.f3 = l.f3 and l.f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Nested Loop Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3 Join Filter: ((f.f3)::text = (l.f3)::text) -> Foreign Scan on public.ft3 f Output: f.f1, f.f2, f.f3 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 -> Foreign Scan on public.ft3 l Output: l.f1, l.f2, l.f3 - Filter: (l.f1 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(10 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo')) +(9 rows) -- can't be sent to remote --Testcase 420: explain (verbose, costs off) select * from ft3 where f1 COLLATE "POSIX" = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f1)::text = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 421: explain (verbose, costs off) select * from ft3 where f1 = 'foo' COLLATE "C"; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: (ft3.f1 = 'foo'::text COLLATE "C") - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 422: explain (verbose, costs off) select * from ft3 where f2 COLLATE "C" = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f2)::text = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 423: explain (verbose, costs off) select * from ft3 where f2 = 'foo' COLLATE "C"; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: (ft3.f2 = 'foo'::text COLLATE "C") - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 424: explain (verbose, costs off) select * from ft3 f, ft3 l where f.f3 = l.f3 COLLATE "POSIX" and l.f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Nested Loop Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3 Join Filter: ((f.f3)::text = (l.f3)::text) -> Foreign Scan on public.ft3 f Output: f.f1, f.f2, f.f3 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 -> Foreign Scan on public.ft3 l Output: l.f1, l.f2, l.f3 - Filter: (l.f1 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(10 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo')) +(9 rows) -- =================================================================== -- test writable foreign table stuff @@ -5841,14 +5737,14 @@ INSERT INTO ft2 (c1,c2,c3) SELECT c1+1000,c2+100, c3 || c3 FROM ft2 LIMIT 20; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft2 - Remote SQL: INSERT INTO "public"."T1"("C_1", "c2", "c3", "c4", "c5", "c6", "c7", "c8") VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO public."T1"("C_1", c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Subquery Scan on "*SELECT*" Output: "*SELECT*"."?column?", "*SELECT*"."?column?_1", "*SELECT*"."?column?_2", NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::text -> Limit Output: ((ft2_1.c1 + 1000)), ((ft2_1.c2 + 100)), ((ft2_1.c3 || ft2_1.c3)) -> Foreign Scan on public.ft2 ft2_1 Output: (ft2_1.c1 + 1000), (ft2_1.c2 + 100), (ft2_1.c3 || ft2_1.c3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (9 rows) --Testcase 426: @@ -5869,30 +5765,28 @@ INSERT INTO ft2 (c1,c2,c3) VALUES (1104,204,'ddd'), (1105,205,'eee'); --Testcase 429: EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c2" = ?, "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ?, c3 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: c1, (c2 + 300), (c3 || '_update3'::text), c4, c5, c6, c7, c8, c1 - Filter: ((ft2.c1 % 10) = 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((("C_1" % 10) = 3)) +(5 rows) --Testcase 430: UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3; --Testcase 431: EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c2" = ?, "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ?, c3 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: c1, (c2 + 400), (c3 || '_update7'::text), c4, c5, c6, c7, c8, c1 - Filter: ((ft2.c1 % 10) = 7) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((("C_1" % 10) = 7)) +(5 rows) --Testcase 432: UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7; @@ -6010,20 +5904,19 @@ UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c2" = ?, "c3" = ?, "c7" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ?, c3 = ?, c7 = ? WHERE "C_1" = ? -> Hash Join Output: ft2.c1, (ft2.c2 + 500), (ft2.c3 || '_update9'::text), ft2.c4, ft2.c5, ft2.c6, 'ft2 '::character(10), ft2.c8, ft2.c1, ft1.* Hash Cond: (ft2.c2 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c8 FROM public."T1" -> Hash Output: ft1.*, ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.*, ft1.c1 - Filter: ((ft1.c1 % 10) = 9) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((("C_1" % 10) = 9)) +(13 rows) --Testcase 434: UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT @@ -6031,15 +5924,14 @@ UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT --Testcase 435: EXPLAIN (verbose, costs off) DELETE FROM ft2 WHERE c1 % 10 = 5; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: c1 - Filter: ((ft2.c1 % 10) = 5) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1" FROM public."T1" WHERE ((("C_1" % 10) = 5)) +(5 rows) --Testcase 436: SELECT c1, c4 FROM ft2 WHERE c1 % 10 = 5; @@ -6154,23 +6046,22 @@ DELETE FROM ft2 WHERE c1 % 10 = 5; --Testcase 437: EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Hash Join Output: ft2.c1, ft1.* Hash Cond: (ft2.c2 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: ft1.*, ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.*, ft1.c1 - Filter: ((ft1.c1 % 10) = 2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((("C_1" % 10) = 2)) +(13 rows) --Testcase 438: DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2; @@ -7005,7 +6896,7 @@ INSERT INTO ft2 (c1,c2,c3) VALUES (1200,999,'foo'); QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft2 - Remote SQL: INSERT INTO "public"."T1"("C_1", "c2", "c3", "c4", "c5", "c6", "c7", "c8") VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO public."T1"("C_1", c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1200, 999, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::text (4 rows) @@ -7021,15 +6912,14 @@ SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; --Testcase 442: EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'bar' WHERE c1 = 1200; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c3 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: c1, c2, 'bar'::text, c4, c5, c6, c7, c8, c1 - Filter: (ft2.c1 = 1200) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1200)) +(5 rows) --Testcase 443: UPDATE ft2 SET c3 = 'bar' WHERE c1 = 1200; @@ -7042,15 +6932,14 @@ SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; --Testcase 444: EXPLAIN (verbose, costs off) DELETE FROM ft2 WHERE c1 = 1200; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: c1 - Filter: (ft2.c1 = 1200) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" = 1200)) +(5 rows) --Testcase 445: SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; @@ -7072,14 +6961,13 @@ UPDATE ft2 SET c3 = 'foo' QUERY PLAN ----------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c3 = ? WHERE "C_1" = ? -> Hash Join Output: ft2.c1, ft2.c2, 'foo'::text, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: (ft2.c1 > 1200) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" > 1200)) -> Hash Output: ft4.*, ft4.c1, ft5.*, ft5.c1 -> Hash Join @@ -7087,13 +6975,13 @@ UPDATE ft2 SET c3 = 'foo' Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(21 rows) --Testcase 448: UPDATE ft2 SET c3 = 'foo' @@ -7125,17 +7013,16 @@ EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft4 LEFT JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 1200 AND ft2.c1 % 10 = 0 AND ft2.c2 = ft4.c1; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Hash Join Output: ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: ((ft2.c1 > 1200) AND ((ft2.c1 % 10) = 0)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" > 1200)) AND ((("C_1" % 10) = 0)) -> Hash Output: ft4.*, ft4.c1, ft5.* -> Hash Left Join @@ -7143,13 +7030,13 @@ DELETE FROM ft2 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(21 rows) --Testcase 450: DELETE FROM ft2 @@ -7169,17 +7056,16 @@ UPDATE ft2 AS target SET (c2, c7) = ( QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------- Update on public.ft2 target - Remote SQL: UPDATE "public"."T1" SET "c2" = ?, "c7" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ?, c7 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 target Output: target.c1, $1, target.c3, target.c4, target.c5, target.c6, $2, target.c8, (SubPlan 1 (returns $1,$2)), target.c1 - Filter: (target.c1 > 1100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3, c4, c5, c6, c8 FROM public."T1" WHERE (("C_1" > 1100)) SubPlan 1 (returns $1,$2) -> Foreign Scan on public.ft2 src Output: (src.c2 * 10), src.c7 Filter: (target.c1 = src.c1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2, c7 FROM public."T1" +(10 rows) --Testcase 453: UPDATE ft2 AS target SET (c2, c7) = ( @@ -7203,14 +7089,14 @@ INSERT INTO ft2 (c1,c2,c3) --Testcase 457: EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'bar' WHERE postgres_fdw_abs(c1) > 2000; -- can't be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c3 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: c1, c2, 'bar'::text, c4, c5, c6, c7, c8, c1 Filter: (postgres_fdw_abs(ft2.c1) > 2000) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c4, c5, c6, c7, c8 FROM public."T1" (6 rows) --Testcase 458: @@ -7238,14 +7124,13 @@ UPDATE ft2 SET c3 = 'baz' QUERY PLAN ----------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c3 = ? WHERE "C_1" = ? -> Nested Loop Output: ft2.c1, ft2.c2, 'baz'::text, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.c1, ft4.*, ft5.* Join Filter: (ft2.c2 === ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: (ft2.c1 > 2000) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" > 2000)) -> Materialize Output: ft4.*, ft4.c1, ft5.* -> Hash Join @@ -7253,13 +7138,13 @@ UPDATE ft2 SET c3 = 'baz' Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(21 rows) --Testcase 460: UPDATE ft2 SET c3 = 'baz' @@ -7277,17 +7162,16 @@ EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft4 INNER JOIN ft5 ON (ft4.c1 === ft5.c1) WHERE ft2.c1 > 2000 AND ft2.c2 = ft4.c1; -- can't be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Hash Join Output: ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: (ft2.c1 > 2000) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" > 2000)) -> Hash Output: ft4.*, ft4.c1, ft5.* -> Nested Loop @@ -7295,13 +7179,13 @@ DELETE FROM ft2 Join Filter: (ft4.c1 === ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Materialize Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(21 rows) --Testcase 462: DELETE FROM ft2 @@ -7735,8 +7619,8 @@ select c2, count(*) from "S 1"."T1" where c2 < 500 group by 1 order by 1; -- ORDER BY DESC NULLS LAST options --Testcase 495: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 OFFSET 795 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7744,7 +7628,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 O Sort Key: ft1.c6 DESC NULLS LAST, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 496: @@ -7766,8 +7650,8 @@ SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 OFFSET 795 LIMIT 10; -- ORDER BY DESC NULLS FIRST options --Testcase 497: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 OFFSET 15 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7775,7 +7659,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 Sort Key: ft1.c6 DESC, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 498: @@ -7797,8 +7681,8 @@ SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 OFFSET 15 LIMIT 10; -- ORDER BY ASC NULLS FIRST options --Testcase 499: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 OFFSET 15 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7806,7 +7690,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 O Sort Key: ft1.c6 NULLS FIRST, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 500: @@ -7833,15 +7717,12 @@ SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 OFFSET 15 LIMIT 10; ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2positive CHECK (c2 >= 0); --Testcase 502: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 < 0; - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: count(*) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 0) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + QUERY PLAN +----------------------------------------------------------------- + Foreign Scan + Output: (count(*)) + Remote SQL: SELECT count(*) FROM public."T1" WHERE ((c2 < 0)) +(3 rows) --Testcase 503: SELECT count(*) FROM ft1 WHERE c2 < 0; @@ -7883,15 +7764,12 @@ ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c2positive; ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2negative CHECK (c2 < 0); --Testcase 512: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 >= 0; - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: count(*) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 >= 0) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + QUERY PLAN +------------------------------------------------------------------ + Foreign Scan + Output: (count(*)) + Remote SQL: SELECT count(*) FROM public."T1" WHERE ((c2 >= 0)) +(3 rows) --Testcase 513: SELECT count(*) FROM ft1 WHERE c2 >= 0; @@ -7956,10 +7834,10 @@ Options: check_option=cascaded --Testcase 524: EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view VALUES (0, 5); - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------- Insert on public.foreign_tbl - Remote SQL: INSERT INTO "public"."base_tbl"("a", "b") VALUES (?, ?) + Remote SQL: INSERT INTO public.base_tbl(a, b) VALUES (?, ?) -> Result Output: 0, 5 (4 rows) @@ -7973,10 +7851,10 @@ DETAIL: Failing row contains (10, 5). --Testcase 526: EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view VALUES (0, 15); - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------- Insert on public.foreign_tbl - Remote SQL: INSERT INTO "public"."base_tbl"("a", "b") VALUES (?, ?) + Remote SQL: INSERT INTO public.base_tbl(a, b) VALUES (?, ?) -> Result Output: 0, 15 (4 rows) @@ -7997,12 +7875,11 @@ UPDATE rw_view SET b = b + 5; QUERY PLAN ---------------------------------------------------------------------------------- Update on public.foreign_tbl - Remote SQL: UPDATE "public"."base_tbl" SET "a" = ?, "b" = ? WHERE "a" = ? + Remote SQL: UPDATE public.base_tbl SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.foreign_tbl Output: foreign_tbl.a, (foreign_tbl.b + 5), foreign_tbl.a, foreign_tbl.* - Filter: (foreign_tbl.a < foreign_tbl.b) - Remote SQL: SELECT "a","b" FROM "public"."base_tbl" -(6 rows) + Remote SQL: SELECT a, b FROM public.base_tbl WHERE ((a < b)) +(5 rows) --Testcase 530: UPDATE rw_view SET b = b + 5; -- should fail @@ -8012,12 +7889,11 @@ UPDATE rw_view SET b = b + 15; QUERY PLAN ----------------------------------------------------------------------------------- Update on public.foreign_tbl - Remote SQL: UPDATE "public"."base_tbl" SET "a" = ?, "b" = ? WHERE "a" = ? + Remote SQL: UPDATE public.base_tbl SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.foreign_tbl Output: foreign_tbl.a, (foreign_tbl.b + 15), foreign_tbl.a, foreign_tbl.* - Filter: (foreign_tbl.a < foreign_tbl.b) - Remote SQL: SELECT "a","b" FROM "public"."base_tbl" -(6 rows) + Remote SQL: SELECT a, b FROM public.base_tbl WHERE ((a < b)) +(5 rows) --Testcase 532: UPDATE rw_view SET b = b + 15; -- ok @@ -8101,12 +7977,11 @@ UPDATE rw_view SET b = b + 5; ---------------------------------------------------------------------------------------- Update on public.parent_tbl Foreign Update on public.foreign_tbl parent_tbl_1 - Remote SQL: UPDATE "public"."child_tbl" SET "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.child_tbl SET b = ? WHERE id = ? -> Foreign Scan on public.foreign_tbl parent_tbl_1 Output: parent_tbl_1.a, (parent_tbl_1.b + 5), parent_tbl_1.id, parent_tbl_1.id - Filter: (parent_tbl_1.a < parent_tbl_1.b) - Remote SQL: SELECT "a","b","id" FROM "public"."child_tbl" -(7 rows) + Remote SQL: SELECT a, b, id FROM public.child_tbl WHERE ((a < b)) +(6 rows) --Testcase 546: UPDATE rw_view SET b = b + 5; -- should fail @@ -8117,12 +7992,11 @@ UPDATE rw_view SET b = b + 15; ----------------------------------------------------------------------------------------- Update on public.parent_tbl Foreign Update on public.foreign_tbl parent_tbl_1 - Remote SQL: UPDATE "public"."child_tbl" SET "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.child_tbl SET b = ? WHERE id = ? -> Foreign Scan on public.foreign_tbl parent_tbl_1 Output: parent_tbl_1.a, (parent_tbl_1.b + 15), parent_tbl_1.id, parent_tbl_1.id - Filter: (parent_tbl_1.a < parent_tbl_1.b) - Remote SQL: SELECT "a","b","id" FROM "public"."child_tbl" -(7 rows) + Remote SQL: SELECT a, b, id FROM public.child_tbl WHERE ((a < b)) +(6 rows) --Testcase 548: UPDATE rw_view SET b = b + 15; -- ok @@ -8473,13 +8347,13 @@ SELECT f1, f2 from loc1; --Testcase 609: EXPLAIN (verbose, costs off) UPDATE rem1 set f1 = 10; -- all columns should be transmitted - QUERY PLAN ----------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f1" = ?, "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f1 = ?, f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: 10, f2, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 610: @@ -8638,25 +8512,25 @@ CREATE TRIGGER trig_stmt_before --Testcase 646: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 647: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 648: @@ -8668,25 +8542,25 @@ CREATE TRIGGER trig_stmt_after --Testcase 650: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 651: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 652: @@ -8699,25 +8573,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 654: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 655: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 656: @@ -8729,25 +8603,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 658: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 659: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 660: @@ -8760,25 +8634,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 662: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can't be pushed down - QUERY PLAN ----------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f1" = ?, "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f1 = ?, f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 663: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 664: @@ -8790,25 +8664,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 666: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 667: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 668: @@ -8821,25 +8695,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 670: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 671: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 672: @@ -8851,25 +8725,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 674: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, ''::text, f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 675: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 676: @@ -9096,7 +8970,7 @@ select * from bar where f1 in (select f1 from foo) for update; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -9104,7 +8978,7 @@ select * from bar where f1 in (select f1 from foo) for update; Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 (19 rows) --Testcase 723: @@ -9132,7 +9006,7 @@ select * from bar where f1 in (select f1 from foo) for share; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -9140,7 +9014,7 @@ select * from bar where f1 in (select f1 from foo) for share; Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 (19 rows) --Testcase 725: @@ -9162,7 +9036,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Update on public.bar Update on public.bar Foreign Update on public.bar2 bar_1 - Remote SQL: UPDATE "public"."loct2" SET "f2" = ? WHERE "f3" = ? + Remote SQL: UPDATE public.loct2 SET f2 = ? WHERE f3 = ? -> Hash Semi Join Output: bar.f1, (bar.f2 + 100), bar.ctid, foo.ctid, foo.*, foo.tableoid Hash Cond: (bar.f1 = foo.f1) @@ -9175,13 +9049,13 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 -> Hash Semi Join Output: bar_1.f1, (bar_1.f2 + 100), bar_1.f3, bar_1.f3, foo.ctid, foo.*, foo.tableoid Hash Cond: (bar_1.f1 = foo.f1) -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f1, bar_1.f2, bar_1.f3 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -9189,7 +9063,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 (31 rows) --Testcase 727: @@ -9218,7 +9092,7 @@ where bar.f1 = ss.f1; Update on public.bar Update on public.bar Foreign Update on public.bar2 bar_1 - Remote SQL: UPDATE "public"."loct2" SET "f2" = ? WHERE "f3" = ? + Remote SQL: UPDATE public.loct2 SET f2 = ? WHERE f3 = ? -> Hash Join Output: bar.f1, (bar.f2 + 100), bar.ctid, (ROW(foo.f1)) Hash Cond: (foo.f1 = bar.f1) @@ -9227,12 +9101,12 @@ where bar.f1 = ss.f1; Output: ROW(foo.f1), foo.f1 -> Foreign Scan on public.foo2 foo_1 Output: ROW(foo_1.f1), foo_1.f1 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 -> Seq Scan on public.foo foo_2 Output: ROW((foo_2.f1 + 3)), (foo_2.f1 + 3) -> Foreign Scan on public.foo2 foo_3 Output: ROW((foo_3.f1 + 3)), (foo_3.f1 + 3) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 -> Hash Output: bar.f1, bar.f2, bar.ctid -> Seq Scan on public.bar @@ -9245,17 +9119,17 @@ where bar.f1 = ss.f1; Output: ROW(foo.f1), foo.f1 -> Foreign Scan on public.foo2 foo_1 Output: ROW(foo_1.f1), foo_1.f1 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 -> Seq Scan on public.foo foo_2 Output: ROW((foo_2.f1 + 3)), (foo_2.f1 + 3) -> Foreign Scan on public.foo2 foo_3 Output: ROW((foo_3.f1 + 3)), (foo_3.f1 + 3) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 -> Hash Output: bar_1.f1, bar_1.f2, bar_1.f3 -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f1, bar_1.f2, bar_1.f3 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 (41 rows) --Testcase 730: @@ -9301,8 +9175,8 @@ analyze foo; --Testcase 739: explain (verbose, costs off) select foo.f1, foo2.f1 from foo join foo2 on (foo.f1 = foo2.f1) order by foo.f2 offset 10 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: foo.f1, foo2.f1, foo.f2 -> Sort @@ -9320,13 +9194,13 @@ explain (verbose, costs off) Sort Key: foo_2.f1 -> Foreign Scan on public.foo2 foo_2 Output: foo_2.f1, foo_2.f2 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2 FROM public.loct1 -> Sort Output: foo2.f1 Sort Key: foo2.f1 -> Foreign Scan on public.foo2 Output: foo2.f1 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 (24 rows) --Testcase 740: @@ -9350,8 +9224,8 @@ select foo.f1, foo2.f1 from foo join foo2 on (foo.f1 = foo2.f1) order by foo.f2 --Testcase 741: explain (verbose, costs off) select foo.f1, foo2.f1 from foo left join foo2 on (foo.f1 = foo2.f1) order by foo.f2 offset 10 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: foo.f1, foo2.f1, foo.f2 -> Sort @@ -9369,13 +9243,13 @@ explain (verbose, costs off) Sort Key: foo_2.f1 -> Foreign Scan on public.foo2 foo_2 Output: foo_2.f1, foo_2.f2 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2 FROM public.loct1 -> Sort Output: foo2.f1 Sort Key: foo2.f1 -> Foreign Scan on public.foo2 Output: foo2.f1 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 (24 rows) --Testcase 742: @@ -9407,37 +9281,36 @@ RESET enable_nestloop; --Testcase 745: explain (verbose, costs off) delete from foo where f1 < 5; - QUERY PLAN ------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Delete on public.foo Delete on public.foo Foreign Delete on public.foo2 foo_1 - Remote SQL: DELETE FROM "public"."loct1" WHERE "f3" = ? + Remote SQL: DELETE FROM public.loct1 WHERE f3 = ? -> Index Scan using i_foo_f1 on public.foo Output: foo.ctid Index Cond: (foo.f1 < 5) -> Foreign Scan on public.foo2 foo_1 Output: foo_1.f3 - Filter: (foo_1.f1 < 5) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" -(11 rows) + Remote SQL: SELECT f3 FROM public.loct1 WHERE ((f1 < 5)) +(10 rows) --Testcase 746: delete from foo where f1 < 5; --Testcase 747: explain (verbose, costs off) update bar set f2 = f2 + 100; - QUERY PLAN ---------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------- Update on public.bar Update on public.bar Foreign Update on public.bar2 bar_1 - Remote SQL: UPDATE "public"."loct2" SET "f2" = ? WHERE "f3" = ? + Remote SQL: UPDATE public.loct2 SET f2 = ? WHERE f3 = ? -> Seq Scan on public.bar Output: bar.f1, (bar.f2 + 100), bar.ctid -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f1, (bar_1.f2 + 100), bar_1.f3, bar_1.f3 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 (9 rows) --Testcase 748: @@ -9454,17 +9327,17 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 751: explain (verbose, costs off) update bar set f2 = f2 + 100; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------- Update on public.bar Update on public.bar Foreign Update on public.bar2 bar_1 - Remote SQL: UPDATE "public"."loct2" SET "f1" = ?, "f2" = ?, "f3" = ? WHERE "f3" = ? + Remote SQL: UPDATE public.loct2 SET f1 = ?, f2 = ?, f3 = ? WHERE f3 = ? -> Seq Scan on public.bar Output: bar.f1, (bar.f2 + 100), bar.ctid -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f1, (bar_1.f2 + 100), bar_1.f3, bar_1.f3, bar_1.* - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 (9 rows) --Testcase 752: @@ -9484,20 +9357,19 @@ psql:sql/13.4/ported_postgres_fdw.sql:2635: NOTICE: OLD: (7,277,77),NEW: (7,377 --Testcase 753: explain (verbose, costs off) delete from bar where f2 < 400; - QUERY PLAN ------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Delete on public.bar Delete on public.bar Foreign Delete on public.bar2 bar_1 - Remote SQL: DELETE FROM "public"."loct2" WHERE "f3" = ? + Remote SQL: DELETE FROM public.loct2 WHERE f3 = ? -> Seq Scan on public.bar Output: bar.ctid Filter: (bar.f2 < 400) -> Foreign Scan on public.bar2 bar_1 Output: bar_1.f3, bar_1.* - Filter: (bar_1.f2 < 400) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" -(11 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 WHERE ((f2 < 400)) +(10 rows) --Testcase 754: delete from bar where f2 < 400; @@ -9549,7 +9421,7 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; Update on public.parent Update on public.parent Foreign Update on public.remt1 parent_1 - Remote SQL: UPDATE "public"."loct1_2" SET "b" = ? WHERE "a" = ? + Remote SQL: UPDATE public.loct1_2 SET b = ? WHERE a = ? -> Nested Loop Output: parent.a, (parent.b || remt2.b), parent.ctid, remt2.* Join Filter: (parent.a = remt2.a) @@ -9557,18 +9429,18 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; Output: parent.a, parent.b, parent.ctid -> Foreign Scan on public.remt2 Output: remt2.b, remt2.*, remt2.a - Remote SQL: SELECT "a","b" FROM "public"."loct2_2" + Remote SQL: SELECT a, b FROM public.loct2_2 -> Nested Loop Output: parent_1.a, (parent_1.b || remt2.b), parent_1.a, remt2.* Join Filter: (parent_1.a = remt2.a) -> Foreign Scan on public.remt1 parent_1 Output: parent_1.a, parent_1.b - Remote SQL: SELECT "a","b" FROM "public"."loct1_2" + Remote SQL: SELECT a, b FROM public.loct1_2 -> Materialize Output: remt2.b, remt2.*, remt2.a -> Foreign Scan on public.remt2 Output: remt2.b, remt2.*, remt2.a - Remote SQL: SELECT "a","b" FROM "public"."loct2_2" + Remote SQL: SELECT a, b FROM public.loct2_2 (23 rows) --Testcase 768: @@ -9576,12 +9448,12 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; --Testcase 769: explain (verbose, costs off) delete from parent using remt2 where parent.a = remt2.a; - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Delete on public.parent Delete on public.parent Foreign Delete on public.remt1 parent_1 - Remote SQL: DELETE FROM "public"."loct1_2" WHERE "a" = ? + Remote SQL: DELETE FROM public.loct1_2 WHERE a = ? -> Nested Loop Output: parent.ctid, remt2.* Join Filter: (parent.a = remt2.a) @@ -9589,18 +9461,18 @@ delete from parent using remt2 where parent.a = remt2.a; Output: parent.ctid, parent.a -> Foreign Scan on public.remt2 Output: remt2.*, remt2.a - Remote SQL: SELECT "a","b" FROM "public"."loct2_2" + Remote SQL: SELECT a, b FROM public.loct2_2 -> Nested Loop Output: parent_1.a, remt2.* Join Filter: (parent_1.a = remt2.a) -> Foreign Scan on public.remt1 parent_1 Output: parent_1.a, parent_1.b - Remote SQL: SELECT "a","b" FROM "public"."loct1_2" + Remote SQL: SELECT a FROM public.loct1_2 -> Materialize Output: remt2.*, remt2.a -> Foreign Scan on public.remt2 Output: remt2.*, remt2.a - Remote SQL: SELECT "a","b" FROM "public"."loct2_2" + Remote SQL: SELECT a, b FROM public.loct2_2 (23 rows) --Testcase 770: @@ -9811,20 +9683,19 @@ insert into utrtest values (2, 'qux'); --Testcase 828: explain (verbose, costs off) update utrtest set a = 1 where a = 1 or a = 2; - QUERY PLAN ---------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Foreign Scan on public.remp utrtest_1 Output: 1, utrtest_1.b, utrtest_1.id, utrtest_1.id - Filter: ((utrtest_1.a = 1) OR (utrtest_1.a = 2)) - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT b, id FROM public.loct_2 WHERE (((a = 1) OR (a = 2))) -> Seq Scan on public.locp utrtest_2 Output: 1, utrtest_2.b, utrtest_2.id, utrtest_2.ctid Filter: ((utrtest_2.a = 1) OR (utrtest_2.a = 2)) -(11 rows) +(10 rows) -- The new values are concatenated with ' triggered !' --Testcase 829: @@ -9867,15 +9738,15 @@ insert into utrtest values (2, 'qux'); --Testcase 838: explain (verbose, costs off) update utrtest set a = 1; - QUERY PLAN ---------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Foreign Scan on public.remp utrtest_1 Output: 1, utrtest_1.b, utrtest_1.id, utrtest_1.id - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT b, id FROM public.loct_2 -> Seq Scan on public.locp utrtest_2 Output: 1, utrtest_2.b, utrtest_2.id, utrtest_2.ctid (9 rows) @@ -9898,14 +9769,14 @@ update utrtest set a = 1 from (values (1), (2)) s(x) where a = s.x; ------------------------------------------------------------------------------ Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Nested Loop Output: 1, utrtest_1.b, utrtest_1.id, utrtest_1.id, "*VALUES*".* Join Filter: (utrtest_1.a = "*VALUES*".column1) -> Foreign Scan on public.remp utrtest_1 Output: utrtest_1.a, utrtest_1.b, utrtest_1.id - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT a, b, id FROM public.loct_2 -> Values Scan on "*VALUES*" Output: "*VALUES*".*, "*VALUES*".column1 -> Hash Join @@ -9948,17 +9819,17 @@ psql:sql/13.4/ported_postgres_fdw.sql:2931: ERROR: COPY and foreign partition r --Testcase 854: explain (verbose, costs off) update utrtest set a = 3; - QUERY PLAN ---------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Update on public.utrtest Update on public.locp utrtest_1 Foreign Update on public.remp utrtest_2 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? -> Seq Scan on public.locp utrtest_1 Output: 3, utrtest_1.b, utrtest_1.id, utrtest_1.ctid -> Foreign Scan on public.remp utrtest_2 Output: 3, utrtest_2.b, utrtest_2.id, utrtest_2.id - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT b, id FROM public.loct_2 (9 rows) --Testcase 855: @@ -9973,7 +9844,7 @@ update utrtest set a = 3 from (values (2), (3)) s(x) where a = s.x; Update on public.utrtest Update on public.locp utrtest_1 Foreign Update on public.remp utrtest_2 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? -> Hash Join Output: 3, utrtest_1.b, utrtest_1.id, utrtest_1.ctid, "*VALUES*".* Hash Cond: (utrtest_1.a = "*VALUES*".column1) @@ -9988,7 +9859,7 @@ update utrtest set a = 3 from (values (2), (3)) s(x) where a = s.x; Join Filter: (utrtest_2.a = "*VALUES*".column1) -> Foreign Scan on public.remp utrtest_2 Output: utrtest_2.a, utrtest_2.b, utrtest_2.id - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT a, b, id FROM public.loct_2 -> Values Scan on "*VALUES*" Output: "*VALUES*".*, "*VALUES*".column1 (21 rows) diff --git a/expected/13.4/postgresql/select.out b/expected/13.4/postgresql/select.out index 542efa5..553b1b3 100644 --- a/expected/13.4/postgresql/select.out +++ b/expected/13.4/postgresql/select.out @@ -61,17 +61,16 @@ EXPLAIN VERBOSE SELECT * FROM onek WHERE onek.unique1 < 10 ORDER BY onek.unique1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 Sort Key: onek.unique1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 - Filter: (onek.unique1 < 10) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek WHERE ((unique1 < 10)) +(7 rows) --Testcase 8: SELECT * FROM onek @@ -99,17 +98,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using >; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek.unique1 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM public.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 10: SELECT onek.unique1, onek.stringu1 FROM onek @@ -147,17 +145,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 > 980 ORDER BY stringu1 using <; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek.stringu1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM public.onek WHERE ((unique1 > 980)) +(7 rows) SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 > 980 @@ -194,17 +191,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 > 980 ORDER BY string4 using <, unique1 using >; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.string4, onek.unique1 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, string4 FROM public.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 13: SELECT onek.unique1, onek.string4 FROM onek @@ -242,17 +238,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 > 980 ORDER BY string4 using >, unique1 using <; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.string4 DESC, onek.unique1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, string4 FROM public.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 15: SELECT onek.unique1, onek.string4 FROM onek @@ -290,17 +285,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using >, string4 using <; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.unique1 DESC, onek.string4 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, string4 FROM public.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 17: SELECT onek.unique1, onek.string4 FROM onek @@ -339,17 +333,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using <, string4 using >; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.unique1, onek.string4 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, string4 FROM public.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 19: SELECT onek.unique1, onek.string4 FROM onek @@ -399,17 +392,16 @@ SET enable_sort TO off; --Testcase 23: EXPLAIN VERBOSE SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY onek2.unique1; -- add ORDER BY to stablize test result - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 Sort Key: onek2.unique1 -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 - Filter: (onek2.unique1 < 10) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek WHERE ((unique1 < 10)) +(7 rows) --Testcase 24: SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY onek2.unique1; -- add ORDER BY to stablize test result @@ -435,17 +427,16 @@ EXPLAIN VERBOSE SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 < 20 ORDER BY unique1 using >; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek2.unique1 DESC -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek2.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM public.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 26: SELECT onek2.unique1, onek2.stringu1 FROM onek2 @@ -482,17 +473,16 @@ SELECT onek2.unique1, onek2.stringu1 FROM onek2 EXPLAIN VERBOSE SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 > 980 ORDER BY onek2.unique1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek2.unique1 -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek2.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM public.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 28: SELECT onek2.unique1, onek2.stringu1 FROM onek2 @@ -531,12 +521,12 @@ EXPLAIN VERBOSE SELECT two, stringu1, ten, string4 INTO TABLE tmp FROM onek; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=136) Output: two, stringu1, ten, string4 Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" + Remote SQL: SELECT two, ten, stringu1, string4 FROM public.onek (4 rows) --Testcase 33: @@ -558,7 +548,7 @@ select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j) -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4 Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek -> Hash (cost=0.03..0.03 rows=2 width=36) Output: "*VALUES*".column1, "*VALUES*".column2 -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=36) @@ -589,7 +579,7 @@ select * from onek, Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4, $1 Filter: (onek.unique1 = $3) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek InitPlan 2 (returns $1) -> Limit (cost=0.12..0.12 rows=1 width=4) Output: "*VALUES*".column1 @@ -642,7 +632,7 @@ select * from onek -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4 Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek -> Hash (cost=0.05..0.05 rows=4 width=8) Output: "*VALUES*".column1, "*VALUES*".column2 -> Values Scan on "*VALUES*" (cost=0.00..0.05 rows=4 width=8) @@ -685,7 +675,7 @@ SELECT q1, q2 FROM int8_tbl; -> Foreign Scan on public.int8_tbl (cost=25.00..30.00 rows=5 width=16) Output: int8_tbl.q1, int8_tbl.q2 Foreign Table Size: 5 b - Remote SQL: SELECT "q1","q2" FROM "public"."int8_tbl" + Remote SQL: SELECT q1, q2 FROM public.int8_tbl (16 rows) --Testcase 41: @@ -723,7 +713,7 @@ SELECT * FROM foo ORDER BY f1; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 44: @@ -750,7 +740,7 @@ SELECT * FROM foo ORDER BY f1 ASC; -- same thing -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 46: @@ -777,7 +767,7 @@ SELECT * FROM foo ORDER BY f1 NULLS FIRST; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 48: @@ -804,7 +794,7 @@ SELECT * FROM foo ORDER BY f1 DESC; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 50: @@ -831,7 +821,7 @@ SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 52: @@ -854,10 +844,10 @@ SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; --Testcase 53: explain (costs off) select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +--------------------------------------- Foreign Scan on onek2 - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) + Filter: (stringu1 = 'ATAAAA'::name) (2 rows) --Testcase 54: @@ -871,20 +861,19 @@ select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; --Testcase 55: explain (costs off, analyze on, timing off, summary off) select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +----------------------------------------------- Foreign Scan on onek2 (actual rows=1 loops=1) - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) - Rows Removed by Filter: 999 -(3 rows) + Filter: (stringu1 = 'ATAAAA'::name) +(2 rows) --Testcase 56: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +--------------------------------------- Foreign Scan on onek2 - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) + Filter: (stringu1 = 'ATAAAA'::name) (2 rows) --Testcase 57: @@ -898,10 +887,10 @@ select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; --Testcase 58: explain (costs off) select * from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 59: @@ -914,10 +903,10 @@ select * from onek2 where unique2 = 11 and stringu1 < 'B'; --Testcase 60: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 61: @@ -931,11 +920,11 @@ select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; --Testcase 62: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; - QUERY PLAN -------------------------------------------------------------- + QUERY PLAN +---------------------------------------- LockRows -> Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (3 rows) --Testcase 63: @@ -949,10 +938,10 @@ select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; --Testcase 64: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'C'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'C'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'C'::name) (2 rows) --Testcase 65: @@ -968,10 +957,10 @@ SET enable_indexscan TO off; --Testcase 67: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 68: @@ -988,10 +977,10 @@ RESET enable_indexscan; explain (costs off) select unique1, unique2 from onek2 where (unique2 = 11 or unique1 = 0) and stringu1 < 'B'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND ((unique2 = 11) OR (unique1 = 0))) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 71: diff --git a/expected/13.4/postgresql/update.out b/expected/13.4/postgresql/update.out index 78df9f3..5610a7d 100644 --- a/expected/13.4/postgresql/update.out +++ b/expected/13.4/postgresql/update.out @@ -29,10 +29,10 @@ CREATE FOREIGN TABLE upsert_test ( --Testcase 6: EXPLAIN VERBOSE INSERT INTO update_test VALUES (5, 10, 'foo'); - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Insert on public.update_test (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO "public"."update_test"("a", "b", "c", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 5, 10, 'foo'::text, nextval('update_test_id_seq'::regclass) (4 rows) @@ -42,10 +42,10 @@ INSERT INTO update_test VALUES (5, 10, 'foo'); --Testcase 8: EXPLAIN VERBOSE INSERT INTO update_test(b, a) VALUES (15, 10); - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Insert on public.update_test (cost=0.00..0.01 rows=1 width=44) - Remote SQL: INSERT INTO "public"."update_test"("a", "b", "c", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 10, 15, NULL::text, nextval('update_test_id_seq'::regclass) (4 rows) @@ -60,7 +60,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 11: @@ -74,14 +74,14 @@ SELECT * FROM update_test; --Testcase 12: EXPLAIN VERBOSE UPDATE update_test SET a = DEFAULT, b = DEFAULT; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..27.00 rows=2 width=48) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=48) Output: 10, NULL::integer, c, id, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT c, id FROM public.update_test (6 rows) --Testcase 13: @@ -94,7 +94,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 15: @@ -112,13 +112,12 @@ UPDATE update_test AS t SET b = 10 WHERE t.a = 10; QUERY PLAN --------------------------------------------------------------------------------- Update on public.update_test t (cost=25.00..27.00 rows=2 width=48) - Remote SQL: UPDATE "public"."update_test" SET "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET b = ? WHERE id = ? -> Foreign Scan on public.update_test t (cost=25.00..27.00 rows=2 width=48) Output: a, 10, c, id, id - Filter: (t.a = 10) Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, c, id FROM public.update_test WHERE ((a = 10)) +(6 rows) --Testcase 17: UPDATE update_test AS t SET b = 10 WHERE t.a = 10; @@ -130,7 +129,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 19: @@ -147,13 +146,12 @@ UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; QUERY PLAN --------------------------------------------------------------------------------- Update on public.update_test t (cost=25.00..27.00 rows=2 width=48) - Remote SQL: UPDATE "public"."update_test" SET "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET b = ? WHERE id = ? -> Foreign Scan on public.update_test t (cost=25.00..27.00 rows=2 width=48) Output: a, (b + 10), c, id, id - Filter: (t.a = 10) Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((a = 10)) +(6 rows) --Testcase 21: UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; @@ -165,7 +163,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 23: @@ -186,13 +184,12 @@ UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) QUERY PLAN ----------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..27.00 rows=2 width=48) - Remote SQL: UPDATE "public"."update_test" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=48) Output: 100, update_test.b, update_test.c, update_test.id, update_test.id - Filter: (update_test.b = 20) Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT b, c, id FROM public.update_test WHERE ((b = 20)) +(6 rows) --Testcase 25: UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) @@ -205,7 +202,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 27: @@ -241,11 +238,11 @@ INSERT INTO update_test(a, b, c) SELECT a,b+1,c FROM update_test; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Insert on public.update_test (cost=25.00..27.02 rows=2 width=44) - Remote SQL: INSERT INTO "public"."update_test"("a", "b", "c", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..27.02 rows=2 width=44) Output: update_test_1.a, (update_test_1.b + 1), update_test_1.c, nextval('update_test_id_seq'::regclass) Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c FROM public.update_test (6 rows) --Testcase 31: @@ -258,7 +255,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 33: @@ -274,16 +271,15 @@ SELECT * FROM update_test; --Testcase 34: EXPLAIN VERBOSE UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.01 rows=4 width=48) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ?, "c" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ?, c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=48) Output: 10, (b + 11), 'bugle'::text, id, id - Filter: (update_test.c = 'foo'::text) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT b, id FROM public.update_test WHERE ((c = 'foo')) +(6 rows) --Testcase 35: UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; @@ -298,7 +294,7 @@ SELECT * FROM update_test ORDER BY b; -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (7 rows) --Testcase 37: @@ -314,16 +310,15 @@ SELECT * FROM update_test ORDER BY b; --Testcase 38: EXPLAIN VERBOSE UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.02 rows=4 width=48) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ?, "c" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ?, c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.02 rows=4 width=48) Output: (a + 1), (a + b), 'car'::text, id, id - Filter: (update_test.a = 10) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, id FROM public.update_test WHERE ((a = 10)) +(6 rows) --Testcase 39: UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; @@ -338,7 +333,7 @@ SELECT * FROM update_test ORDER BY b; -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (7 rows) --Testcase 41: @@ -368,19 +363,17 @@ UPDATE update_test QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.00..58.00 rows=4 width=80) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.00 rows=4 width=8) Output: update_test_1.a, update_test_1.b - Filter: ((update_test_1.b = 41) AND (update_test_1.c = 'car'::text)) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b FROM public.update_test WHERE ((b = 41)) AND ((c = 'car')) -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=80) Output: $1, $0, update_test.c, update_test.id, NULL::record, update_test.id - Filter: ((update_test.a = 100) AND (update_test.b = 20)) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(13 rows) + Remote SQL: SELECT c, id FROM public.update_test WHERE ((a = 100)) AND ((b = 20)) +(11 rows) --Testcase 45: UPDATE update_test @@ -394,7 +387,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 47: @@ -416,17 +409,17 @@ UPDATE update_test o QUERY PLAN -------------------------------------------------------------------------------------------- Update on public.update_test o (cost=25.00..145.04 rows=4 width=80) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test o (cost=25.00..145.04 rows=4 width=80) Output: $4, $3, o.c, o.id, (SubPlan 1 (returns $3,$4)), o.id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test SubPlan 1 (returns $3,$4) -> Foreign Scan on public.update_test i (cost=25.00..29.01 rows=4 width=8) Output: (i.a + 1), i.b Filter: ((NOT (i.c IS DISTINCT FROM o.c)) AND (i.a = o.a) AND (i.b = o.b)) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c FROM public.update_test (12 rows) --Testcase 49: @@ -441,7 +434,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 51: @@ -461,16 +454,16 @@ UPDATE update_test SET (b,a) = (select a+1,b from update_test); QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.01..58.01 rows=4 width=80) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.01 rows=4 width=8) Output: (update_test_1.a + 1), update_test_1.b Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b FROM public.update_test -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=80) Output: $1, $0, update_test.c, update_test.id, NULL::record, update_test.id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT c, id FROM public.update_test (11 rows) --Testcase 53: @@ -484,19 +477,17 @@ UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000) QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.01..58.01 rows=4 width=80) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.01 rows=4 width=8) Output: (update_test_1.a + 1), update_test_1.b - Filter: (update_test_1.a = 1000) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b FROM public.update_test WHERE ((a = 1000)) -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=80) Output: $1, $0, update_test.c, update_test.id, NULL::record, update_test.id - Filter: (update_test.a = 11) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(13 rows) + Remote SQL: SELECT c, id FROM public.update_test WHERE ((a = 11)) +(11 rows) --Testcase 55: UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000) @@ -518,7 +509,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 57: @@ -536,16 +527,15 @@ SELECT * FROM update_test; EXPLAIN VERBOSE UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j) WHERE update_test.a = v.i; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.00 rows=4 width=48) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=48) Output: 21, 100, update_test.c, update_test.id, update_test.id - Filter: (update_test.a = 21) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT c, id FROM public.update_test WHERE ((a = 21)) +(6 rows) --Testcase 59: UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j) @@ -586,13 +576,12 @@ UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car'; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.00 rows=4 width=48) - Remote SQL: UPDATE "public"."update_test" SET "c" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=48) Output: a, b, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'::text, id, id - Filter: (update_test.c = 'car'::text) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, id FROM public.update_test WHERE ((c = 'car')) +(6 rows) --Testcase 65: UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car'; @@ -604,7 +593,7 @@ SELECT a, b, char_length(c) FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=12) Output: a, b, char_length(c) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c FROM public.update_test (4 rows) --Testcase 67: @@ -623,21 +612,21 @@ EXPLAIN (VERBOSE, COSTS OFF) UPDATE update_test t SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a) WHERE CURRENT_USER = SESSION_USER; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------- Update on public.update_test t - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? -> Result Output: $1, $2, t.c, t.id, (SubPlan 1 (returns $1,$2)), t.id One-Time Filter: (CURRENT_USER = SESSION_USER) -> Foreign Scan on public.update_test t Output: t.a, t.b, t.c, t.id - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, c, id FROM public.update_test SubPlan 1 (returns $1,$2) -> Foreign Scan on public.update_test s Output: s.b, s.a Filter: (s.a = t.a) - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b FROM public.update_test (13 rows) --Testcase 69: @@ -652,7 +641,7 @@ SELECT a, b, char_length(c) FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=12) Output: a, b, char_length(c) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c FROM public.update_test (4 rows) --Testcase 71: @@ -669,10 +658,10 @@ SELECT a, b, char_length(c) FROM update_test; --Testcase 72: EXPLAIN VERBOSE INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo'); - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Insert on public.upsert_test (cost=0.00..0.03 rows=2 width=36) - Remote SQL: INSERT INTO "public"."upsert_test"("a", "b") VALUES (?, ?) + Remote SQL: INSERT INTO public.upsert_test(a, b) VALUES (?, ?) -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=36) Output: "*VALUES*".column1, "*VALUES*".column2 (4 rows) diff --git a/expected/14.0/mysql/char.out b/expected/14.0/mysql/char.out index cf63f78..76fd365 100644 --- a/expected/14.0/mysql/char.out +++ b/expected/14.0/mysql/char.out @@ -39,10 +39,10 @@ CREATE FOREIGN TABLE CHAR_TBL (f1 char, id serial OPTIONS (key 'true')) SERVER : --Testcase 7: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('a'); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'a'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -52,10 +52,10 @@ INSERT INTO char_tbl VALUES ('a'); --Testcase 9: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('A'); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'A'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -66,10 +66,10 @@ INSERT INTO char_tbl VALUES ('A'); --Testcase 11: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('1'); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -79,10 +79,10 @@ INSERT INTO char_tbl VALUES ('1'); --Testcase 13: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES (2); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '2'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -92,10 +92,10 @@ INSERT INTO char_tbl VALUES (2); --Testcase 15: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('3'); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '3'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -106,10 +106,10 @@ INSERT INTO char_tbl VALUES ('3'); --Testcase 17: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES (''); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: ' '::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -127,10 +127,10 @@ psql:sql/14.0/char.sql:62: ERROR: value too long for type character(1) --Testcase 21: EXPLAIN VERBOSE INSERT INTO char_tbl VALUES ('c '); - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'c'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -145,7 +145,7 @@ SELECT f1 FROM CHAR_TBL; Foreign Scan on public.char_tbl (cost=25.00..32.00 rows=7 width=8) Output: f1 Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl (4 rows) --Testcase 24: @@ -161,19 +161,20 @@ SELECT f1 FROM CHAR_TBL; c (7 rows) +-- For Char, varchar, text in MySQL, comparison is case-insensitive. +-- Result at MySQL will not same as Postgres. --Testcase 25: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 <> 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 <> 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 <> 'a')) +(4 rows) --Testcase 26: SELECT c.f1 @@ -181,27 +182,25 @@ SELECT c.f1 WHERE c.f1 <> 'a'; f1 ---- - A 1 2 3 c -(6 rows) +(5 rows) --Testcase 27: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 = 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 = 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 = 'a')) +(4 rows) --Testcase 28: SELECT c.f1 @@ -210,21 +209,21 @@ SELECT c.f1 f1 ---- a -(1 row) + A +(2 rows) --Testcase 29: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 < 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 < 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 < 'a')) +(4 rows) --Testcase 30: SELECT c.f1 @@ -243,14 +242,13 @@ EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 <= 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 <= 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 <= 'a')) +(4 rows) --Testcase 32: SELECT c.f1 @@ -259,25 +257,25 @@ SELECT c.f1 f1 ---- a + A 1 2 3 -(5 rows) +(6 rows) --Testcase 33: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 > 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 > 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 > 'a')) +(4 rows) --Testcase 34: SELECT c.f1 @@ -285,23 +283,21 @@ SELECT c.f1 WHERE c.f1 > 'a'; f1 ---- - A c -(2 rows) +(1 row) --Testcase 35: EXPLAIN VERBOSE SELECT c.f1 FROM CHAR_TBL c WHERE c.f1 >= 'a'; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 >= 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl WHERE ((f1 >= 'a')) +(4 rows) --Testcase 36: SELECT c.f1 @@ -324,10 +320,10 @@ CREATE FOREIGN TABLE CHAR_TBL(f1 char(4), id serial OPTIONS (key 'true')) SERVER --Testcase 39: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('a'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl_2`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'a '::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -337,10 +333,10 @@ INSERT INTO CHAR_TBL VALUES ('a'); --Testcase 41: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('ab'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl_2`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'ab '::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -350,10 +346,10 @@ INSERT INTO CHAR_TBL VALUES ('ab'); --Testcase 43: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcd'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl_2`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'abcd'::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -363,17 +359,17 @@ INSERT INTO CHAR_TBL VALUES ('abcd'); --Testcase 45: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcde'); -psql:sql/14.0/char.sql:154: ERROR: value too long for type character(4) +psql:sql/14.0/char.sql:156: ERROR: value too long for type character(4) --Testcase 46: INSERT INTO CHAR_TBL VALUES ('abcde'); -psql:sql/14.0/char.sql:156: ERROR: value too long for type character(4) +psql:sql/14.0/char.sql:158: ERROR: value too long for type character(4) --Testcase 47: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcd '); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`char_tbl_2`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'abcd'::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -387,7 +383,7 @@ EXPLAIN VERBOSE SELECT f1 FROM CHAR_TBL; Foreign Scan on public.char_tbl (cost=25.00..29.00 rows=4 width=20) Output: f1 Foreign Table Size: 4 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`char_tbl_2` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.char_tbl_2 (4 rows) --Testcase 50: @@ -402,7 +398,7 @@ SELECT f1 FROM CHAR_TBL; --Testcase 51: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/14.0/char.sql:168: NOTICE: drop cascades to 2 other objects +psql:sql/14.0/char.sql:170: NOTICE: drop cascades to 2 other objects DETAIL: drop cascades to user mapping for public on server mysql_server drop cascades to foreign table char_tbl --Testcase 52: diff --git a/expected/14.0/mysql/date.out b/expected/14.0/mysql/date.out index 9b1a6c7..c8ae455 100644 --- a/expected/14.0/mysql/date.out +++ b/expected/14.0/mysql/date.out @@ -176,7 +176,7 @@ SELECT f1 as "date", Foreign Scan on public.date_tbl (cost=25.00..41.05 rows=15 width=116) Output: f1, date_part('year'::text, (f1)::timestamp without time zone), date_part('month'::text, (f1)::timestamp without time zone), date_part('day'::text, (f1)::timestamp without time zone), date_part('quarter'::text, (f1)::timestamp without time zone), date_part('decade'::text, (f1)::timestamp without time zone), date_part('century'::text, (f1)::timestamp without time zone), date_part('millennium'::text, (f1)::timestamp without time zone), date_part('isoyear'::text, (f1)::timestamp without time zone), date_part('week'::text, (f1)::timestamp without time zone), date_part('dow'::text, (f1)::timestamp without time zone), date_part('isodow'::text, (f1)::timestamp without time zone), date_part('doy'::text, (f1)::timestamp without time zone), date_part('julian'::text, (f1)::timestamp without time zone), date_part('epoch'::text, (f1)::timestamp without time zone) Foreign Table Size: 15 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`date_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.date_tbl (4 rows) --Testcase 29: diff --git a/expected/14.0/mysql/delete.out b/expected/14.0/mysql/delete.out index 991407b..7a52c67 100644 --- a/expected/14.0/mysql/delete.out +++ b/expected/14.0/mysql/delete.out @@ -24,16 +24,15 @@ INSERT INTO delete_test (a) VALUES (100); -- allow an alias to be specified for DELETE's target table --Testcase 5: EXPLAIN VERBOSE DELETE FROM delete_test AS dt WHERE dt.a > 75; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Delete on public.delete_test dt (cost=25.00..28.00 rows=0 width=0) - Remote SQL: DELETE FROM `odbc_fdw_regress`.`delete_test` WHERE `id` = ? + Remote SQL: DELETE FROM odbc_fdw_regress.delete_test WHERE id = ? -> Foreign Scan on public.delete_test dt (cost=25.00..28.00 rows=3 width=4) Output: id - Filter: (dt.a > 75) Foreign Table Size: 3 b - Remote SQL: SELECT `id`,`a`,`b` FROM `odbc_fdw_regress`.`delete_test` -(7 rows) + Remote SQL: SELECT id FROM odbc_fdw_regress.delete_test WHERE ((a > 75)) +(6 rows) --Testcase 6: DELETE FROM delete_test AS dt WHERE dt.a > 75; @@ -58,7 +57,7 @@ EXPLAIN VERBOSE SELECT id, a, char_length(b) FROM delete_test; Foreign Scan on public.delete_test (cost=25.00..27.00 rows=2 width=12) Output: id, a, char_length(b) Foreign Table Size: 2 b - Remote SQL: SELECT `id`,`a`,`b` FROM `odbc_fdw_regress`.`delete_test` + Remote SQL: SELECT id, a, b FROM odbc_fdw_regress.delete_test (4 rows) --Testcase 10: @@ -72,16 +71,15 @@ SELECT id, a, char_length(b) FROM delete_test; -- delete a row with a TOASTed value --Testcase 11: EXPLAIN VERBOSE DELETE FROM delete_test WHERE a > 25; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Delete on public.delete_test (cost=25.00..27.00 rows=0 width=0) - Remote SQL: DELETE FROM `odbc_fdw_regress`.`delete_test` WHERE `id` = ? + Remote SQL: DELETE FROM odbc_fdw_regress.delete_test WHERE id = ? -> Foreign Scan on public.delete_test (cost=25.00..27.00 rows=2 width=4) Output: id - Filter: (delete_test.a > 25) Foreign Table Size: 2 b - Remote SQL: SELECT `id`,`a`,`b` FROM `odbc_fdw_regress`.`delete_test` -(7 rows) + Remote SQL: SELECT id FROM odbc_fdw_regress.delete_test WHERE ((a > 25)) +(6 rows) --Testcase 12: DELETE FROM delete_test WHERE a > 25; @@ -92,7 +90,7 @@ EXPLAIN VERBOSE SELECT id, a, char_length(b) FROM delete_test; Foreign Scan on public.delete_test (cost=25.00..26.00 rows=1 width=12) Output: id, a, char_length(b) Foreign Table Size: 1 b - Remote SQL: SELECT `id`,`a`,`b` FROM `odbc_fdw_regress`.`delete_test` + Remote SQL: SELECT id, a, b FROM odbc_fdw_regress.delete_test (4 rows) --Testcase 14: diff --git a/expected/14.0/mysql/float4.out b/expected/14.0/mysql/float4.out index 6ce5c36..49a2388 100644 --- a/expected/14.0/mysql/float4.out +++ b/expected/14.0/mysql/float4.out @@ -277,6 +277,11 @@ SELECT (f1::float4) AS float4 FROM FLOAT4_TBL; -------- (0 rows) +-- The comparison of floating-point values for equality is not safe +-- because of the rounding errors when converting between binary and decimal. +-- A floating-point value as written in an SQL statement may not be +-- the same as the value represented internally. +-- E.g: binary value of 1004.3 may be 1004.2999999999999 --Testcase 67: ALTER FOREIGN TABLE FLOAT4_TBL OPTIONS (SET table 'float4_tbl'); --Testcase 68: @@ -295,35 +300,37 @@ SELECT f1 FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3'; f1 ------------- 0 + 1004.3 -34.84 1.23457e+20 1.23457e-20 -(4 rows) +(5 rows) --Testcase 70: SELECT f1 FROM FLOAT4_TBL f WHERE f.f1 = '1004.3'; - f1 --------- - 1004.3 -(1 row) + f1 +---- +(0 rows) --Testcase 71: SELECT f1 FROM FLOAT4_TBL f WHERE '1004.3' > f.f1; f1 ------------- 0 + 1004.3 -34.84 1.23457e-20 -(3 rows) +(4 rows) --Testcase 72: SELECT f1 FROM FLOAT4_TBL f WHERE f.f1 < '1004.3'; f1 ------------- 0 + 1004.3 -34.84 1.23457e-20 -(3 rows) +(4 rows) --Testcase 73: SELECT f.f1 FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1; @@ -388,7 +395,7 @@ SELECT f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f -- test divide by zero --Testcase 79: SELECT f.f1 / '0.0' from FLOAT4_TBL f; -psql:sql/14.0/float4.sql:201: ERROR: division by zero +psql:sql/14.0/float4.sql:205: ERROR: division by zero --Testcase 80: SELECT f1 FROM FLOAT4_TBL; f1 @@ -447,7 +454,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('32767.6'::float4); --Testcase 90: SELECT f1::int2 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:233: ERROR: smallint out of range +psql:sql/14.0/float4.sql:237: ERROR: smallint out of range --Testcase 91: DELETE FROM FLOAT4_TBL; --Testcase 92: @@ -465,7 +472,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-32768.6'::float4); --Testcase 96: SELECT f1::int2 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:247: ERROR: smallint out of range +psql:sql/14.0/float4.sql:251: ERROR: smallint out of range --Testcase 97: DELETE FROM FLOAT4_TBL; --Testcase 98: @@ -549,7 +556,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-9223380000000000000'::float4); --Testcase 120: SELECT f1::int8 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:303: ERROR: bigint out of range +psql:sql/14.0/float4.sql:307: ERROR: bigint out of range -- Test for correct input rounding in edge cases. -- These lists are from Paxson 1991, excluding subnormals and -- inputs of over 9 sig. digits. @@ -635,6 +642,6 @@ SELECT float4send(f1) FROM FLOAT4_TBL; DROP FOREIGN TABLE FLOAT4_TBL; --Testcase 143: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/14.0/float4.sql:368: NOTICE: drop cascades to user mapping for public on server mysql_server +psql:sql/14.0/float4.sql:372: NOTICE: drop cascades to user mapping for public on server mysql_server --Testcase 144: DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/expected/14.0/mysql/float8.out b/expected/14.0/mysql/float8.out index 77b2344..81a4297 100644 --- a/expected/14.0/mysql/float8.out +++ b/expected/14.0/mysql/float8.out @@ -21,10 +21,10 @@ CREATE FOREIGN TABLE FLOAT8_TMP( id serial OPTIONS (key 'true'), f1 float8, f2 f --Testcase 6: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 '); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '0'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -34,10 +34,10 @@ INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 '); --Testcase 8: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 '); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1004.3'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -47,10 +47,10 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 '); --Testcase 10: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-34.84'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -63,7 +63,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200'); QUERY PLAN -------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1.2345678901234e+200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -76,7 +76,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200'); QUERY PLAN -------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1.2345678901234e-200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -332,7 +332,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 71: @@ -349,14 +349,13 @@ SELECT f1 FROM FLOAT8_TBL; --Testcase 72: EXPLAIN VERBOSE SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: (f.f1 <> '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 <> 1004.3)) +(4 rows) --Testcase 73: SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; @@ -371,14 +370,13 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; --Testcase 74: EXPLAIN VERBOSE SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: (f.f1 = '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 = 1004.3)) +(4 rows) --Testcase 75: SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; @@ -390,14 +388,13 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; --Testcase 76: EXPLAIN VERBOSE SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: ('1004.3'::double precision > f.f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((1004.3 > f1)) +(4 rows) --Testcase 77: SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; @@ -411,14 +408,13 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; --Testcase 78: EXPLAIN VERBOSE SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: (f.f1 < '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 < 1004.3)) +(4 rows) --Testcase 79: SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; @@ -432,14 +428,13 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; --Testcase 80: EXPLAIN VERBOSE SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: ('1004.3'::double precision >= f.f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((1004.3 >= f1)) +(4 rows) --Testcase 81: SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; @@ -454,14 +449,13 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; --Testcase 82: EXPLAIN VERBOSE SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3'; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: (f.f1 <= '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 <= 1004.3)) +(4 rows) --Testcase 83: SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3'; @@ -478,14 +472,13 @@ EXPLAIN VERBOSE SELECT f.f1, f.f1 * '-10' AS x FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (f1 * '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 85: SELECT f.f1, f.f1 * '-10' AS x @@ -503,14 +496,13 @@ EXPLAIN VERBOSE SELECT f.f1, f.f1 + '-10' AS x FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (f1 + '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 87: SELECT f.f1, f.f1 + '-10' AS x @@ -528,14 +520,13 @@ EXPLAIN VERBOSE SELECT f.f1, f.f1 / '-10' AS x FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (f1 / '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 89: SELECT f.f1, f.f1 / '-10' AS x @@ -553,14 +544,13 @@ EXPLAIN VERBOSE SELECT f.f1, f.f1 - '-10' AS x FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (f1 - '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 91: SELECT f.f1, f.f1 - '-10' AS x @@ -577,14 +567,13 @@ SELECT f.f1, f.f1 - '-10' AS x EXPLAIN VERBOSE SELECT f.f1 ^ '2.0' AS square_f1 FROM FLOAT8_TBL f where f.f1 = '1004.3'; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: (f1 ^ '2'::double precision) - Filter: (f.f1 = '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 = 1004.3)) +(4 rows) --Testcase 93: SELECT f.f1 ^ '2.0' AS square_f1 @@ -604,7 +593,7 @@ SELECT f.f1, @f.f1 AS abs_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (@ f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 95: @@ -629,7 +618,7 @@ SELECT f.f1, trunc(f.f1) AS trunc_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, trunc(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 97: @@ -654,7 +643,7 @@ SELECT f.f1, round(f.f1) AS round_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, round(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 99: @@ -678,7 +667,7 @@ select ceil(f1) as ceil_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ceil(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 101: @@ -700,7 +689,7 @@ select ceiling(f1) as ceiling_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ceiling(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 103: @@ -723,7 +712,7 @@ select floor(f1) as floor_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: floor(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 105: @@ -746,7 +735,7 @@ select sign(f1) as sign_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: sign(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 107: @@ -801,14 +790,13 @@ EXPLAIN VERBOSE SELECT f.f1, |/f.f1 AS sqrt_f1 FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (|/ f1) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 114: SELECT f.f1, |/f.f1 AS sqrt_f1 @@ -827,6 +815,17 @@ DELETE FROM FLOAT8_TMP; --Testcase 116: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '144', float8 '0.5'); --Testcase 117: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.float8_tmp (cost=25.00..26.00 rows=1 width=8) + Output: power(f1, f2) + Foreign Table Size: 1 b + Remote SQL: SELECT f1, f2 FROM odbc_fdw_regress.float8_tmp +(4 rows) + +--Testcase 164: SELECT power(f1, f2) FROM FLOAT8_TMP; power ------- @@ -837,9 +836,20 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 119: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'NaN', float8 '0.5'); -psql:sql/14.0/float8.sql:330: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:333: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 120: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.float8_tmp (cost=25.00..26.00 rows=1 width=8) + Output: power(f1, f2) + Foreign Table Size: 0 b + Remote SQL: SELECT f1, f2 FROM odbc_fdw_regress.float8_tmp +(4 rows) + +--Testcase 165: SELECT power(f1, f2) FROM FLOAT8_TMP; power ------- @@ -849,9 +859,20 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 122: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '144', float8 'NaN'); -psql:sql/14.0/float8.sql:337: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:343: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 123: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.float8_tmp (cost=25.00..26.00 rows=1 width=8) + Output: power(f1, f2) + Foreign Table Size: 0 b + Remote SQL: SELECT f1, f2 FROM odbc_fdw_regress.float8_tmp +(4 rows) + +--Testcase 166: SELECT power(f1, f2) FROM FLOAT8_TMP; power ------- @@ -861,7 +882,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 125: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'NaN', float8 'NaN'); -psql:sql/14.0/float8.sql:344: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:353: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 126: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -873,7 +894,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 128: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-1', float8 'NaN'); -psql:sql/14.0/float8.sql:351: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:360: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 129: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -885,7 +906,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 131: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '1', float8 'NaN'); -psql:sql/14.0/float8.sql:358: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:367: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 132: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -897,7 +918,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 134: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'NaN', float8 '0'); -psql:sql/14.0/float8.sql:365: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:374: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 135: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -909,7 +930,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 137: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'inf', float8 '0'); -psql:sql/14.0/float8.sql:372: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:381: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 138: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -921,7 +942,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 140: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 '0'); -psql:sql/14.0/float8.sql:379: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:388: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 141: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -933,7 +954,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 143: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '0', float8 'inf'); -psql:sql/14.0/float8.sql:386: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:395: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 144: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -945,7 +966,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 146: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '0', float8 '-inf'); -psql:sql/14.0/float8.sql:393: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:402: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 147: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -957,7 +978,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 149: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '1', float8 'inf'); -psql:sql/14.0/float8.sql:400: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:409: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 150: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -969,7 +990,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 152: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '1', float8 '-inf'); -psql:sql/14.0/float8.sql:407: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:416: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 153: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -981,7 +1002,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 155: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-1', float8 'inf'); -psql:sql/14.0/float8.sql:414: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:423: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 156: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -993,7 +1014,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 158: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-1', float8 '-inf'); -psql:sql/14.0/float8.sql:421: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:430: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 159: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1005,7 +1026,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 161: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '0.1', float8 'inf'); -psql:sql/14.0/float8.sql:428: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:437: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 162: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1017,7 +1038,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 164: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-0.1', float8 'inf'); -psql:sql/14.0/float8.sql:435: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:444: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 165: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1029,7 +1050,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 167: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '1.1', float8 'inf'); -psql:sql/14.0/float8.sql:442: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:451: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 168: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1041,7 +1062,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 170: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-1.1', float8 'inf'); -psql:sql/14.0/float8.sql:449: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:458: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 171: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1053,7 +1074,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 173: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '0.1', float8 '-inf'); -psql:sql/14.0/float8.sql:456: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:465: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 174: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1065,7 +1086,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 176: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-0.1', float8 '-inf'); -psql:sql/14.0/float8.sql:463: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:472: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 177: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1077,7 +1098,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 179: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '1.1', float8 '-inf'); -psql:sql/14.0/float8.sql:470: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:479: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 180: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1089,7 +1110,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 182: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-1.1', float8 '-inf'); -psql:sql/14.0/float8.sql:477: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:486: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f2' at row 1 --Testcase 183: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1101,7 +1122,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 185: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'inf', float8 '-2'); -psql:sql/14.0/float8.sql:484: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:493: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 186: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1113,7 +1134,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 188: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'inf', float8 '2'); -psql:sql/14.0/float8.sql:491: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:500: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 189: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1125,7 +1146,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 191: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'inf', float8 'inf'); -psql:sql/14.0/float8.sql:498: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:507: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 192: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1137,7 +1158,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 194: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'inf', float8 '-inf'); -psql:sql/14.0/float8.sql:505: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:514: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 195: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1151,7 +1172,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 197: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 '-2'); -psql:sql/14.0/float8.sql:514: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:523: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 198: SELECT power(f1, f2) = '0' FROM FLOAT8_TMP; @@ -1163,7 +1184,7 @@ SELECT power(f1, f2) = '0' FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 200: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 '-3'); -psql:sql/14.0/float8.sql:521: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:530: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 201: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1175,7 +1196,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 203: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 '2'); -psql:sql/14.0/float8.sql:528: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:537: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 204: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1187,7 +1208,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 206: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 '3'); -psql:sql/14.0/float8.sql:535: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:544: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 207: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1199,7 +1220,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 209: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 '3.5'); -psql:sql/14.0/float8.sql:542: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:551: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 210: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1211,7 +1232,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 212: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 'inf'); -psql:sql/14.0/float8.sql:549: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:558: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 213: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1223,7 +1244,7 @@ SELECT power(f1, f2) FROM FLOAT8_TMP; DELETE FROM FLOAT8_TMP; --Testcase 215: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 '-inf'); -psql:sql/14.0/float8.sql:556: ERROR: Executing ODBC query +psql:sql/14.0/float8.sql:565: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Data truncated for column 'f1' at row 1 --Testcase 216: SELECT power(f1, f2) FROM FLOAT8_TMP; @@ -1237,14 +1258,13 @@ EXPLAIN VERBOSE SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1 FROM FLOAT8_TBL f WHERE f.f1 > '0.0'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.02 rows=5 width=16) Output: f1, exp(ln(f1)) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 218: SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1 @@ -1265,7 +1285,7 @@ SELECT f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (||/ f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 220: @@ -1287,7 +1307,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 222: @@ -1306,16 +1326,15 @@ EXPLAIN VERBOSE UPDATE FLOAT8_TBL SET f1 = FLOAT8_TBL.f1 * '-1' WHERE FLOAT8_TBL.f1 > '0.0'; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Update on public.float8_tbl (cost=25.00..30.01 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`float8_tbl` SET `f1` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.float8_tbl SET f1 = ? WHERE id = ? -> Foreign Scan on public.float8_tbl (cost=25.00..30.01 rows=5 width=48) Output: (f1 * '-1'::double precision), id, float8_tbl.* - Filter: (float8_tbl.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(7 rows) + Remote SQL: SELECT f1, id FROM odbc_fdw_regress.float8_tbl WHERE ((f1 > 0)) +(6 rows) --Testcase 224: UPDATE FLOAT8_TBL @@ -1329,12 +1348,12 @@ SELECT f.f1 * '1e200' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: (f1 * '1e+200'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 226: SELECT f.f1 * '1e200' from FLOAT8_TBL f; -psql:sql/14.0/float8.sql:593: ERROR: value out of range: overflow +psql:sql/14.0/float8.sql:602: ERROR: value out of range: overflow --Testcase 227: EXPLAIN VERBOSE SELECT f.f1 ^ '1e200' from FLOAT8_TBL f; @@ -1343,45 +1362,43 @@ SELECT f.f1 ^ '1e200' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: (f1 ^ '1e+200'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 228: SELECT f.f1 ^ '1e200' from FLOAT8_TBL f; -psql:sql/14.0/float8.sql:598: ERROR: value out of range: overflow +psql:sql/14.0/float8.sql:607: ERROR: value out of range: overflow -- EXPLAIN VERBOSE -- SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5; -- comment out because of no foreign table -- SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5; -- comment out because of no foreign table --Testcase 229: EXPLAIN VERBOSE SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ln(f1) - Filter: (f.f1 = '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 = 0)) +(4 rows) --Testcase 230: SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; -psql:sql/14.0/float8.sql:606: ERROR: cannot take logarithm of zero +psql:sql/14.0/float8.sql:615: ERROR: cannot take logarithm of zero --Testcase 231: EXPLAIN VERBOSE SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ln(f1) - Filter: (f.f1 < '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` -(5 rows) + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl WHERE ((f1 < 0)) +(4 rows) --Testcase 232: SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; -psql:sql/14.0/float8.sql:611: ERROR: cannot take logarithm of a negative number +psql:sql/14.0/float8.sql:620: ERROR: cannot take logarithm of a negative number --Testcase 233: EXPLAIN VERBOSE SELECT exp(f.f1) from FLOAT8_TBL f; @@ -1390,12 +1407,12 @@ SELECT exp(f.f1) from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: exp(f1) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 234: SELECT exp(f.f1) from FLOAT8_TBL f; -psql:sql/14.0/float8.sql:616: ERROR: value out of range: underflow +psql:sql/14.0/float8.sql:625: ERROR: value out of range: underflow --Testcase 235: EXPLAIN VERBOSE SELECT f.f1 / '0.0' from FLOAT8_TBL f; @@ -1404,12 +1421,12 @@ SELECT f.f1 / '0.0' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: (f1 / '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 236: SELECT f.f1 / '0.0' from FLOAT8_TBL f; -psql:sql/14.0/float8.sql:621: ERROR: division by zero +psql:sql/14.0/float8.sql:630: ERROR: division by zero --Testcase 237: EXPLAIN VERBOSE SELECT f1 FROM FLOAT8_TBL; @@ -1418,7 +1435,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 238: @@ -1438,45 +1455,45 @@ RESET extra_float_digits; --Testcase 240: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); -psql:sql/14.0/float8.sql:632: ERROR: "10e400" is out of range for type double precision +psql:sql/14.0/float8.sql:641: ERROR: "10e400" is out of range for type double precision LINE 2: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); ^ --Testcase 241: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); -psql:sql/14.0/float8.sql:634: ERROR: "10e400" is out of range for type double precision +psql:sql/14.0/float8.sql:643: ERROR: "10e400" is out of range for type double precision LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); ^ --Testcase 242: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); -psql:sql/14.0/float8.sql:637: ERROR: "-10e400" is out of range for type double precision +psql:sql/14.0/float8.sql:646: ERROR: "-10e400" is out of range for type double precision LINE 2: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); ^ --Testcase 243: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); -psql:sql/14.0/float8.sql:639: ERROR: "-10e400" is out of range for type double precision +psql:sql/14.0/float8.sql:648: ERROR: "-10e400" is out of range for type double precision LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); ^ --Testcase 244: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); -psql:sql/14.0/float8.sql:642: ERROR: "10e-400" is out of range for type double precision +psql:sql/14.0/float8.sql:651: ERROR: "10e-400" is out of range for type double precision LINE 2: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); ^ --Testcase 245: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); -psql:sql/14.0/float8.sql:644: ERROR: "10e-400" is out of range for type double precision +psql:sql/14.0/float8.sql:653: ERROR: "10e-400" is out of range for type double precision LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); ^ --Testcase 246: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); -psql:sql/14.0/float8.sql:647: ERROR: "-10e-400" is out of range for type double precision +psql:sql/14.0/float8.sql:656: ERROR: "-10e-400" is out of range for type double precision LINE 2: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); ^ --Testcase 247: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); -psql:sql/14.0/float8.sql:649: ERROR: "-10e-400" is out of range for type double precision +psql:sql/14.0/float8.sql:658: ERROR: "-10e-400" is out of range for type double precision LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); ^ -- maintain external table consistency across platforms @@ -1487,11 +1504,11 @@ DELETE FROM FLOAT8_TBL; QUERY PLAN ----------------------------------------------------------------------------- Delete on public.float8_tbl (cost=25.00..30.00 rows=0 width=0) - Remote SQL: DELETE FROM `odbc_fdw_regress`.`float8_tbl` WHERE `id` = ? + Remote SQL: DELETE FROM odbc_fdw_regress.float8_tbl WHERE id = ? -> Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=4) Output: id Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT id FROM odbc_fdw_regress.float8_tbl (6 rows) --Testcase 249: @@ -1499,10 +1516,10 @@ DELETE FROM FLOAT8_TBL; --Testcase 250: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '0'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1512,10 +1529,10 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0'); --Testcase 252: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84'); - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-34.84'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1528,7 +1545,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30'); QUERY PLAN ------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1004.3'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1541,7 +1558,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200'); QUERY PLAN --------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1.2345678901234e+200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1554,7 +1571,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200'); QUERY PLAN --------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`float8_tbl`(`f1`, `id`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1.2345678901234e-200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1569,7 +1586,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT `f1`,`id` FROM `odbc_fdw_regress`.`float8_tbl` + Remote SQL: SELECT f1 FROM odbc_fdw_regress.float8_tbl (4 rows) --Testcase 261: @@ -1585,7 +1602,7 @@ SELECT f1 FROM FLOAT8_TBL; --Testcase 262: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/14.0/float8.sql:688: NOTICE: drop cascades to 3 other objects +psql:sql/14.0/float8.sql:697: NOTICE: drop cascades to 3 other objects DETAIL: drop cascades to user mapping for public on server mysql_server drop cascades to foreign table float8_tbl drop cascades to foreign table float8_tmp diff --git a/expected/14.0/mysql/function_pushdown.out b/expected/14.0/mysql/function_pushdown.out new file mode 100644 index 0000000..89ed029 --- /dev/null +++ b/expected/14.0/mysql/function_pushdown.out @@ -0,0 +1,1861 @@ +-- +-- MySQL +-- +\set ECHO none +\i sql/14.0/function_pushdown.sql +-- +-- function push-down +-- +--Testcase 1: +CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; +--Testcase 2: +CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME + OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); +--Testcase 3: +CREATE USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); +--Testcase 4: +CREATE FOREIGN TABLE s1(id int, tag1 text, value1 float, value2 int, value3 float, value4 int, value5 numeric, str1 text, str2 text) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 's1'); +--Testcase 5: +CREATE FOREIGN TABLE tbl04 (id int OPTIONS (key 'true'), c1 float8, c2 bigint, c3 text, c4 boolean, c5 timestamp) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl04'); +--Testcase 6: +EXPLAIN VERBOSE +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=4) + Output: NULLIF(value2, 100) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 WHERE ((nullif(value2, 100) IS NULL)) +(4 rows) + +--Testcase 7: +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + nullif +-------- + + + +(3 rows) + +-- numeric function +--Testcase 8: +EXPLAIN VERBOSE +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: abs(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((abs(value1) > 1)) +(4 rows) + +--Testcase 9: +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + abs +----- + 1.1 + 2.2 + 3.3 +(3 rows) + +--Testcase 10: +EXPLAIN VERBOSE +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: acos(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((value1 < 1)) AND ((acos(value1) > 1)) +(4 rows) + +--Testcase 11: +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + acos +-------------------- + 1.4706289056333368 + 1.369438406004566 + 1.2661036727794992 +(3 rows) + +--Testcase 12: +EXPLAIN VERBOSE +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: asin(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((value1 < 1)) AND ((asin(value1) < 1)) +(4 rows) + +--Testcase 13: +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + asin +-------------------- + 0.1001674211615598 + 0.2013579207903308 + 0.3046926540153975 +(3 rows) + +--Testcase 14: +EXPLAIN VERBOSE +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: atan((id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id FROM odbc_fdw_regress.s1 WHERE ((atan(id) > 0.2)) +(4 rows) + +--Testcase 15: +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + atan +-------------------- + 0.7853981633974483 + 1.1071487177940904 + 1.2490457723982544 + 1.3258176636680326 + 1.373400766945016 +(5 rows) + +--Testcase 16: +EXPLAIN VERBOSE +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: atan2('3.141592653589793'::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id FROM odbc_fdw_regress.s1 WHERE ((atan2(3.141592653589793, id) > 0.2)) +(4 rows) + +--Testcase 17: +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + atan2 +-------------------- + 1.5707963267948966 + 1.2626272556789118 + 1.0038848218538872 + 0.808448792630022 + 0.6657737500283538 + 0.5609821161086238 +(6 rows) + +--Testcase 18: +EXPLAIN VERBOSE +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ceil(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((ceil(value1) > 0)) +(4 rows) + +--Testcase 19: +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + ceil +------ + 1 + 1 + 1 + 2 + 3 + 4 +(6 rows) + +--Testcase 20: +EXPLAIN VERBOSE +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ceiling(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((ceiling(value1) > 0)) +(4 rows) + +--Testcase 21: +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + ceiling +--------- + 1 + 1 + 1 + 2 + 3 + 4 +(6 rows) + +--Testcase 22: +EXPLAIN VERBOSE +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: cos(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((cos(value1) > 0)) +(4 rows) + +--Testcase 23: +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + cos +-------------------- + 0.9950041652780258 + 0.9800665778412416 + 0.955336489125606 + 0.4535961214255773 +(4 rows) + +--Testcase 24: +EXPLAIN VERBOSE +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: cot(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((cot(value1) > 0)) +(4 rows) + +--Testcase 25: +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + cot +-------------------- + 9.966644423259238 + 4.933154875586893 + 3.2327281437658275 + 0.5089681052390643 + 6.259947539437359 +(5 rows) + +--Testcase 26: +EXPLAIN VERBOSE +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: degrees(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((degrees(value1) > 0)) +(4 rows) + +--Testcase 27: +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + degrees +-------------------- + 5.729577951308232 + 11.459155902616464 + 17.188733853924695 + 63.02535746439056 + 126.05071492878112 + 189.07607239317164 +(6 rows) + +--Testcase 28: +EXPLAIN VERBOSE +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: exp(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((exp(value1) > 0)) +(4 rows) + +--Testcase 29: +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + exp +-------------------- + 1.1051709180756477 + 1.2214027581601699 + 1.3498588075760032 + 3.0041660239464334 + 9.025013499434122 + 27.112638920657883 +(6 rows) + +--Testcase 30: +EXPLAIN VERBOSE +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: floor(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((floor(value1) > 0)) +(4 rows) + +--Testcase 31: +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + floor +------- + 1 + 2 + 3 +(3 rows) + +--Testcase 32: +EXPLAIN VERBOSE +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ln(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((ln(value1) > 0)) +(4 rows) + +--Testcase 33: +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + ln +--------------------- + 0.09531017980432493 + 0.7884573603642703 + 1.1939224684724346 +(3 rows) + +--Testcase 34: +EXPLAIN VERBOSE +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=64) + Output: value5, log('2'::numeric, value5) + Foreign Table Size: 6 b + Remote SQL: SELECT value5 FROM odbc_fdw_regress.s1 WHERE ((log(2, value5) > 0)) +(4 rows) + +--Testcase 35: +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + value5 | log +--------+--------------------- + 1.1 | 0.13750352374993491 + 1.2 | 0.2630344058337938 + 1.3 | 0.3785116232537298 +(3 rows) + +--Testcase 37: +EXPLAIN VERBOSE +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: log(value1) + Filter: (log(s1.value1) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 38: +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + log +--------------------- + 0.04139268515822507 + 0.3424226808222063 + 0.5185139398778874 +(3 rows) + +--Testcase 39: +EXPLAIN VERBOSE +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: log10(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((log10(value1) > 0)) +(4 rows) + +--Testcase 40: +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + log10 +--------------------- + 0.04139268515822507 + 0.3424226808222063 + 0.5185139398778874 +(3 rows) + +--Testcase 41: +EXPLAIN VERBOSE +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=4) + Output: mod(value2, (id + 1)) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM odbc_fdw_regress.s1 WHERE ((mod(value2, (id + 1)) > 0)) +(4 rows) + +--Testcase 42: +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + mod +----- + 1 + 2 +(2 rows) + +--Testcase 43: +EXPLAIN VERBOSE +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + QUERY PLAN +---------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: pow((value2)::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM odbc_fdw_regress.s1 WHERE ((pow(value2, id) > 0)) +(4 rows) + +--Testcase 44: +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + pow +-------------- + 1 + 100 + 10000 + 8000000 + 1600000000 + 320000000000 +(6 rows) + +--Testcase 45: +EXPLAIN VERBOSE +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + QUERY PLAN +------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: power((value2)::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM odbc_fdw_regress.s1 WHERE ((power(value2, id) > 0)) +(4 rows) + +--Testcase 46: +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + power +-------------- + 1 + 100 + 10000 + 8000000 + 1600000000 + 320000000000 +(6 rows) + +--Testcase 47: +EXPLAIN VERBOSE +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: radians(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((radians(value1) > 0)) +(4 rows) + +--Testcase 48: +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + radians +----------------------- + 0.0017453292519943296 + 0.003490658503988659 + 0.005235987755982988 + 0.019198621771937627 + 0.038397243543875255 + 0.05759586531581287 +(6 rows) + +--Testcase 49: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: round(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((round(value1) > 0)) +(4 rows) + +--Testcase 50: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + round +------- + 1 + 2 + 3 +(3 rows) + +--Testcase 51: +EXPLAIN VERBOSE +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=16) + Output: sign(value3), value3 + Foreign Table Size: 6 b + Remote SQL: SELECT value3 FROM odbc_fdw_regress.s1 WHERE ((sign(value3) = (-1))) +(4 rows) + +--Testcase 52: +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + sign | value3 +------+-------- + -1 | -0.1 + -1 | -0.2 + -1 | -0.3 + -1 | -1.1 + -1 | -2.2 + -1 | -3.3 +(6 rows) + +--Testcase 53: +EXPLAIN VERBOSE +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: sin(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((sin(value1) > 0)) +(4 rows) + +--Testcase 54: +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + sin +--------------------- + 0.09983341664682815 + 0.19866933079506122 + 0.29552020666133955 + 0.8912073600614354 + 0.8084964038195901 +(5 rows) + +--Testcase 55: +EXPLAIN VERBOSE +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: sqrt(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((sqrt(value1) > 0)) +(4 rows) + +--Testcase 56: +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + sqrt +--------------------- + 0.31622776601683794 + 0.4472135954999579 + 0.5477225575051661 + 1.0488088481701516 + 1.4832396974191326 + 1.816590212458495 +(6 rows) + +--Testcase 57: +EXPLAIN VERBOSE +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: tan(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((tan(value1) > 0)) +(4 rows) + +--Testcase 58: +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + tan +--------------------- + 0.10033467208545055 + 0.2027100355086725 + 0.30933624960962325 + 1.9647596572486523 + 0.15974574766003222 +(5 rows) + +--Testcase 59: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: round(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 WHERE ((round(value1) > 0)) +(4 rows) + +--Testcase 60: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + round +------- + 1 + 2 + 3 +(3 rows) + +-- date/time function: +--Testcase 61: +EXPLAIN VERBOSE +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: date(c5) + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM odbc_fdw_regress.tbl04 WHERE ((date(c5) > '1970-01-01')) +(4 rows) + +--Testcase 62: +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + date +------------ + 01-01-2000 + 01-01-2000 + 01-01-2000 + 11-01-1990 + 11-01-2010 + 10-01-1999 + 10-01-2010 + 10-01-1999 + 10-01-2010 +(9 rows) + +-- string function: +--Testcase 63: +EXPLAIN VERBOSE +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: ascii(str1), ascii(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((ascii(str1) > 0)) +(4 rows) + +--Testcase 64: +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + ascii | ascii +-------+------- + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 +(6 rows) + +--Testcase 65: +-- for bit_length() function, postgre's core will optimize it to octet_length() * 8 and push it down +EXPLAIN VERBOSE +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=8) + Output: (octet_length(str1) * 8), (octet_length(str2) * 8) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE (((octet_length(str1) * 8) > 0)) +(4 rows) + +--Testcase 66: +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + bit_length | bit_length +------------+------------ + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 +(6 rows) + +--Testcase 67: +EXPLAIN VERBOSE +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2) + Filter: (btrim(s1.str2) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 68: +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 69: +EXPLAIN VERBOSE +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2, ' '::text) + Filter: (btrim(s1.str2, ' '::text) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 70: +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 71: +EXPLAIN VERBOSE +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: char_length(str1), char_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((char_length(str1) > 0)) +(4 rows) + +--Testcase 72: +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + char_length | char_length +-------------+------------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 73: +EXPLAIN VERBOSE +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: character_length(str1), character_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((character_length(str1) > 0)) +(4 rows) + +--Testcase 74: +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + character_length | character_length +------------------+------------------ + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 75: +EXPLAIN VERBOSE +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: concat(str1, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((concat(str1, str2) LIKE '---XYZ--- XYZ ')) +(4 rows) + +--Testcase 76: +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + concat +-------------------- + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ +(6 rows) + +--Testcase 77: +EXPLAIN VERBOSE +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: concat_ws(','::text, str1, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ ')) +(4 rows) + +--Testcase 78: +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + concat_ws +--------------------- + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ +(6 rows) + +--Testcase 79: +EXPLAIN VERBOSE +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "left"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((left(str1, 3) LIKE '---')) +(4 rows) + +--Testcase 80: +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + left +------ + --- + --- + --- + --- + --- + --- +(6 rows) + +--Testcase 81: +EXPLAIN VERBOSE +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: length(str1), length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((length(str1) > 0)) +(4 rows) + +--Testcase 82: +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + length | length +--------+-------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 83: +EXPLAIN VERBOSE +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: lower(str1), lower(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((lower(str1) LIKE '%xyz%')) +(4 rows) + +--Testcase 84: +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + lower | lower +-----------+----------- + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz +(6 rows) + +--Testcase 85: +EXPLAIN VERBOSE +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: lpad(str1, 20, 'ABCD'::text), lpad(str2, 20, 'ABCD'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((lpad(str1, 20, 'ABCD') LIKE '%XYZ%')) +(4 rows) + +--Testcase 86: +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + lpad | lpad +----------------------+---------------------- + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ +(6 rows) + +--Testcase 87: +EXPLAIN VERBOSE +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str2) + Filter: (ltrim(s1.str2) ~~ 'XYZ '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 88: +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + ltrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 89: +EXPLAIN VERBOSE +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str2, ' '::text) + Filter: (ltrim(s1.str2, ' '::text) ~~ 'XYZ '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 90: +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + ltrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 91: +EXPLAIN VERBOSE +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: octet_length(str1), octet_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((octet_length(str1) > 0)) +(4 rows) + +--Testcase 92: +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + octet_length | octet_length +--------------+-------------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 93: +EXPLAIN VERBOSE +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + QUERY PLAN +---------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=4) + Output: POSITION(('X'::text) IN (str1)) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((position('X' IN str1) > 0)) +(4 rows) + +--Testcase 94: +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + position +---------- + 4 + 4 + 4 + 4 + 4 + 4 +(6 rows) + +--Testcase 95: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: regexp_replace(str1, 'X..'::text, 'xyz'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%')) +(4 rows) + +--Testcase 96: +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + regexp_replace +---------------- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- +(6 rows) + +--Testcase 97: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: regexp_replace(str1, '[Y]'::text, 'y'::text, 'i'::text) + Filter: (regexp_replace(s1.str1, '[Y]'::text, 'y'::text, 'i'::text) ~~ '%XyZ%'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 98: +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + regexp_replace +---------------- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- +(6 rows) + +--Testcase 99: +EXPLAIN VERBOSE +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: repeat(str1, 3), repeat(str2, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((repeat(str2, 3) LIKE '%X%')) +(4 rows) + +--Testcase 100: +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + repeat | repeat +-----------------------------+----------------------------- + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ +(6 rows) + +--Testcase 101: +EXPLAIN VERBOSE +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + QUERY PLAN +----------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: replace(str1, 'XYZ'::text, 'ABC'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((replace(str1, 'XYZ', 'ABC') LIKE '%A%')) +(4 rows) + +--Testcase 102: +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + replace +----------- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- +(6 rows) + +--Testcase 103: +EXPLAIN VERBOSE +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: reverse(str1), reverse(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((reverse(str1) LIKE '%ZYX%')) +(4 rows) + +--Testcase 104: +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + reverse | reverse +-----------+----------- + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX +(6 rows) + +--Testcase 105: +EXPLAIN VERBOSE +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: "right"(str1, 4), "right"(str2, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((right(str1, 4) LIKE 'Z%')) +(4 rows) + +--Testcase 106: +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + right | right +-------+------- + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z +(6 rows) + +--Testcase 107: +EXPLAIN VERBOSE +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: rpad(str1, 16, str2), rpad(str1, 4, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM odbc_fdw_regress.s1 WHERE ((rpad(str1, 16, str2) LIKE '---XYZ---%')) +(4 rows) + +--Testcase 108: +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + rpad | rpad +------------------+------ + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X +(6 rows) + +--Testcase 109: +EXPLAIN VERBOSE +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str2) + Filter: (rtrim(s1.str2) ~~ '%XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 110: +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + rtrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 111: +EXPLAIN VERBOSE +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str2, ' '::text) + Filter: (rtrim(s1.str2, ' '::text) ~~ '%XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 112: +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + rtrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 113: +EXPLAIN VERBOSE +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: substr(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((substr(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 114: +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + substr +--------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 115: +EXPLAIN VERBOSE +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: substr(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 WHERE ((substr(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 116: +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + substr +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 117: +EXPLAIN VERBOSE +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((substring(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 118: +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + substring +----------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 119: +EXPLAIN VERBOSE +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 WHERE ((substring(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 120: +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + substring +----------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 121: +EXPLAIN VERBOSE +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: SUBSTRING(str1 FROM 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 WHERE ((substring(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 122: +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + substring +----------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 123: +EXPLAIN VERBOSE +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + QUERY PLAN +------------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: SUBSTRING(str2 FROM 3 FOR 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 WHERE ((substring(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 124: +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + substring +----------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 125: +EXPLAIN VERBOSE +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(BOTH FROM str2) + Filter: (TRIM(BOTH FROM s1.str2) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 126: +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 127: +EXPLAIN VERBOSE +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(BOTH '-'::text FROM str1) + Filter: (TRIM(BOTH '-'::text FROM s1.str1) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 128: +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 129: +EXPLAIN VERBOSE +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(LEADING '-'::text FROM str1) + Filter: (TRIM(LEADING '-'::text FROM s1.str1) ~~ 'XYZ---'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 130: +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + ltrim +-------- + XYZ--- + XYZ--- + XYZ--- + XYZ--- + XYZ--- + XYZ--- +(6 rows) + +--Testcase 131: +EXPLAIN VERBOSE +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(BOTH '-'::text FROM str1) + Filter: (TRIM(BOTH '-'::text FROM s1.str1) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 132: +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 133: +EXPLAIN VERBOSE +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(TRAILING '-'::text FROM str1) + Filter: (TRIM(TRAILING '-'::text FROM s1.str1) ~~ '---XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 134: +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + rtrim +-------- + ---XYZ + ---XYZ + ---XYZ + ---XYZ + ---XYZ + ---XYZ +(6 rows) + +--Testcase 135: +EXPLAIN VERBOSE +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: upper(tag1) + Foreign Table Size: 6 b + Remote SQL: SELECT tag1 FROM odbc_fdw_regress.s1 WHERE ((upper(tag1) LIKE 'A')) +(4 rows) + +--Testcase 136: +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + upper +------- + A + A + A +(3 rows) + +-- explicit cast function: +--Testcase 137: +EXPLAIN VERBOSE +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=40) + Output: cos(((value1)::numeric)::double precision), (value1)::numeric + Filter: (cos(((s1.value1)::numeric)::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 138: +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 139: +EXPLAIN VERBOSE +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.09 rows=6 width=24) + Output: cos(((value1)::numeric(10,0))::double precision), (value1)::numeric(10,0) + Filter: (cos(((s1.value1)::numeric(10,0))::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 140: +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 1 | 0 + 1 | 0 + 1 | 0 + 0.5403023058681398 | 1 +(4 rows) + +--Testcase 141: +EXPLAIN VERBOSE +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=40) + Output: cos(((value1)::numeric)::double precision), (value1)::numeric + Filter: (cos(((s1.value1)::numeric)::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 142: +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 143: +EXPLAIN VERBOSE +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.09 rows=6 width=24) + Output: cos(((value1)::numeric(10,1))::double precision), (value1)::numeric(10,1) + Filter: (cos(((s1.value1)::numeric(10,1))::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 144: +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 145: +EXPLAIN VERBOSE +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: (value2)::character(1) + Filter: ((s1.value2)::character(1) ~~ '1'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 146: +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + value2 +-------- + 1 + 1 + 1 +(3 rows) + +--Testcase 147: +EXPLAIN VERBOSE +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=32) + Output: (value2)::character varying + Filter: (((s1.value2)::character varying)::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 148: +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 149: +EXPLAIN VERBOSE +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=28) + Output: (value2)::character(6) + Filter: ((s1.value2)::character(6) ~~ '100 '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 150: +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 151: +EXPLAIN VERBOSE +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=28) + Output: (value2)::character varying(6) + Filter: (((s1.value2)::character varying(6))::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 152: +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 153: +EXPLAIN VERBOSE +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=32) + Output: (value2)::text + Filter: ((s1.value2)::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 154: +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 155: +EXPLAIN VERBOSE +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=2) + Output: (value2)::smallint + Filter: ((s1.value2)::smallint > 20) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM odbc_fdw_regress.s1 +(5 rows) + +--Testcase 156: +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + value2 +-------- + 100 + 100 + 100 + 200 + 200 + 200 +(6 rows) + +--Testcase 157: +EXPLAIN VERBOSE +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + QUERY PLAN +------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c1)::integer + Filter: ((tbl04.c1)::integer > 20) + Foreign Table Size: 9 b + Remote SQL: SELECT c1 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 158: +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + c1 +------- + 31 + 2566 + 55 + 45021 + 122 + 75 + 6867 +(7 rows) + +--Testcase 159: +EXPLAIN VERBOSE +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=8) + Output: (c2)::double precision + Filter: ((tbl04.c2)::double precision > '20'::double precision) + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 160: +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + c2 +--------- + 128912 + 6565 + 1829812 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 161: +EXPLAIN VERBOSE +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c2)::real + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM odbc_fdw_regress.tbl04 WHERE ((CAST(c2 AS real) > 20)) +(4 rows) + +--Testcase 162: +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + c2 +-------------- + 128912 + 6565 + 1.829812e+06 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 163: +EXPLAIN VERBOSE +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c2)::real + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM odbc_fdw_regress.tbl04 WHERE ((CAST(c2 AS real) > 20)) +(4 rows) + +--Testcase 164: +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + c2 +-------------- + 128912 + 6565 + 1.829812e+06 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 165: +EXPLAIN VERBOSE +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c5)::date + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM odbc_fdw_regress.tbl04 WHERE ((CAST(c5 AS date) > '2001-01-01')) +(4 rows) + +--Testcase 166: +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + c5 +------------ + 11-01-2010 + 10-01-2010 + 10-01-2010 +(3 rows) + +--Testcase 167: +EXPLAIN VERBOSE +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=8) + Output: (c5)::time without time zone + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM odbc_fdw_regress.tbl04 WHERE ((CAST(c5 AS time) > '00:00:00')) +(4 rows) + +--Testcase 168: +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + c5 +---------- + 10:10:00 + 10:10:00 +(2 rows) + +--Testcase 169: +DROP FOREIGN TABLE s1; +--Testcase 170: +DROP FOREIGN TABLE tbl04; +--Testcase 171: +DROP USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME; +--Testcase 172: +DROP SERVER :DB_SERVERNAME CASCADE; +--Testcase 173: +DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/expected/14.0/mysql/insert.out b/expected/14.0/mysql/insert.out index 98a4809..5f92af0 100644 --- a/expected/14.0/mysql/insert.out +++ b/expected/14.0/mysql/insert.out @@ -20,10 +20,10 @@ create foreign table inserttest (col1 int4, col2 int4 NOT NULL, col3 text defaul --Testcase 5: EXPLAIN VERBOSE insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, NULL::integer, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -35,10 +35,10 @@ psql:sql/14.0/insert.sql:19: ERROR: Executing ODBC query --Testcase 7: EXPLAIN VERBOSE insert into inserttest (col2, col3) values (3, DEFAULT); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 3, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -48,10 +48,10 @@ insert into inserttest (col2, col3) values (3, DEFAULT); --Testcase 9: EXPLAIN VERBOSE insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 5, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -61,10 +61,10 @@ insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT); --Testcase 11: EXPLAIN VERBOSE insert into inserttest values (DEFAULT, 5, 'test'); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 5, 'test'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -74,10 +74,10 @@ insert into inserttest values (DEFAULT, 5, 'test'); --Testcase 13: EXPLAIN VERBOSE insert into inserttest values (DEFAULT, 7); - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 7, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -87,12 +87,12 @@ insert into inserttest values (DEFAULT, 7); --Testcase 15: EXPLAIN VERBOSE select * from inserttest; - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.inserttest (cost=25.00..29.00 rows=4 width=44) Output: col1, col2, col3, id Foreign Table Size: 4 b - Remote SQL: SELECT `col1`,`col2`,`col3`,`id` FROM `odbc_fdw_regress`.`inserttest` + Remote SQL: SELECT col1, col2, col3, id FROM odbc_fdw_regress.inserttest (4 rows) select * from inserttest; @@ -154,12 +154,12 @@ LINE 1: insert into inserttest (col1) values (DEFAULT, DEFAULT); --Testcase 24: EXPLAIN VERBOSE select * from inserttest; - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.inserttest (cost=25.00..29.00 rows=4 width=44) Output: col1, col2, col3, id Foreign Table Size: 4 b - Remote SQL: SELECT `col1`,`col2`,`col3`,`id` FROM `odbc_fdw_regress`.`inserttest` + Remote SQL: SELECT col1, col2, col3, id FROM odbc_fdw_regress.inserttest (4 rows) --Testcase 25: @@ -182,7 +182,7 @@ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT), QUERY PLAN -------------------------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.02..0.07 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) InitPlan 1 (returns $0) -> Result (cost=0.00..0.01 rows=1 width=4) Output: 2 @@ -199,12 +199,12 @@ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT), --Testcase 28: EXPLAIN VERBOSE select * from inserttest; - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Foreign Scan on public.inserttest (cost=25.00..32.00 rows=7 width=44) Output: col1, col2, col3, id Foreign Table Size: 7 b - Remote SQL: SELECT `col1`,`col2`,`col3`,`id` FROM `odbc_fdw_regress`.`inserttest` + Remote SQL: SELECT col1, col2, col3, id FROM odbc_fdw_regress.inserttest (4 rows) --Testcase 29: @@ -229,7 +229,7 @@ insert into inserttest values(30, 50, repeat('x', 10000)); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`inserttest`(`col1`, `col2`, `col3`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 30, 50, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -239,12 +239,12 @@ insert into inserttest values(30, 50, repeat('x', 10000)); --Testcase 32: EXPLAIN VERBOSE select col1, col2, char_length(col3) from inserttest; - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..33.02 rows=8 width=12) Output: col1, col2, char_length(col3) Foreign Table Size: 8 b - Remote SQL: SELECT `col1`,`col2`,`col3`,`id` FROM `odbc_fdw_regress`.`inserttest` + Remote SQL: SELECT col1, col2, col3 FROM odbc_fdw_regress.inserttest (4 rows) --Testcase 33: diff --git a/expected/14.0/mysql/new_test.out b/expected/14.0/mysql/new_test.out index 656739c..7e8b75f 100644 --- a/expected/14.0/mysql/new_test.out +++ b/expected/14.0/mysql/new_test.out @@ -21,10 +21,10 @@ CREATE FOREIGN TABLE tbl01 (id bigint OPTIONS (key 'true'), c1 int) --Testcase 5: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (166565, 1); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Insert on public.tbl01 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl01`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '166565'::bigint, 1 (4 rows) @@ -34,10 +34,10 @@ INSERT INTO tbl01 VALUES (166565, 1); --Testcase 7: EXPLAIN VERBOSE INSERT INTO tbl01 (c1) VALUES (3); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Insert on public.tbl01 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl01`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: NULL::bigint, 3 (4 rows) @@ -49,10 +49,10 @@ psql:sql/14.0/new_test.sql:25: ERROR: Executing ODBC query --Testcase 9: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (null, 4); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Insert on public.tbl01 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl01`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: NULL::bigint, 4 (4 rows) @@ -64,10 +64,10 @@ psql:sql/14.0/new_test.sql:30: ERROR: Executing ODBC query --Testcase 11: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (166565, 7); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Insert on public.tbl01 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl01`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '166565'::bigint, 7 (4 rows) @@ -85,7 +85,7 @@ INSERT INTO tbl02 VALUES (repeat('a', 255), 1, 12112.12, true); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Insert on public.tbl02 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl02`(`id`, `c1`, `c2`, `c3`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=1037) Output: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::character(255), 1, '12112.12'::double precision, true (4 rows) @@ -95,10 +95,10 @@ INSERT INTO tbl02 VALUES (repeat('a', 255), 1, 12112.12, true); --Testcase 16: EXPLAIN VERBOSE INSERT INTO tbl02 VALUES (NULL, 2, -12.23, false); - QUERY PLAN --------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Insert on public.tbl02 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl02`(`id`, `c1`, `c2`, `c3`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=1037) Output: NULL::character(255), 2, '-12.23'::double precision, false (4 rows) @@ -110,10 +110,10 @@ psql:sql/14.0/new_test.sql:48: ERROR: Executing ODBC query --Testcase 18: EXPLAIN VERBOSE INSERT INTO tbl02(c1) VALUES (3); - QUERY PLAN --------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Insert on public.tbl02 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl02`(`id`, `c1`, `c2`, `c3`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=45) Output: NULL::bpchar, 3, NULL::double precision, NULL::boolean (4 rows) @@ -127,6 +127,7 @@ psql:sql/14.0/new_test.sql:53: ERROR: Executing ODBC query ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp01'); --Testcase 20: ALTER FOREIGN TABLE tbl02 ALTER COLUMN c2 SET NOT NULL; +--Testcase 77: \dS+ tbl02 Foreign table "public.tbl02" Column | Type | Collation | Nullable | Default | FDW options | Storage | Stats target | Description @@ -140,7 +141,7 @@ FDW options: (schema 'odbc_fdw_regress', "table" 'tbl02_tmp01') --Testcase 21: INSERT INTO tbl02(id, c2) VALUES ('b', NULL); -- fail -psql:sql/14.0/new_test.sql:62: ERROR: Executing ODBC query +psql:sql/14.0/new_test.sql:63: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Column 'c2' cannot be null --Testcase 22: SELECT * FROM tbl02; -- no result @@ -153,6 +154,7 @@ SELECT * FROM tbl02; -- no result ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp02'); --Testcase 23: ALTER FOREIGN TABLE tbl02 ALTER c1 OPTIONS (key 'true'); -- now, id and c1 are key +--Testcase 78: \dS+ tbl02 Foreign table "public.tbl02" Column | Type | Collation | Nullable | Default | FDW options | Storage | Stats target | Description @@ -166,20 +168,21 @@ FDW options: (schema 'odbc_fdw_regress', "table" 'tbl02_tmp02') --Testcase 73 INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- ok +--Testcase 79: INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- fail -psql:sql/14.0/new_test.sql:75: ERROR: Executing ODBC query +psql:sql/14.0/new_test.sql:78: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Duplicate entry 'a-12112' for key 'tbl02_tmp02.PRIMARY' --Testcase 74 INSERT INTO tbl02(id, c1) VALUES ('a', 13113.13); -- ok --Testcase 24: EXPLAIN VERBOSE SELECT * FROM tbl02; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------- Foreign Scan on public.tbl02 (cost=25.00..27.00 rows=2 width=1037) Output: id, c1, c2, c3 Foreign Table Size: 2 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3` FROM `odbc_fdw_regress`.`tbl02_tmp02` + Remote SQL: SELECT id, c1, c2, c3 FROM odbc_fdw_regress.tbl02_tmp02 (4 rows) --Testcase 25: @@ -196,10 +199,10 @@ CREATE FOREIGN TABLE tbl03 (id timestamp OPTIONS (key 'true'), c1 int) --Testcase 33: EXPLAIN VERBOSE INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 0); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.tbl03 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl03`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl03(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'Sat Jan 01 00:00:00 2000'::timestamp without time zone, 0 (4 rows) @@ -209,17 +212,17 @@ INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 0); --Testcase 35: EXPLAIN VERBOSE INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 1); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.tbl03 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`tbl03`(`id`, `c1`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.tbl03(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'Sat Jan 01 00:00:00 2000'::timestamp without time zone, 1 (4 rows) --Testcase 36: INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 1); --fail -psql:sql/14.0/new_test.sql:95: ERROR: Executing ODBC query +psql:sql/14.0/new_test.sql:98: ERROR: Executing ODBC query [MySQL][ODBC 8.0(w) Driver][mysqld-8.0.27]Duplicate entry '2000-01-01 00:00:00' for key 'tbl03.PRIMARY' --WHERE clause push-down with functions in WHERE --Testcase 37: @@ -228,14 +231,13 @@ CREATE FOREIGN TABLE tbl04 (id INT OPTIONS (key 'true'), c1 float8, c2 bigint, --Testcase 38: EXPLAIN VERBOSE SELECT * FROM tbl04 WHERE abs(c1) > 3233; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) Output: id, c1, c2, c3, c4, c5 - Filter: (abs(tbl04.c1) > '3233'::double precision) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((abs(c1) > 3233)) +(4 rows) --Testcase 39: SELECT * FROM tbl04 WHERE abs(c1) > 3233; @@ -248,14 +250,13 @@ SELECT * FROM tbl04 WHERE abs(c1) > 3233; --Testcase 40: EXPLAIN VERBOSE SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=20) Output: id, c1, c2 - Filter: ((tbl04.c1 >= '0'::double precision) AND (tbl04.c2 > 0) AND (sqrt((tbl04.c2)::double precision) > sqrt(tbl04.c1))) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c1 >= 0)) AND ((c2 > 0)) AND ((sqrt(c2) > sqrt(c1))) +(4 rows) --Testcase 41: SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; @@ -272,14 +273,13 @@ SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; --Testcase 42: EXPLAIN VERBOSE SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: c1, c2 - Filter: ((tbl04.c3 || tbl04.c3) <> 'things thing'::text) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c3 || c3) <> 'things thing')) +(4 rows) --Testcase 43: SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; @@ -299,14 +299,13 @@ SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; --Testcase 44: EXPLAIN VERBOSE SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------ Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=44) Output: c1, id, (c3 || c3) - Filter: ((abs(tbl04.c2))::double precision <> abs(tbl04.c1)) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT id, c1, c3 FROM odbc_fdw_regress.tbl04 WHERE ((abs(c2) <> abs(c1))) +(4 rows) --Testcase 45: SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); @@ -326,14 +325,13 @@ SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); --Testcase 46: EXPLAIN VERBOSE SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.05 rows=9 width=44) Output: (id + id), c2, (c3 || 'afas'::text) - Filter: (floor((tbl04.c2)::double precision) > '0'::double precision) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT id, c2, c3 FROM odbc_fdw_regress.tbl04 WHERE ((floor(c2) > 0)) +(4 rows) --Testcase 47: SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; @@ -353,14 +351,13 @@ SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; --Testcase 48: EXPLAIN VERBOSE SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------ Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=49) Output: c2, c3, c4, c5 - Filter: (tbl04.c5 > 'Sat Jan 01 00:00:00 2000'::timestamp without time zone) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((c5 > '2000-01-01 00:00:00')) +(4 rows) --Testcase 49: SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; @@ -374,14 +371,13 @@ SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; --Testcase 50: EXPLAIN VERBOSE SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=17) Output: c5, c4, c2 - Filter: (tbl04.c5 = ANY ('{"Sat Jan 01 00:00:00 2000","Mon Nov 01 00:00:00 2010"}'::timestamp without time zone[])) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(5 rows) + Remote SQL: SELECT c2, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (c5 IN ('2000-01-01 00:00:00', '2010-11-01 00:00:00')) +(4 rows) --Testcase 51: SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); @@ -393,25 +389,282 @@ SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); Mon Nov 01 00:00:00 2010 | f | 22342 (4 rows) ---Testcase 52: +--Testcase 245: EXPLAIN VERBOSE -SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id IN (1, 2, 3)) +(4 rows) + +--Testcase 246: +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(3 rows) + +--Testcase 247: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + QUERY PLAN +----------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id NOT IN (1, 2, 3)) +(4 rows) + +--Testcase 248: +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(6 rows) + +--Testcase 249: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); + QUERY PLAN +------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id IN (1, 3) OR (id = c2))) +(4 rows) + +--Testcase 250: +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(2 rows) + +--Testcase 251: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id NOT IN (1, 3)) AND ((id <> c2)) +(4 rows) + +--Testcase 252: +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(7 rows) + +--Testcase 253: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); + QUERY PLAN +------------------------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id NOT IN (c2, 2, 3)) +(4 rows) + +--Testcase 254: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+--------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(7 rows) + +--Testcase 255: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id = c2) AND (id = 2) AND (id = 3)) +(4 rows) + +--Testcase 256: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----+----+----+----+---- +(0 rows) + +--Testcase 257: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id <> c2) OR (id <> 2) OR (id <> 3)) +(4 rows) + +--Testcase 258: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(9 rows) + +--Testcase 259: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); QUERY PLAN -------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id IN (c2, 2, 3)) +(4 rows) + +--Testcase 260: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+---------+----+-------------------------- + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(2 rows) + +--Testcase 261: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); + QUERY PLAN +----------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id NOT IN (1, 2, 3)) +(4 rows) + +--Testcase 262: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(6 rows) + +--Testcase 263: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id = 1) AND (id = 2) AND (id = 3)) +(4 rows) + +--Testcase 264: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----+----+----+----+---- +(0 rows) + +--Testcase 265: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE ((id <> 1) OR (id <> 2) OR (id <> 3)) +(4 rows) + +--Testcase 266: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(9 rows) + +--Testcase 267: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM odbc_fdw_regress.tbl04 WHERE (id IN (1, 2, 3)) +(4 rows) + +--Testcase 268: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(3 rows) + +--Testcase 52: +EXPLAIN VERBOSE +SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); + QUERY PLAN +---------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=48) Output: tbl04.c3, tbl04.c5, tbl04.c1 Filter: (SubPlan 1) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c3, c5 FROM odbc_fdw_regress.tbl04 SubPlan 1 -> Materialize (cost=25.00..34.05 rows=9 width=4) Output: tbl04_1.id -> Foreign Scan on public.tbl04 tbl04_1 (cost=25.00..34.00 rows=9 width=4) Output: tbl04_1.id - Filter: tbl04_1.c4 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(13 rows) + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 WHERE (c4) +(12 rows) --Testcase 53: SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); @@ -429,20 +682,19 @@ SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true --Testcase 54: EXPLAIN VERBOSE SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 != false) AND c1 > 0 OR c2 < 0; - QUERY PLAN --------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=56) Output: tbl04.c1, tbl04.c5, tbl04.c3, tbl04.c2 Filter: (((hashed SubPlan 1) AND (tbl04.c1 > '0'::double precision)) OR (tbl04.c2 < 0)) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2, c3, c5 FROM odbc_fdw_regress.tbl04 SubPlan 1 -> Foreign Scan on public.tbl04 tbl04_1 (cost=25.00..34.00 rows=9 width=8) Output: tbl04_1.c1 - Filter: tbl04_1.c4 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(11 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_regress.tbl04 WHERE (c4) +(10 rows) --Testcase 55: SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 != false) AND c1 > 0 OR c2 < 0; @@ -455,14 +707,14 @@ SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 ! --Testcase 56: EXPLAIN VERBOSE SELECT variance(c1), variance(c2) FROM tbl04; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.05..34.06 rows=1 width=40) Output: variance(c1), variance(c2) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 (6 rows) --Testcase 57: @@ -475,16 +727,15 @@ SELECT variance(c1), variance(c2) FROM tbl04; --Testcase 58: EXPLAIN VERBOSE SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Aggregate (cost=34.02..34.03 rows=1 width=8) Output: variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=8) Output: id, c1, c2, c3, c4, c5 - Filter: (tbl04.c3 <> 'aef'::text) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(7 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_regress.tbl04 WHERE ((c3 <> 'aef')) +(6 rows) --Testcase 59: SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; @@ -496,14 +747,14 @@ SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; --Testcase 60: EXPLAIN VERBOSE SELECT max(id), min(c1), variance(c2) FROM tbl04; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.07..34.08 rows=1 width=44) Output: max(id), min(c1), variance(c2) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=20) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 (6 rows) --Testcase 61: @@ -516,14 +767,14 @@ SELECT max(id), min(c1), variance(c2) FROM tbl04; --Testcase 62: EXPLAIN VERBOSE SELECT variance(c2), variance(c1) FROM tbl04; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.05..34.06 rows=1 width=40) Output: variance(c2), variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 (6 rows) --Testcase 63: @@ -536,16 +787,15 @@ SELECT variance(c2), variance(c1) FROM tbl04; --Testcase 64: EXPLAIN VERBOSE SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Aggregate (cost=34.05..34.06 rows=1 width=16) Output: sum(c1), variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=8) Output: id, c1, c2, c3, c4, c5 - Filter: (tbl04.id <= 10) Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` -(7 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_regress.tbl04 WHERE ((id <= 10)) +(6 rows) --Testcase 65: SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; @@ -558,15 +808,15 @@ SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; --Testcase 66: EXPLAIN VERBOSE SELECT count(c1), sum(c2), variance(c2) FROM tbl04 HAVING (count(c1) > 0); - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.07..34.09 rows=1 width=72) Output: count(c1), sum(c2), variance(c2) Filter: (count(tbl04.c1) > 0) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 (7 rows) --Testcase 67: @@ -579,15 +829,15 @@ SELECT count(c1), sum(c2), variance(c2) FROM tbl04 HAVING (count(c1) > 0); --Testcase 68: EXPLAIN VERBOSE SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 AND variance(c2) > 55.54; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.10..34.12 rows=1 width=64) Output: ((count(c1))::numeric + sum(c2)), (variance(c2) / 2.12) Filter: ((count(tbl04.c4) <> 0) AND (variance(tbl04.c2) > 55.54)) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=17) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT `id`,`c1`,`c2`,`c3`,`c4`,`c5` FROM `odbc_fdw_regress`.`tbl04` + Remote SQL: SELECT c1, c2, c4 FROM odbc_fdw_regress.tbl04 (7 rows) --Testcase 69: @@ -597,9 +847,1897 @@ SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 2022757 | 171661843805.39832285 (1 row) +--Testcase 241: +EXPLAIN VERBOSE +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (count(c1)), (sum(c2)) + Filter: ((count(tbl04.c1)) > 0) + Foreign Table Size: 9 b + Remote SQL: SELECT count(c1), sum(c2) FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 242: +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); + count | sum +-------+--------- + 9 | 2022748 +(1 row) + +--Testcase 243: +EXPLAIN VERBOSE +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=32) + Output: (((count(c1))::numeric + sum(c2))) + Filter: (((count(tbl04.c4)) <> 0) AND ((avg(tbl04.c2)) > 55.54)) + Foreign Table Size: 9 b + Remote SQL: SELECT (count(c1) + sum(c2)), count(c4), avg(c2) FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 244: +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + ?column? +---------- + 2022757 +(1 row) + +--aggregation function push-down: +-- avg +--Testcase 80: +EXPLAIN VERBOSE +SELECT avg(c1), avg(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (avg(c1)), ((avg(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT avg(c1), (avg(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 81: +SELECT avg(c1), avg(c2) + 1 FROM tbl04; + avg | ?column? +-------------------+------------- + 6068.354677777777 | 224750.7778 +(1 row) + +-- avg(DISTINCT) +--Testcase 82: +EXPLAIN VERBOSE +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (avg(DISTINCT c1)), (avg(DISTINCT c2)) + Foreign Table Size: 9 b + Remote SQL: SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 83: +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + avg | avg +-------------------+------------- + 6068.354677777777 | 224749.7778 +(1 row) + +-- bit_and +--Testcase 84: +EXPLAIN VERBOSE +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=12) + Output: (bit_and(id)), ((bit_and(c2) + 1)) + Foreign Table Size: 9 b + Remote SQL: SELECT bit_and(id), (bit_and(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 85: +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; + bit_and | ?column? +---------+---------- + 0 | 1 +(1 row) + +-- bit_and(DISTINCT) +--Testcase 86: +EXPLAIN VERBOSE +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.05 rows=1 width=12) + Output: bit_and(DISTINCT id), bit_and(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 87: +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + bit_and | bit_and +---------+--------- + 0 | 0 +(1 row) + +-- bit_or +--Testcase 88: +EXPLAIN VERBOSE +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=12) + Output: (bit_or(id)), ((bit_or(c2) + 1)) + Foreign Table Size: 9 b + Remote SQL: SELECT bit_or(id), (bit_or(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 89: +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; + bit_or | ?column? +--------+---------- + 15 | 1835008 +(1 row) + +-- bit_or(DISTINCT) +--Testcase 90: +EXPLAIN VERBOSE +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.05 rows=1 width=12) + Output: bit_or(DISTINCT id), bit_or(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 91: +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + bit_or | bit_or +--------+--------- + 15 | 1835007 +(1 row) + +-- count +--Testcase 92: +EXPLAIN VERBOSE +SELECT count(c1), count(c2), count(c3) FROM tbl04; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=24) + Output: (count(c1)), (count(c2)), (count(c3)) + Foreign Table Size: 9 b + Remote SQL: SELECT count(c1), count(c2), count(c3) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 93: +SELECT count(c1), count(c2), count(c3) FROM tbl04; + count | count | count +-------+-------+------- + 9 | 9 | 9 +(1 row) + +-- count(DISTINCT) +--Testcase 94: +EXPLAIN VERBOSE +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=24) + Output: (count(DISTINCT c1)), (count(DISTINCT c2)), (count(DISTINCT c3)) + Foreign Table Size: 9 b + Remote SQL: SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 95: +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + count | count | count +-------+-------+------- + 9 | 9 | 5 +(1 row) + +-- max/min +--Testcase 241: +EXPLAIN VERBOSE +SELECT max(c1), min(c1) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=16) + Output: (max(c1)), (min(c1)) + Foreign Table Size: 9 b + Remote SQL: SELECT max(c1), min(c1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 242: +SELECT max(c1), min(c1) FROM tbl04; + max | min +----------+---------- + 45021.21 | -121.122 +(1 row) + +-- max/min (DISTINCT) +--Testcase 243: +EXPLAIN VERBOSE +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=16) + Output: (max(DISTINCT c1)), (min(DISTINCT c1)) + Foreign Table Size: 9 b + Remote SQL: SELECT max(DISTINCT c1), min(DISTINCT c1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 244: +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + max | min +----------+---------- + 45021.21 | -121.122 +(1 row) + +-- stddev +--Testcase 96: +EXPLAIN VERBOSE +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev(c1), (stddev(c2) + '1'::numeric) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 97: +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; + stddev | ?column? +-------------------+----------------- + 14787.10013608647 | 603261.39888878 +(1 row) + +-- stddev(DISTINCT) +--Testcase 98: +EXPLAIN VERBOSE +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev(DISTINCT c1), stddev(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 99: +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + stddev | stddev +-------------------+----------------- + 14787.10013608647 | 603260.39888878 +(1 row) + +-- stddev_pop +--Testcase 100: +EXPLAIN VERBOSE +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (stddev_pop(c1)), ((stddev_pop(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT stddev_pop(c1), (stddev_pop(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 101: +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; + stddev_pop | ?column? +--------------------+------------------- + 13941.411707081685 | 568760.3585007397 +(1 row) + +-- stddev_pop(DISTINCT) +--Testcase 102: +EXPLAIN VERBOSE +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 103: +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + stddev_pop | stddev_pop +--------------------+----------------- + 13941.411707081685 | 568759.35850074 +(1 row) + +-- stddev_samp +--Testcase 104: +EXPLAIN VERBOSE +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (stddev_samp(c1)), ((stddev_samp(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT stddev_samp(c1), (stddev_samp(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 105: +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; + stddev_samp | ?column? +-------------------+------------------- + 14787.10013608647 | 603261.3988887755 +(1 row) + +-- stddev_samp(DISTINCT) +--Testcase 106: +EXPLAIN VERBOSE +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 107: +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + stddev_samp | stddev_samp +-------------------+----------------- + 14787.10013608647 | 603260.39888878 +(1 row) + +-- sum +--Testcase 108: +EXPLAIN VERBOSE +SELECT sum(c1), sum(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (sum(c1)), ((sum(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT sum(c1), (sum(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 109: +SELECT sum(c1), sum(c2) + 1 FROM tbl04; + sum | ?column? +------------+---------- + 54615.1921 | 2022749 +(1 row) + +-- sum(DISTINCT) +--Testcase 110: +EXPLAIN VERBOSE +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (sum(DISTINCT c1)), (sum(DISTINCT c2)) + Foreign Table Size: 9 b + Remote SQL: SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 111: +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + sum | sum +-------------------+--------- + 54615.19209999999 | 2022748 +(1 row) + +-- var_pop +--Testcase 112: +EXPLAIN VERBOSE +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (var_pop(c1)), ((var_pop(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT var_pop(c1), (var_pop(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 113: +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; + var_pop | ?column? +--------------------+-------------------- + 194362960.38635424 | 323487207883.17285 +(1 row) + +-- var_pop(DISTINCT) +--Testcase 114: +EXPLAIN VERBOSE +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: var_pop(DISTINCT c1), var_pop(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 115: +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + var_pop | var_pop +--------------------+----------------------- + 194362960.38635424 | 323487207882.17283951 +(1 row) + +-- var_samp +--Testcase 116: +EXPLAIN VERBOSE +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (var_samp(c1)), ((var_samp(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT var_samp(c1), (var_samp(c2) + 1) FROM odbc_fdw_regress.tbl04 +(4 rows) + +--Testcase 117: +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; + var_samp | ?column? +-------------------+-------------------- + 218658330.4346485 | 363923108868.44446 +(1 row) + +-- var_samp(DISTINCT) +--Testcase 118: +EXPLAIN VERBOSE +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: var_samp(DISTINCT c1), var_samp(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 119: +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + var_samp | var_samp +-------------------+----------------------- + 218658330.4346485 | 363923108867.44444444 +(1 row) + +-- variance(DISTINCT) +--Testcase 120: +EXPLAIN VERBOSE +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: variance(DISTINCT c1), variance(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 121: +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + variance | variance +-------------------+----------------------- + 218658330.4346485 | 363923108867.44444444 +(1 row) + +-- non-push down case: +--Testcase 122: +EXPLAIN VERBOSE +SELECT corr(id, c1) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=8) + Output: corr((id)::double precision, c1) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1 FROM odbc_fdw_regress.tbl04 +(6 rows) + +--Testcase 123: +SELECT corr(id, c1) FROM tbl04; + corr +--------------------- + 0.20164072965667135 +(1 row) + +-- =================================================================== +-- WHERE push-down +-- =================================================================== +-- add some null record +--Testcase 124: +INSERT INTO tbl04 VALUES (11, -1.12, NULL, '(!)JAWLFJ', false, '2010-11-01 00:00:00'); +--Testcase 125: +INSERT INTO tbl04 VALUES (12, 45021.21, 2121, 'example', NULL, '1999-10-01 00:00:00'); +--Testcase 126: +INSERT INTO tbl04 VALUES (13, 121.9741, 23241, 'thing', NULL, '2010-10-01 00:00:00'); +--Testcase 127: +INSERT INTO tbl04 VALUES (14, 75, 316, 'example', NULL, '1999-10-01 10:10:00'); +--Testcase 128: +INSERT INTO tbl04 VALUES (15, 6867.34, 8916, NULL, false, '2010-10-01 10:10:00'); +-- Logical operator +--Testcase 129: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c1 >= 0) OR ((c2 > 0) AND (NOT c4)))) +(4 rows) + +--Testcase 130: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + id | c1 | c2 +----+----------+-------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 131: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c1 >= 0) OR c4)) +(4 rows) + +--Testcase 132: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 133: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + QUERY PLAN +---------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (c4) AND ((c1 >= 0)) +(4 rows) + +--Testcase 134: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + id | c1 | c2 +----+-------+-------- + 1 | 31.12 | 128912 +(1 row) + +--Testcase 135: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((NOT c4)) +(4 rows) + +--Testcase 136: +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 15 | 6867.34 | 8916 +(9 rows) + +-- Comparison operator +--Testcase 137: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id > 1)) +(4 rows) + +--Testcase 138: +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + id | c1 | c2 +----+----------+--------- + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 139: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id >= 1)) +(4 rows) + +--Testcase 140: +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 141: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id < 2)) +(4 rows) + +--Testcase 142: +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + id | c1 | c2 +----+-------+-------- + 1 | 31.12 | 128912 +(1 row) + +--Testcase 143: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id <= 2)) +(4 rows) + +--Testcase 144: +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + id | c1 | c2 +----+---------+-------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 +(2 rows) + +--Testcase 145: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id = 2)) +(4 rows) + +--Testcase 146: +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + id | c1 | c2 +----+---------+------ + 2 | 2565.56 | 6565 +(1 row) + +--Testcase 147: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id <> 2)) +(4 rows) + +--Testcase 148: +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 149: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id <> 2)) +(4 rows) + +--Testcase 150: +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 151: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((id < 1) OR (id > 5))) +(4 rows) + +--Testcase 152: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + id | c1 | c2 +----+----------+------- + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 153: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((id <= c2)) AND ((id >= c1)) +(4 rows) + +--Testcase 154: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + id | c1 | c2 +----+----------+--------- + 3 | -121.122 | 1829812 + 5 | -1.12 | 22342 +(2 rows) + +--Testcase 155: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((id < 1) OR (id > 5))) AND (((id < 5) OR (id > 1))) +(4 rows) + +--Testcase 156: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + id | c1 | c2 +----+----------+------- + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 157: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((((id >= c1) AND (id <= c2)) OR ((id >= c2) AND (id <= c1)))) +(4 rows) + +--Testcase 158: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + id | c1 | c2 +----+----------+--------- + 3 | -121.122 | 1829812 + 5 | -1.12 | 22342 +(2 rows) + +--Testcase 159: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: (tbl04.c1 IS DISTINCT FROM '2'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 160: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 161: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: (tbl04.c1 IS DISTINCT FROM (tbl04.id)::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 162: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 163: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c3 IS NULL)) +(4 rows) + +--Testcase 164: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + id | c1 | c2 +----+---------+------ + 15 | 6867.34 | 8916 +(1 row) + +--Testcase 165: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c3 IS NOT NULL)) +(4 rows) + +--Testcase 166: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 +(13 rows) + +--Testcase 167: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c4 IS TRUE)) +(4 rows) + +--Testcase 168: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 +(2 rows) + +--Testcase 169: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c4 IS FALSE)) +(4 rows) + +--Testcase 170: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 171: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c4 IS NOT TRUE)) +(4 rows) + +--Testcase 172: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 173: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((c4 IS NOT FALSE)) +(4 rows) + +--Testcase 174: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 +(5 rows) + +--Testcase 175: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=13) + Output: id, c1, c4 + Filter: (tbl04.c4 IS UNKNOWN) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c4 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 176: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + id | c1 | c4 +----+----------+---- + 12 | 45021.21 | + 13 | 121.9741 | + 14 | 75 | +(3 rows) + +--Testcase 177: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=13) + Output: id, c1, c4 + Filter: (tbl04.c4 IS NOT UNKNOWN) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c4 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 178: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down + id | c1 | c4 +----+----------+---- + 1 | 31.12 | t + 2 | 2565.56 | f + 3 | -121.122 | t + 4 | 55.23 | f + 5 | -1.12 | f + 6 | 45021.21 | f + 7 | 121.9741 | f + 8 | 75 | f + 9 | 6867.34 | f + 11 | -1.12 | f + 15 | 6867.34 | f +(11 rows) + +-- Mathematical operator +--Testcase 179: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id * 100 + 100 > c2; + QUERY PLAN +----------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE ((((id * 100) + 100) > c2)) +(4 rows) + +--Testcase 180: +SELECT id, c1, c2 FROM tbl04 WHERE c1 * 100 + 100 > c2; + id | c1 | c2 +----+----------+------ + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(8 rows) + +--Testcase 181: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c2 - c1) < 0)) +(4 rows) + +--Testcase 182: +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + id | c1 | c2 +----+----------+------ + 6 | 45021.21 | 2121 + 12 | 45021.21 | 2121 +(2 rows) + +--Testcase 183: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: ((tbl04.c2 / 100) > 0) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 184: +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 185: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM odbc_fdw_regress.tbl04 WHERE (((c2 % 2) = 1)) +(4 rows) + +--Testcase 186: +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 +(6 rows) + +--Testcase 187: +EXPLAIN VERBOSE +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, ((id)::double precision ^ '2'::double precision) + Filter: (((tbl04.id)::double precision ^ '2'::double precision) > '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 188: +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + id | ?column? +----+---------- + 3 | 9 + 4 | 16 + 5 | 25 + 6 | 36 + 7 | 49 + 8 | 64 + 9 | 81 + 11 | 121 + 12 | 144 + 13 | 169 + 14 | 196 + 15 | 225 +(12 rows) + +--Testcase 189: +EXPLAIN VERBOSE +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, (|/ (id)::double precision) + Filter: ((|/ (tbl04.id)::double precision) < '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 190: +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + id | ?column? +----+-------------------- + 1 | 1 + 2 | 1.4142135623730951 + 3 | 1.7320508075688772 + 4 | 2 + 5 | 2.23606797749979 + 6 | 2.449489742783178 + 7 | 2.6457513110645907 + 8 | 2.8284271247461903 + 9 | 3 + 11 | 3.3166247903554 + 12 | 3.4641016151377544 + 13 | 3.605551275463989 + 14 | 3.7416573867739413 + 15 | 3.872983346207417 +(14 rows) + +--Testcase 191: +EXPLAIN VERBOSE +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, (||/ (id)::double precision) + Filter: ((||/ (tbl04.id)::double precision) < '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 192: +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + id | ?column? +----+-------------------- + 1 | 1 + 2 | 1.2599210498948734 + 3 | 1.4422495703074083 + 4 | 1.5874010519681996 + 5 | 1.7099759466766968 + 6 | 1.8171205928321394 + 7 | 1.9129311827723894 + 8 | 2 + 9 | 2.080083823051904 + 11 | 2.2239800905693157 + 12 | 2.2894284851066633 + 13 | 2.3513346877207577 + 14 | 2.4101422641752306 + 15 | 2.46621207433047 +(14 rows) + +--Testcase 193: +EXPLAIN VERBOSE +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=12) + Output: id, (@ c2) + Filter: ((@ tbl04.c2) < 1000) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 194: +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + id | ?column? +----+---------- + 4 | 523 + 8 | 316 + 14 | 316 +(3 rows) + +--Testcase 195: +EXPLAIN VERBOSE +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id & 123) + Filter: ((tbl04.id & 123) < 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 196: +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + id | ?column? +----+---------- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 0 + 5 | 1 + 6 | 2 + 7 | 3 +(7 rows) + +--Testcase 197: +EXPLAIN VERBOSE +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=12) + Output: id, ('123'::bigint | c2) + Filter: (('123'::bigint | tbl04.c2) > 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c2 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 198: +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + id | ?column? +----+---------- + 1 | 129019 + 2 | 6655 + 3 | 1829887 + 4 | 635 + 5 | 22399 + 6 | 2171 + 7 | 23291 + 8 | 383 + 9 | 8959 + 12 | 2171 + 13 | 23291 + 14 | 383 + 15 | 8959 +(13 rows) + +--Testcase 199: +EXPLAIN VERBOSE +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id # 324) + Filter: ((tbl04.id # 324) > 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 200: +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + id | ?column? +----+---------- + 1 | 325 + 2 | 326 + 3 | 327 + 4 | 320 + 5 | 321 + 6 | 322 + 7 | 323 + 8 | 332 + 9 | 333 + 11 | 335 + 12 | 328 + 13 | 329 + 14 | 330 + 15 | 331 +(14 rows) + +--Testcase 201: +EXPLAIN VERBOSE +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (~ id) + Filter: ((~ tbl04.id) < '-2'::integer) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 202: +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + id | ?column? +----+---------- + 2 | -3 + 3 | -4 + 4 | -5 + 5 | -6 + 6 | -7 + 7 | -8 + 8 | -9 + 9 | -10 + 11 | -12 + 12 | -13 + 13 | -14 + 14 | -15 + 15 | -16 +(13 rows) + +--Testcase 203: +EXPLAIN VERBOSE +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id << 2) + Filter: ((tbl04.id << 2) < 10) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 204: +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + id | ?column? +----+---------- + 1 | 4 + 2 | 8 +(2 rows) + +--Testcase 205: +EXPLAIN VERBOSE +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id >> 2) + Filter: ((tbl04.id >> 2) = 0) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 206: +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + id | ?column? +----+---------- + 1 | 0 + 2 | 0 + 3 | 0 +(3 rows) + +-- String operator +--Testcase 207: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: ((tbl04.c3) IS NFC NORMALIZED) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 208: +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + c3 +------------ + anystring + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(13 rows) + +--Testcase 209: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (NOT ((tbl04.c3) IS NFKC NORMALIZED)) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 210: +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + c3 +---- +(0 rows) + +-- Pattern matching operator +--Testcase 211: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 WHERE ((c3 LIKE '%hi%')) +(4 rows) + +--Testcase 212: +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + c3 +------- + thing + thing + thing + thing +(4 rows) + +--Testcase 213: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 WHERE ((c3 NOT LIKE '%hi%')) +(4 rows) + +--Testcase 214: +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + c3 +------------ + anystring + example + !)@(#)!_#! + (!)JAWLFJ + example + example + (!)JAWLFJ + example + example +(9 rows) + +--Testcase 215: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~~* '%Hi%'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 216: +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + c3 +------- + thing + thing + thing + thing +(4 rows) + +--Testcase 217: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~~* '%Hi%'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 218: +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + c3 +------------ + anystring + example + !)@(#)!_#! + (!)JAWLFJ + example + example + (!)JAWLFJ + example + example +(9 rows) + +--Testcase 219: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~ '^(?:.*(?:y|w).*)$'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 220: +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 221: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~ '^(?:.*(?:y|w).*)$'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 222: +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +--Testcase 223: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~ 'any.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 224: +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 225: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~* 'ANY.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 226: +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 227: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~ 'any.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 228: +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +--Testcase 229: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~* 'ANY.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 230: +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +-- test for specific type +--Testcase 231: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE inet; +--Testcase 232: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 + 1 > inet '192.168.1.100'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 + '1'::bigint) > '192.168.1.100'::inet) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 233: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE json; +--Testcase 234: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 ->> 'tag'::text) = 'test data'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 235: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE jsonb; +--Testcase 236: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 ->> 'tag'::text) = 'test data'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +--Testcase 237: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE point; +--Testcase 238: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 >> point '(1, 3)'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: (tbl04.c3 >> '(1,3)'::point) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM odbc_fdw_regress.tbl04 +(5 rows) + +-- reset c3 column type +--Testcase 239: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE text; +-- Reset data for tbl04; +--Testcase 240: +DELETE FROM tbl04 WHERE id > 10; --Testcase 70: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/14.0/new_test.sql:184: NOTICE: drop cascades to 5 other objects +psql:sql/14.0/new_test.sql:778: NOTICE: drop cascades to 5 other objects DETAIL: drop cascades to user mapping for public on server mysql_server drop cascades to foreign table tbl01 drop cascades to foreign table tbl02 diff --git a/expected/14.0/mysql/ported_postgres_fdw.out b/expected/14.0/mysql/ported_postgres_fdw.out index 87e76e2..00dcda5 100644 --- a/expected/14.0/mysql/ported_postgres_fdw.out +++ b/expected/14.0/mysql/ported_postgres_fdw.out @@ -269,8 +269,8 @@ SELECT * FROM ft1 ORDER BY c3, c1 OFFSET 100 LIMIT 10; -- single table with alias - also test that tableoid sort is not pushed to remote side --Testcase 35: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tableoid OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8, tableoid -> Sort @@ -278,7 +278,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tabl Sort Key: t1.c3, t1.c1, t1.tableoid -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, tableoid - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 36: @@ -300,8 +300,8 @@ SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tableoid OFFSET 100 LIMIT 10; -- whole-row reference --Testcase 37: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: t1.*, c3, c1 -> Sort @@ -309,7 +309,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET Sort Key: t1.c3, t1.c1 -> Foreign Scan on public.ft1 t1 Output: t1.*, c3, c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 38: @@ -338,12 +338,12 @@ SELECT * FROM ft1 WHERE false; -- with WHERE clause --Testcase 40: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1'; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------ Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c7 >= '1'::bpchar) AND (t1.c1 = 101) AND ((t1.c6)::text = '1'::text)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Filter: ((t1.c6)::text = '1'::text) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c7 >= '1')) AND ((`C_1` = 101)) (4 rows) --Testcase 41: @@ -356,15 +356,14 @@ SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1'; -- with FOR UPDATE/SHARE --Testcase 42: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------ LockRows Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* - Filter: (t1.c1 = 101) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 101)) +(5 rows) --Testcase 43: SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; @@ -375,15 +374,14 @@ SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; --Testcase 44: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------ LockRows Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* - Filter: (t1.c1 = 102) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 102)) +(5 rows) --Testcase 45: SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE; @@ -459,8 +457,8 @@ SET enable_nestloop TO false; --Testcase 53: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2."C_1" FROM ft2 t1 JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------- Limit Output: t1.c1, t2."C_1" -> Merge Join @@ -471,13 +469,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t2."C_1" Sort Key: t2."C_1" -> Foreign Scan on "S 1"."T1" t2 Output: t2."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (17 rows) --Testcase 54: @@ -501,8 +499,8 @@ SELECT t1.c1, t2."C_1" FROM ft2 t1 JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFS --Testcase 55: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2."C_1" FROM ft2 t1 LEFT JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------- Limit Output: t1.c1, t2."C_1" -> Merge Left Join @@ -513,13 +511,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t2."C_1" Sort Key: t2."C_1" -> Foreign Scan on "S 1"."T1" t2 Output: t2."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (17 rows) --Testcase 56: @@ -543,8 +541,8 @@ SELECT t1.c1, t2."C_1" FROM ft2 t1 LEFT JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") --Testcase 57: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1" FROM "S 1"."T1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------- Limit Output: t1."C_1" -> Merge Left Join @@ -555,7 +553,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c1 -> Merge Join @@ -566,13 +564,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (28 rows) --Testcase 58: @@ -597,8 +595,8 @@ SELECT t1."C_1" FROM "S 1"."T1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c --Testcase 59: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 left join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------- Limit Output: t1."C_1", t2.c1, t3.c1 -> Merge Left Join @@ -609,7 +607,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c1, t2.c1 -> Merge Left Join @@ -620,13 +618,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t2.c1 Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (28 rows) --Testcase 60: @@ -649,8 +647,8 @@ SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 left join ft1 t2 full join ft2 --Testcase 61: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 full join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------- Limit Output: t1."C_1", t2.c1, t3.c1 -> Merge Full Join @@ -661,7 +659,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t2.c1, t3.c1 Sort Key: t3.c1 @@ -673,13 +671,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (29 rows) --Testcase 62: @@ -716,14 +714,14 @@ DELETE FROM ft_empty; -- ANALYZE ft_empty; --Testcase 68: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft_empty ORDER BY c1; - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Sort Output: c1, c2 Sort Key: ft_empty.c1 -> Foreign Scan on public.ft_empty Output: c1, c2 - Remote SQL: SELECT `c1`,`c2` FROM `odbc_fdw_post`.`loct_empty` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.loct_empty (6 rows) -- =================================================================== @@ -731,113 +729,105 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft_empty ORDER BY c1; -- =================================================================== --Testcase 69: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 1; -- Var, OpExpr(b), Const - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 70: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 100 AND t1.c2 = 0; -- BoolExpr - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c1 = 100) AND (t1.c2 = 0)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 100)) AND ((c2 = 0)) +(3 rows) --Testcase 71: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NULL; -- NullTest - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 IS NULL) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` IS NULL)) +(3 rows) --Testcase 72: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NOT NULL; -- NullTest - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 IS NOT NULL) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` IS NOT NULL)) +(3 rows) --Testcase 73: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE round(abs(c1), 0) = 1; -- FuncExpr - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (round((abs(t1.c1))::numeric, 0) = '1'::numeric) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((round(abs(`C_1`), 0) = 1)) +(3 rows) --Testcase 74: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = -c1; -- OpExpr(l) - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = (- t1.c1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = (- `C_1`))) +(3 rows) --Testcase 75: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c1 IS NOT NULL) IS DISTINCT FROM (c1 IS NOT NULL); -- DistinctExpr - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c1 IS NOT NULL) IS DISTINCT FROM (t1.c1 IS NOT NULL)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 76: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = ANY(ARRAY[c2, 1, c1 + 0]); -- ScalarArrayOpExpr - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = ANY (ARRAY[t1.c2, 1, (t1.c1 + 0)])) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (`C_1` IN (c2, 1, (`C_1` + 0))) +(3 rows) --Testcase 77: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- SubscriptingRef - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = (ARRAY[t1.c1, t1.c2, 3])[1]) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 78: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c6 = E'foo''s\\bar'; -- check special chars - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c6)::text = 'foo''s\bar'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 79: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c8 = 'foo'; -- can't be sent to remote - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c8 = 'foo'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) +(3 rows) -- parameterized remote path for foreign table --Testcase 80: @@ -850,14 +840,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Hash Cond: (a.c2 = b.c1) -> Foreign Scan on "S 1"."T1" a Output: a."C_1", a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8 - Filter: (a."C_1" = 47) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 47)) -> Hash Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 -> Foreign Scan on public.ft2 b Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(12 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` +(11 rows) --Testcase 81: SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2; @@ -871,8 +860,8 @@ SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2; EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 a, ft2 b WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = upper(a.c7); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------- Merge Join Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 Merge Cond: ((a.c1 = b.c1) AND ((upper((a.c7)::text)) = ((b.c7)::text))) @@ -881,15 +870,14 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: a.c1, (upper((a.c7)::text)) -> Foreign Scan on public.ft2 a Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, upper((a.c7)::text) - Filter: ((a.c2 = 6) AND (a.c8 = 'foo'::text)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c2 = 6)) AND ((c8 = 'foo')) -> Sort Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8, ((b.c7)::text) Sort Key: b.c1, ((b.c7)::text) -> Foreign Scan on public.ft2 b Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8, b.c7 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(16 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` +(15 rows) --Testcase 83: SELECT * FROM ft2 a, ft2 b @@ -1024,27 +1012,27 @@ SELECT * FROM ft2 WHERE c1 = ANY (ARRAY(SELECT c1 FROM ft1 WHERE c1 < 5)); --Testcase 86: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 ORDER BY ft2.c1, random(); - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Sort Output: c1, c2, c3, c4, c5, c6, c7, c8, (random()) Sort Key: ft2.c1, (random()) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8, random() - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 87: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 ORDER BY ft2.c1, ft2.c3 collate "C"; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Sort Output: c1, c2, c3, c4, c5, c6, c7, c8, ((c3)::text) Sort Key: ft2.c1, ft2.c3 COLLATE "C" -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8, c3 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (6 rows) -- user-defined operator/function @@ -1065,15 +1053,12 @@ CREATE OPERATOR === ( --Testcase 90: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: count(c3) - -> Foreign Scan on public.ft1 t1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = abs(t1.c2)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan + Output: (count(c3)) + Remote SQL: SELECT count(c3) FROM odbc_fdw_post.`T1` WHERE ((`C_1` = abs(c2))) +(3 rows) --Testcase 91: SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); @@ -1085,15 +1070,12 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); --Testcase 92: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: count(c3) - -> Foreign Scan on public.ft1 t1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan + Output: (count(c3)) + Remote SQL: SELECT count(c3) FROM odbc_fdw_post.`T1` WHERE ((`C_1` = c2)) +(3 rows) --Testcase 93: SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; @@ -1106,14 +1088,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; --Testcase 94: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = postgres_fdw_abs(t1.c2)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 95: @@ -1126,14 +1108,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); --Testcase 96: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 97: @@ -1147,8 +1129,8 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 98: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -1157,7 +1139,7 @@ EXPLAIN (VERBOSE, COSTS OFF) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 99: @@ -1178,14 +1160,14 @@ ALTER EXTENSION :DB_EXTENSIONNAME ADD OPERATOR === (int, int); --Testcase 102: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = postgres_fdw_abs(t1.c2)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 103: @@ -1198,14 +1180,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); --Testcase 104: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 105: @@ -1219,8 +1201,8 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 106: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -1229,7 +1211,7 @@ EXPLAIN (VERBOSE, COSTS OFF) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 107: @@ -1250,8 +1232,8 @@ SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; --Testcase 108: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -1262,12 +1244,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (16 rows) --Testcase 109: @@ -1290,8 +1272,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 110: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t3 ON (t3.c1 = t1.c1) ORDER BY t1.c3, t1.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3, t1.c3 -> Sort @@ -1302,7 +1284,7 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t Hash Cond: (t2.c1 = t1.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: t1.c1, t1.c3, t3.c3, t3.c1 -> Hash Join @@ -1310,12 +1292,12 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t Hash Cond: (t1.c1 = t3.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (24 rows) --Testcase 111: @@ -1338,8 +1320,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t --Testcase 112: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -1350,12 +1332,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 113: @@ -1378,8 +1360,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. --Testcase 114: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1390,17 +1372,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 115: @@ -1425,22 +1407,20 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 116: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------- Hash Left Join Output: t1.c1, t1.c2, ft5.c1, ft5.c2 Hash Cond: (t1.c1 = ft5.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: (t1.c1 < 10) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T3` WHERE ((c1 < 10)) -> Hash Output: ft5.c1, ft5.c2 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2 - Filter: (ft5.c1 < 10) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(13 rows) + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` WHERE ((c1 < 10)) +(11 rows) --Testcase 117: SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10; @@ -1458,23 +1438,21 @@ SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE (t2.c1 < 10 OR t2.c1 IS NULL) AND t1.c1 < 10; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------- Hash Left Join Output: t1.c1, t1.c2, ft5.c1, ft5.c2 Hash Cond: (t1.c1 = ft5.c1) Filter: ((ft5.c1 < 10) OR (ft5.c1 IS NULL)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: (t1.c1 < 10) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T3` WHERE ((c1 < 10)) -> Hash Output: ft5.c1, ft5.c2 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2 - Filter: (ft5.c1 < 10) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(14 rows) + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` WHERE ((c1 < 10)) +(12 rows) --Testcase 119: SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) @@ -1491,8 +1469,8 @@ SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE --Testcase 120: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2.c1, t1.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -1503,12 +1481,12 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2 Hash Cond: (t2.c1 = t1.c1) -> Foreign Scan on public.ft4 t2 Output: t2.c1, t2.c2, t2.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t1.c1 -> Foreign Scan on public.ft5 t1 Output: t1.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 121: @@ -1531,8 +1509,8 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2 --Testcase 122: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1543,17 +1521,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGH Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t3 Output: t3.c1, t3.c2, t3.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (21 rows) --Testcase 123: @@ -1576,8 +1554,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGH --Testcase 124: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 45 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -1588,12 +1566,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 125: @@ -1617,8 +1595,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. --Testcase 126: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Sort Output: ft4.c1, ft5.c1 Sort Key: ft4.c1, ft5.c1 @@ -1627,15 +1605,13 @@ SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(16 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(14 rows) --Testcase 127: SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1; @@ -1654,23 +1630,21 @@ SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL --Testcase 128: EXPLAIN (VERBOSE, COSTS OFF) SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------- Limit Output: 1 -> Merge Full Join Output: 1 -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT NULL FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Materialize Output: ft5.c1, ft5.c2, ft5.c3 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2, ft5.c3 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(14 rows) + Remote SQL: SELECT NULL FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(12 rows) --Testcase 129: SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10; @@ -1693,8 +1667,8 @@ SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELE --Testcase 130: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Sort Output: ft4.c1, t2.c1, t3.c1 Sort Key: ft4.c1, t2.c1, t3.c1 @@ -1706,20 +1680,18 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 Hash Cond: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t2 Output: t2.c1, t2.c2, t2.c3 - Filter: ((t2.c1 >= 50) AND (t2.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: t3.c1 -> Foreign Scan on public.ft5 t3 Output: t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` -(24 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(22 rows) --Testcase 131: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; @@ -1737,8 +1709,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 --Testcase 132: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------- Sort Output: ft4.c1, ft4_1.c1, ft5.c1 Sort Key: ft4.c1, ft4_1.c1, ft5.c1 @@ -1751,21 +1723,18 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 Filter: ((ft4_1.c1 IS NULL) OR (ft4_1.c1 IS NOT NULL)) -> Foreign Scan on public.ft4 ft4_1 Output: ft4_1.c1, ft4_1.c2, ft4_1.c3 - Filter: ((ft4_1.c1 >= 50) AND (ft4_1.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` -(26 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(23 rows) --Testcase 133: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; @@ -1785,8 +1754,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 --Testcase 134: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1; - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------- LockRows Output: "T3".c1, ft4.c1, ft5.c1, "T3".*, ft4.*, ft5.* -> Sort @@ -1796,8 +1765,7 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER Output: "T3".c1, ft4.c1, ft5.c1, "T3".*, ft4.*, ft5.* -> Foreign Scan on "S 1"."T3" Output: "T3".c1, "T3".* - Filter: ("T3".c1 = 50) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` WHERE ((c1 = 50)) -> Materialize Output: ft4.c1, ft4.*, ft5.c1, ft5.* -> Hash Full Join @@ -1806,15 +1774,13 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER Filter: ((ft4.c1 IS NULL) OR (ft4.c1 IS NOT NULL)) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.* - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1, ft5.* -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.* - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(27 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(24 rows) --Testcase 135: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1; @@ -1834,8 +1800,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER --Testcase 136: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t3.c1 -> Sort @@ -1849,19 +1815,18 @@ SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 a Hash Cond: (t1.c1 = (t2.c1 + 1)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: ((t1.c1 >= 50) AND (t1.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` -> Hash Output: t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` -(25 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` +(24 rows) --Testcase 137: SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10; @@ -1883,8 +1848,8 @@ SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 a --Testcase 138: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -1895,17 +1860,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 139: @@ -1928,8 +1893,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 140: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1940,17 +1905,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t3 Output: t3.c1, t3.c2, t3.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (21 rows) --Testcase 141: @@ -1973,8 +1938,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT --Testcase 142: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -1985,17 +1950,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 143: @@ -2018,8 +1983,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 144: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2030,17 +1995,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 145: @@ -2063,8 +2028,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 146: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -2075,17 +2040,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 147: @@ -2108,8 +2073,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 148: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2120,17 +2085,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (21 rows) --Testcase 149: @@ -2153,8 +2118,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 150: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Right Join @@ -2165,17 +2130,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c3 FROM odbc_fdw_post.`T3` (21 rows) --Testcase 151: @@ -2198,8 +2163,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT --Testcase 152: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -2211,12 +2176,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 Filter: ((t1.c1 = t2.c1) OR (t1.c1 IS NULL)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (17 rows) --Testcase 153: @@ -2239,8 +2204,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 --Testcase 154: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t1.c3 -> Hash Full Join @@ -2249,12 +2214,12 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE Filter: (postgres_fdw_abs(t1.c1) > 0) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (14 rows) -- Option 'extensions' is not supported @@ -2263,8 +2228,8 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE --Testcase 155: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t1.c3 -> Hash Full Join @@ -2273,12 +2238,12 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE Filter: (postgres_fdw_abs(t1.c1) > 0) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (14 rows) -- ALTER SERVER :DB_SERVERNAME OPTIONS (ADD extensions :DB_EXTENSIONNAME); @@ -2287,8 +2252,8 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE --Testcase 156: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE OF t1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2301,12 +2266,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (18 rows) --Testcase 157: @@ -2328,8 +2293,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 158: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2342,12 +2307,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (18 rows) --Testcase 159: @@ -2370,8 +2335,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 160: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE OF t1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2384,12 +2349,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (18 rows) --Testcase 161: @@ -2411,8 +2376,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 162: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2425,12 +2390,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (18 rows) --Testcase 163: @@ -2453,8 +2418,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 164: EXPLAIN (VERBOSE, COSTS OFF) WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) SELECT c1_1, c2_1 FROM t ORDER BY c1_3, c1_1 OFFSET 100 LIMIT 10; - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Limit Output: t.c1_1, t.c2_1, t.c1_3 CTE t @@ -2463,12 +2428,12 @@ WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Sort Output: t.c1_1, t.c2_1, t.c1_3 Sort Key: t.c1_3, t.c1_1 @@ -2496,8 +2461,8 @@ WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t --Testcase 166: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------- Limit Output: t1.ctid, t1.*, t2.*, t1.c1, t1.c3 -> Sort @@ -2508,20 +2473,20 @@ SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER B Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.ctid, t1.*, t1.c1, t1.c3 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.*, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.*, t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (16 rows) -- SEMI JOIN, not pushed down --Testcase 167: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) ORDER BY t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1 -> Sort @@ -2533,7 +2498,7 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> HashAggregate @@ -2541,7 +2506,7 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) Group Key: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (20 rows) --Testcase 168: @@ -2564,8 +2529,8 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) --Testcase 169: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c2) ORDER BY t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1 -> Sort @@ -2576,12 +2541,12 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2 Hash Cond: (t1.c1 = t2.c2) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c2 -> Foreign Scan on public.ft2 t2 Output: t2.c2 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (16 rows) --Testcase 170: @@ -2604,8 +2569,8 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2 --Testcase 171: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2615,12 +2580,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 1 Output: t1.c1, t2.c1 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (15 rows) --Testcase 172: @@ -2643,8 +2608,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 1 --Testcase 173: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1 -> Sort @@ -2655,12 +2620,12 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft5 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` -> Hash Output: t2.c1 -> Foreign Scan on public.ft6 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 174: @@ -2674,8 +2639,8 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t --Testcase 175: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2686,12 +2651,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1. Hash Cond: (t1.c8 = t2.c8) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c8 FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1, t2.c8 -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c8 FROM odbc_fdw_post.`T1` (16 rows) --Testcase 176: @@ -2714,8 +2679,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1. --Testcase 177: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -2726,14 +2691,13 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c8 = 'foo'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(17 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` +(16 rows) --Testcase 178: SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; @@ -2758,8 +2722,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 --Testcase 179: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2.c8 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -2773,13 +2737,13 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2. Sort Key: t1.c1, t1.c8 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3, c8 FROM odbc_fdw_post.`T1` -> Sort Output: t2.c1, t2.c8 Sort Key: t2.c1, t2.c8 -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c8 FROM odbc_fdw_post.`T1` (20 rows) --Testcase 180: @@ -2802,8 +2766,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2. --Testcase 181: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) UNION SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) AS t (t1c1, t2c1) GROUP BY t1c1 ORDER BY t1c1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, (avg((t1.c1 + t2.c1))) -> Sort @@ -2821,23 +2785,23 @@ SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Join Output: t1_1.c1, t2_1.c1 Hash Cond: (t1_1.c1 = t2_1.c1) -> Foreign Scan on public.ft1 t1_1 Output: t1_1.c1, t1_1.c2, t1_1.c3, t1_1.c4, t1_1.c5, t1_1.c6, t1_1.c7, t1_1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2_1.c1 -> Foreign Scan on public.ft2 t2_1 Output: t2_1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (34 rows) --Testcase 182: @@ -2860,8 +2824,8 @@ SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 --Testcase 183: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM ft1 t2, ft2 t3 WHERE t2.c1 = t3.c1 AND t2.c2 = t1.c2) q ORDER BY t1."C_1" OFFSET 10 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: t1."C_1" -> Sort @@ -2871,7 +2835,7 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f Output: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1", t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Unique Output: t2.c1, t3.c1 -> Merge Join @@ -2883,13 +2847,13 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f -> Foreign Scan on public.ft1 t2 Output: t2.c1 Filter: (t2.c2 = t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (28 rows) --Testcase 184: @@ -2914,22 +2878,20 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f --Testcase 185: EXPLAIN (VERBOSE, COSTS OFF) SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Nested Loop Left Join Output: (13), ft2.c1 Join Filter: (13 = ft2.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: ((ft2.c1 >= 10) AND (ft2.c1 <= 15)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` >= 10)) AND ((`C_1` <= 15)) -> Materialize Output: (13) -> Foreign Scan on public.ft1 Output: 13 - Filter: (ft1.c1 = 13) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(13 rows) + Remote SQL: SELECT NULL FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 13)) +(11 rows) --Testcase 186: SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15; @@ -2947,8 +2909,8 @@ SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 O --Testcase 187: EXPLAIN (VERBOSE, COSTS OFF) SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------- Hash Right Join Output: ft4.c1, (13), ft1.c1, ft2.c1 Hash Cond: (ft1.c1 = ft4.c1) @@ -2956,21 +2918,18 @@ SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT Output: ft1.c1, ft2.c1, 13 -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Filter: (ft1.c1 = 12) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 12)) -> Materialize Output: ft2.c1 -> Foreign Scan on public.ft2 Output: ft2.c1 - Filter: (ft2.c1 = 12) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 12)) -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 10) AND (ft4.c1 <= 15)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` -(21 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 10)) AND ((c1 <= 15)) +(18 rows) --Testcase 188: SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15 ORDER BY ft4.c1; @@ -2987,8 +2946,8 @@ UPDATE ft5 SET c3 = null where c1 % 9 = 0; --Testcase 190: EXPLAIN (VERBOSE, COSTS OFF) SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- Sort Output: ft5.*, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 Sort Key: ft5.c1 @@ -2997,14 +2956,13 @@ SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 10) AND (ft4.c1 <= 30)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 10)) AND ((c1 <= 30)) -> Hash Output: ft5.*, ft5.c1, ft5.c2, ft5.c3 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1, ft5.c2, ft5.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(15 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(14 rows) --Testcase 191: SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1; @@ -3060,28 +3018,26 @@ SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = f Sort Key: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3, ft4.* - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Sort Output: ft5.c1, ft5.c2, ft5.c3, ft5.* Sort Key: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2, ft5.c3, ft5.* - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` -> Sort Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8, ft1.* Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8, ft1.* - Filter: (ft1.c1 < 100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) -> Sort Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.* Sort Key: ft2.c1 -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.* - Filter: (ft2.c1 < 100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(48 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) +(46 rows) --Testcase 197: SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = ft4.c1 @@ -3122,8 +3078,8 @@ ALTER VIEW v5 OWNER TO regress_view_owner; --Testcase 206: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: ft4.c1, ft5.c2, ft5.c1 -> Sort @@ -3134,12 +3090,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.c2, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c2, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 207: @@ -3163,8 +3119,8 @@ ALTER VIEW v4 OWNER TO regress_view_owner; --Testcase 209: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: ft4.c1, ft5.c2, ft5.c1 -> Sort @@ -3175,12 +3131,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.c2, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c2, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 210: @@ -3202,8 +3158,8 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 --Testcase 211: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: ft4.c1, t2.c2, t2.c1 -> Sort @@ -3214,12 +3170,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c Hash Cond: (ft4.c1 = t2.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 212: @@ -3243,8 +3199,8 @@ ALTER VIEW v4 OWNER TO CURRENT_USER; --Testcase 214: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: ft4.c1, t2.c2, t2.c1 -> Sort @@ -3255,12 +3211,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c Hash Cond: (ft4.c1 = t2.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1, c2 FROM odbc_fdw_post.`T4` (16 rows) --Testcase 215: @@ -3305,9 +3261,8 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 5) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(12 rows) + Remote SQL: SELECT `C_1`, c2, c6 FROM odbc_fdw_post.`T1` WHERE ((c2 < 5)) +(11 rows) --Testcase 220: select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2; @@ -3337,9 +3292,8 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 5) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2, c6 FROM odbc_fdw_post.`T1` WHERE ((c2 < 5)) +(13 rows) --Testcase 222: select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2 limit 1; @@ -3352,36 +3306,34 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran --Testcase 223: explain (verbose, costs off) select sum(c1 * (random() <= 1)::int) as sum, avg(c1) from ft1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------- Aggregate Output: sum((c1 * ((random() <= '1'::double precision))::integer)), avg(c1) -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (5 rows) -- Aggregate over join query --Testcase 224: explain (verbose, costs off) select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate Output: count(*), sum(t1.c1), avg(t2.c1) -> Nested Loop Output: t1.c1, t2.c1 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c2 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 = 6)) -> Materialize Output: t2.c1, t2.c2 -> Foreign Scan on public.ft1 t2 Output: t2.c1, t2.c2 - Filter: (t2.c2 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 = 6)) +(12 rows) --Testcase 225: select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6; @@ -3404,20 +3356,20 @@ select sum(t1.c1), count(t2.c1) from ft1 t1 inner join ft2 t2 on (t1.c1 = t2.c1) Join Filter: (((((t1.c1 * t2.c1) / (t1.c1 * t2.c1)))::double precision * random()) <= '1'::double precision) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (14 rows) -- GROUP BY clause having expressions --Testcase 227: explain (verbose, costs off) select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------- Sort Output: ((c2 / 2)), ((sum(c2) * ((c2 / 2)))) Sort Key: ((ft1.c2 / 2)) @@ -3426,7 +3378,7 @@ select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; Group Key: (ft1.c2 / 2) -> Foreign Scan on public.ft1 Output: (c2 / 2), c2 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 228: @@ -3444,8 +3396,8 @@ select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; --Testcase 229: explain (verbose, costs off) select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, sqrt(c1) order by 1, 2) x; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------- Aggregate Output: count(ft1.c2), sum(ft1.c2) -> Sort @@ -3456,7 +3408,7 @@ select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, s Group Key: ft1.c2, sqrt((ft1.c1)::double precision) -> Foreign Scan on public.ft1 Output: ft1.c2, sqrt((ft1.c1)::double precision), ft1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (11 rows) --Testcase 230: @@ -3470,8 +3422,8 @@ select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, s --Testcase 231: explain (verbose, costs off) select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by c2 order by 1, 2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- Sort Output: ((c2 * ((random() <= '1'::double precision))::integer)), ((sum(c1) * c2)), c2 Sort Key: ((ft1.c2 * ((random() <= '1'::double precision))::integer)), ((sum(ft1.c1) * ft1.c2)) @@ -3480,7 +3432,7 @@ select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 232: @@ -3503,8 +3455,8 @@ select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by --Testcase 233: explain (verbose, costs off) select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::int order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: ((c2 * ((random() <= '1'::double precision))::integer)) Sort Key: ((ft2.c2 * ((random() <= '1'::double precision))::integer)) @@ -3513,15 +3465,15 @@ select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::i Group Key: (ft2.c2 * ((random() <= '1'::double precision))::integer) -> Foreign Scan on public.ft2 Output: (c2 * ((random() <= '1'::double precision))::integer) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (9 rows) -- GROUP BY clause in various forms, cardinal, alias and constant expression --Testcase 234: explain (verbose, costs off) select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------- Sort Output: (count(c2)), c2, 5, 7.0, 9 Sort Key: ft1.c2 @@ -3530,7 +3482,7 @@ select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2 Group Key: ft1.c2, 5, 9 -> Foreign Scan on public.ft1 Output: c2, 5, 9 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 235: @@ -3554,8 +3506,8 @@ select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2 --Testcase 236: explain (verbose, costs off) select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: c2, c2, (sum(c1)) Sort Key: (sum(ft1.c1)) @@ -3564,9 +3516,8 @@ select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); Group Key: ft1.c2, ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c2, c1 - Filter: (ft1.c2 > 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 > 6)) +(9 rows) --Testcase 237: select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); @@ -3581,8 +3532,8 @@ select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); --Testcase 238: explain (verbose, costs off) select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 order by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Sort Output: c2, (sum(c1)) Sort Key: ft2.c2 @@ -3592,7 +3543,7 @@ select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 Filter: ((avg(ft2.c1) < '500'::numeric) AND (sum(ft2.c1) < 49800)) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (10 rows) --Testcase 239: @@ -3617,7 +3568,7 @@ select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having Filter: ((avg(ft1.c1) < '500'::numeric) AND ((((avg(ft1.c1) / avg(ft1.c1)))::double precision * random()) <= '1'::double precision)) -> Foreign Scan on public.ft1 Output: ft1.c5, sqrt((ft1.c2)::double precision), ft1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c5 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 241: @@ -3631,8 +3582,8 @@ select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having --Testcase 242: explain (verbose, costs off) select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- Sort Output: (sum(c1)), c2 Sort Key: (sum(ft1.c1)) @@ -3642,7 +3593,7 @@ select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 Filter: (avg((ft1.c1 * ((random() <= '1'::double precision))::integer)) > '100'::numeric) -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (10 rows) -- Remote aggregate in combination with a local Param (for the output @@ -3650,16 +3601,14 @@ select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 --Testcase 243: explain (verbose, costs off) select exists(select 1 from pg_enum), sum(c1) from ft1; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: $0, sum(ft1.c1) + QUERY PLAN +--------------------------------------------------------- + Foreign Scan + Output: $0, (sum(ft1.c1)) + Remote SQL: SELECT sum(`C_1`) FROM odbc_fdw_post.`T1` InitPlan 1 (returns $0) -> Seq Scan on pg_catalog.pg_enum - -> Foreign Scan on public.ft1 - Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) +(5 rows) --Testcase 244: select exists(select 1 from pg_enum), sum(c1) from ft1; @@ -3671,8 +3620,8 @@ select exists(select 1 from pg_enum), sum(c1) from ft1; --Testcase 245: explain (verbose, costs off) select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------- GroupAggregate Output: ($0), sum(ft1.c1) Group Key: $0 @@ -3680,7 +3629,7 @@ select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; -> Seq Scan on pg_catalog.pg_enum -> Foreign Scan on public.ft1 Output: $0, ft1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (8 rows) --Testcase 246: @@ -3695,8 +3644,8 @@ select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; --Testcase 247: explain (verbose, costs off) select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort Output: (array_agg(c1 ORDER BY c1)), c2 Sort Key: (array_agg(ft1.c1 ORDER BY ft1.c1)) @@ -3708,9 +3657,8 @@ select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Filter: (ft1.c1 < 100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(13 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) +(12 rows) --Testcase 248: select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; @@ -3732,15 +3680,14 @@ select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; --Testcase 249: explain (verbose, costs off) select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------- Aggregate Output: array_agg(c5 ORDER BY c1 DESC) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 50) AND (ft2.c2 = 6)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c5 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 50)) AND ((c2 = 6)) +(5 rows) --Testcase 250: select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; @@ -3753,8 +3700,8 @@ select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; --Testcase 251: explain (verbose, costs off) select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Sort Output: (array_agg(DISTINCT (t1.c1 % 5))), ((t2.c1 % 3)) Sort Key: (array_agg(DISTINCT (t1.c1 % 5))) @@ -3770,12 +3717,12 @@ select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2 Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (21 rows) --Testcase 252: @@ -3790,8 +3737,8 @@ select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2 --Testcase 253: explain (verbose, costs off) select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))), ((t2.c1 % 3)) Sort Key: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))) @@ -3807,12 +3754,12 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (21 rows) --Testcase 254: @@ -3843,12 +3790,12 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (21 rows) --Testcase 256: @@ -3863,8 +3810,8 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 --Testcase 257: explain (verbose, costs off) select sum(c1) filter (where c1 < 100 and c2 > 5) from ft1 group by c2 order by 1 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------- Sort Output: (sum(c1) FILTER (WHERE ((c1 < 100) AND (c2 > 5)))), c2 Sort Key: (sum(ft1.c1) FILTER (WHERE ((ft1.c1 < 100) AND (ft1.c2 > 5)))) @@ -3873,7 +3820,7 @@ select sum(c1) filter (where c1 < 100 and c2 > 5) from ft1 group by c2 order by Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 258: @@ -3903,9 +3850,8 @@ select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 f Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 = 6)) +(6 rows) --Testcase 260: select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 from ft1 where c2 = 6 group by c2; @@ -3918,8 +3864,8 @@ select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 f --Testcase 261: explain (verbose, costs off) select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Unique Output: ((SubPlan 1)) -> Sort @@ -3929,14 +3875,12 @@ select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft Output: (SubPlan 1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Filter: ((t2.c2 % 6) = 0) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE (((c2 % 6) = 0)) SubPlan 1 -> Foreign Scan on public.ft1 t1 Output: count(*) FILTER (WHERE ((t2.c2 = 6) AND (t2.c1 < 10))) - Filter: (t1.c1 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(16 rows) + Remote SQL: SELECT NULL FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 6)) +(14 rows) --Testcase 262: select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; @@ -3949,8 +3893,8 @@ select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft --Testcase 263: explain (verbose, costs off) select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Unique Output: ((SubPlan 1)) -> Sort @@ -3958,16 +3902,14 @@ select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) fro Sort Key: ((SubPlan 1)) -> Foreign Scan on public.ft2 t2 Output: (SubPlan 1) - Filter: ((t2.c2 % 6) = 0) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE (((c2 % 6) = 0)) SubPlan 1 -> Aggregate Output: count(t1.c1) FILTER (WHERE ((t2.c2 = 6) AND (t2.c1 < 10))) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(16 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 6)) +(14 rows) --Testcase 264: select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; @@ -3991,25 +3933,24 @@ select sum(c1) filter (where (c1 / c1) * random() <= 1) from ft1 group by c2 ord Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 266: explain (verbose, costs off) select sum(c2) filter (where c2 in (select c2 from ft1 where c2 < 5)) from ft1; - QUERY PLAN -------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Aggregate Output: sum(ft1.c2) FILTER (WHERE (hashed SubPlan 1)) -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` SubPlan 1 -> Foreign Scan on public.ft1 ft1_1 Output: ft1_1.c2 - Filter: (ft1_1.c2 < 5) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 5)) +(9 rows) -- Ordered-sets within aggregate --Testcase 267: @@ -4026,9 +3967,8 @@ select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10 Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c6, c1 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2, c6 FROM odbc_fdw_post.`T1` WHERE ((c2 < 10)) +(10 rows) --Testcase 268: select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10::numeric) within group (order by c1) from ft1 where c2 < 10 group by c2 having percentile_cont(c2/10::numeric) within group (order by c1) < 500 order by c2; @@ -4045,8 +3985,8 @@ select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10 --Testcase 269: explain (verbose, costs off) select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 having c1 = 6 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------- GroupAggregate Output: c1, rank(c1, c2) WITHIN GROUP (ORDER BY c1, c2), c2 Group Key: ft1.c1, ft1.c2 @@ -4055,9 +3995,8 @@ select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2 - Filter: (ft1.c1 = 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 6)) +(9 rows) --Testcase 270: select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 having c1 = 6 order by 1; @@ -4082,8 +4021,8 @@ set enable_hashagg to false; --Testcase 274: explain (verbose, costs off) select c2, least_agg(c1) from ft1 group by c2 order by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4092,7 +4031,7 @@ select c2, least_agg(c1) from ft1 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) -- Add function and aggregate into extension @@ -4105,8 +4044,8 @@ alter extension :DB_EXTENSIONNAME add aggregate least_agg(variadic items anyarra --Testcase 277: explain (verbose, costs off) select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4115,9 +4054,8 @@ select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Filter: (ft1.c2 < 100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 100)) +(9 rows) --Testcase 278: select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; @@ -4145,8 +4083,8 @@ alter extension :DB_EXTENSIONNAME drop aggregate least_agg(variadic items anyarr --Testcase 281: explain (verbose, costs off) select c2, least_agg(c1) from ft1 group by c2 order by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4155,7 +4093,7 @@ select c2, least_agg(c1) from ft1 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (9 rows) -- Cleanup @@ -4204,16 +4142,15 @@ create operator class my_op_class for type int using btree family my_op_family a --Testcase 291: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) AND ((c2 = 6)) +(6 rows) -- Update local stats on ft2 ANALYZE ft2; @@ -4236,16 +4173,15 @@ alter extension :DB_EXTENSIONNAME add operator public.>^(int, int); --Testcase 298: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) AND ((c2 = 6)) +(6 rows) --Testcase 299: select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; @@ -4272,16 +4208,15 @@ alter extension :DB_EXTENSIONNAME drop operator public.>^(int, int); --Testcase 306: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(7 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 100)) AND ((c2 = 6)) +(6 rows) -- Cleanup --Testcase 307: @@ -4301,8 +4236,8 @@ drop operator public.<^(int, int); --Testcase 313: explain (verbose, costs off) select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2); - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate Output: count(t1.c3) -> Nested Loop Left Join @@ -4310,12 +4245,12 @@ select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2); Join Filter: ((t1.c1)::double precision = (random() * (t2.c2)::double precision)) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c3 FROM odbc_fdw_post.`T1` -> Materialize Output: t2.c2 -> Foreign Scan on public.ft2 t2 Output: t2.c2 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` (13 rows) -- Subquery in FROM clause having aggregate @@ -4336,7 +4271,7 @@ select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x w Hash Cond: (ft1.c2 = x.a) -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` -> Hash Output: x.b, x.a -> Subquery Scan on x @@ -4346,7 +4281,7 @@ select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x w Group Key: ft1_1.c2 -> Foreign Scan on public.ft1 ft1_1 Output: ft1_1.c1, ft1_1.c2, ft1_1.c3, ft1_1.c4, ft1_1.c5, ft1_1.c6, ft1_1.c7, ft1_1.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` (23 rows) --Testcase 315: @@ -4383,12 +4318,12 @@ select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) gr Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` (18 rows) --Testcase 317: @@ -4405,8 +4340,8 @@ select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) gr --Testcase 318: explain (verbose, costs off) select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1); - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Aggregate Output: count(*), sum(ft4.c1), avg(ft5.c1) -> Hash Full Join @@ -4414,15 +4349,13 @@ select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 betwee Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(15 rows) + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T4` WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(13 rows) --Testcase 319: select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1); @@ -4436,17 +4369,15 @@ select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 betwee --Testcase 320: explain (verbose, costs off) select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Sort - Output: ((sum(c2) * ((random() <= '1'::double precision))::integer)) - Sort Key: ((sum(ft1.c2) * ((random() <= '1'::double precision))::integer)) - -> Aggregate - Output: (sum(c2) * ((random() <= '1'::double precision))::integer) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(8 rows) + Output: (((sum(c2)) * ((random() <= '1'::double precision))::integer)) + Sort Key: (((sum(ft1.c2)) * ((random() <= '1'::double precision))::integer)) + -> Foreign Scan + Output: ((sum(c2)) * ((random() <= '1'::double precision))::integer) + Remote SQL: SELECT sum(c2) FROM odbc_fdw_post.`T1` +(6 rows) --Testcase 321: select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1; @@ -4461,8 +4392,8 @@ set enable_hashagg to false; --Testcase 323: explain (verbose, costs off) select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum from ft2 t2 group by t2.c1) qry where t1.c2 * 2 = qry.sum and t1.c2 < 3 and t1."C_1" < 100 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------------------------------- Sort Output: t1.c2, qry.sum Sort Key: t1.c2 @@ -4470,8 +4401,7 @@ select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum fro Output: t1.c2, qry.sum -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1", t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: ((t1.c2 < 3) AND (t1."C_1" < 100)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) AND ((`C_1` < 100)) -> Subquery Scan on qry Output: qry.sum, t2.c1 Filter: ((t1.c2 * 2) = qry.sum) @@ -4483,8 +4413,8 @@ select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum fro Sort Key: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(21 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` +(20 rows) --Testcase 324: select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum from ft2 t2 group by t2.c1) qry where t1.c2 * 2 = qry.sum and t1.c2 < 3 and t1."C_1" < 100 order by 1; @@ -4521,19 +4451,16 @@ ORDER BY ref_0."C_1"; Output: ref_0.c2, ref_0."C_1", ref_1.c3, (ref_0.c2) -> Foreign Scan on "S 1"."T1" ref_0 Output: ref_0."C_1", ref_0.c2, ref_0.c3, ref_0.c4, ref_0.c5, ref_0.c6, ref_0.c7, ref_0.c8 - Filter: (ref_0."C_1" < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 10)) -> Foreign Scan on public.ft1 ref_1 Output: ref_1.c3, ref_0.c2 - Filter: (ref_1.c3 = '00001'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((c3 = '00001')) -> Materialize Output: ref_3.c3 -> Foreign Scan on public.ft2 ref_3 Output: ref_3.c3 - Filter: (ref_3.c3 = '00001'::text) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(21 rows) + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((c3 = '00001')) +(18 rows) --Testcase 327: SELECT ref_0.c2, subq_1.* @@ -4564,8 +4491,8 @@ ORDER BY ref_0."C_1"; --Testcase 328: explain (verbose, costs off) select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2.c1) from ft1 right join ft2 on (ft1.c1 = ft2.c1)) q(a, b, c) on (ft4.c1 <= q.b); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Aggregate Output: sum(q.a), count(q.b) -> Nested Loop Left Join @@ -4574,7 +4501,7 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. Join Filter: ((ft4.c1)::numeric <= q.b) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1 FROM odbc_fdw_post.`T3` -> Materialize Output: q.a, q.b -> Subquery Scan on q @@ -4586,12 +4513,12 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. Hash Cond: (ft2.c1 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` -> Hash Output: ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` (26 rows) --Testcase 329: @@ -4606,8 +4533,8 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. --Testcase 330: explain (verbose, costs off) select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: c2, (sum(c1)) Sort Key: ft1.c2 @@ -4617,9 +4544,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls la Group Key: () -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) +(10 rows) --Testcase 331: select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last; @@ -4634,8 +4560,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls la --Testcase 332: explain (verbose, costs off) select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: c2, (sum(c1)) Sort Key: ft1.c2 @@ -4645,9 +4571,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last Group Key: () -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) +(10 rows) --Testcase 333: select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last; @@ -4662,8 +4587,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last --Testcase 334: explain (verbose, costs off) select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------- Sort Output: c2, c6, (sum(c1)) Sort Key: ft1.c2, ft1.c6 @@ -4673,9 +4598,8 @@ select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) orde Hash Key: ft1.c6 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2, c6 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) +(10 rows) --Testcase 335: select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last; @@ -4692,8 +4616,8 @@ select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) orde --Testcase 336: explain (verbose, costs off) select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: c2, (sum(c1)), (GROUPING(c2)) Sort Key: ft1.c2 @@ -4702,9 +4626,8 @@ select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nu Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(10 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 3)) +(9 rows) --Testcase 337: select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last; @@ -4719,8 +4642,8 @@ select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nu --Testcase 338: explain (verbose, costs off) select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Unique Output: ((sum(c1) / 1000)), c2 -> Sort @@ -4731,9 +4654,8 @@ select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft2.c2 < 6) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(12 rows) + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 6)) +(11 rows) --Testcase 339: select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; @@ -4747,8 +4669,8 @@ select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; --Testcase 340: explain (verbose, costs off) select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Sort Output: c2, (sum(c2)), (count(c2) OVER (?)), ((c2 % 2)) Sort Key: ft2.c2 @@ -4762,9 +4684,8 @@ select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 gr Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft2.c2 < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(15 rows) + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 10)) +(14 rows) --Testcase 341: select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1; @@ -4785,8 +4706,8 @@ select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 gr --Testcase 342: explain (verbose, costs off) select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Sort Output: c2, (array_agg(c2) OVER (?)), ((c2 % 2)) Sort Key: ft1.c2 @@ -4800,9 +4721,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 wher Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(15 rows) + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 10)) +(14 rows) --Testcase 343: select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1; @@ -4823,8 +4743,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 wher --Testcase 344: explain (verbose, costs off) select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Sort Output: c2, (array_agg(c2) OVER (?)), ((c2 % 2)) Sort Key: ft1.c2 @@ -4838,9 +4758,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 range between curre Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(15 rows) + Remote SQL: SELECT c2 FROM odbc_fdw_post.`T1` WHERE ((c2 < 10)) +(14 rows) --Testcase 345: select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1; @@ -4866,21 +4785,19 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 range between curre PREPARE st1(int, int) AS SELECT t1.c3, t2.c3 FROM ft1 t1, ft2 t2 WHERE t1.c1 = $1 AND t2.c1 = $2; --Testcase 347: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st1(1, 2); - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------- Nested Loop Output: t1.c3, t2.c3 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) -> Materialize Output: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: (t2.c1 = 2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(12 rows) + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 2)) +(10 rows) --Testcase 348: EXECUTE st1(1, 1); @@ -4901,8 +4818,8 @@ EXECUTE st1(101, 101); PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c4) = '1970-01-17'::date) ORDER BY c1; --Testcase 351: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------ Sort Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 Sort Key: t1.c1 @@ -4912,8 +4829,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); Hash Cond: (t1.c3 = t2.c3) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 < 20) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 20)) -> Hash Output: t2.c3 -> HashAggregate @@ -4921,9 +4837,8 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); Group Key: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: ((t2.c1 > 10) AND (date(t2.c4) = '01-17-1970'::date)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(20 rows) + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 10)) AND ((date(c4) = '1970-01-17')) +(18 rows) --Testcase 352: EXECUTE st2(10, 20); @@ -4944,8 +4859,8 @@ EXECUTE st2(101, 121); PREPARE st3(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c5) = '1970-01-17'::date) ORDER BY c1; --Testcase 355: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------ Sort Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 Sort Key: t1.c1 @@ -4955,8 +4870,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); Hash Cond: (t1.c3 = t2.c3) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 < 20) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` < 20)) -> Hash Output: t2.c3 -> HashAggregate @@ -4964,9 +4878,8 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); Group Key: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: ((t2.c1 > 10) AND (date(t2.c5) = '01-17-1970'::date)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(20 rows) + Remote SQL: SELECT c3 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 10)) AND ((date(c5) = '1970-01-17')) +(18 rows) --Testcase 356: EXECUTE st3(10, 20); @@ -4986,63 +4899,58 @@ EXECUTE st3(20, 30); PREPARE st4(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 = $1; --Testcase 359: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 360: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 361: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 362: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) --Testcase 363: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1)) +(3 rows) -- once we try it enough times, should switch to generic plan --Testcase 364: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = $1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) -- value of $1 should not be sent to remote @@ -5050,62 +4958,57 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); PREPARE st5(text,int) AS SELECT * FROM ft1 t1 WHERE c8 = $1 and c1 = $2; --Testcase 366: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 367: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 368: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 369: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 370: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((c8 = 'foo')) AND ((`C_1` = 1)) +(3 rows) --Testcase 371: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c8 = $1) AND (t1.c1 = $2)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) --Testcase 372: @@ -5120,13 +5023,12 @@ EXECUTE st5('foo', 1); PREPARE st6 AS SELECT * FROM ft1 t1 WHERE t1.c1 = t1.c2; --Testcase 374: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = c2)) +(3 rows) --Testcase 375: PREPARE st7 AS INSERT INTO ft1 (c1,c2,c3) VALUES (1001,101,'foo'); @@ -5135,7 +5037,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft1 - Remote SQL: INSERT INTO `odbc_fdw_post`.`T1`(`C_1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.`T1`(`C_1`, c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1001, 101, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::text (4 rows) @@ -5144,13 +5046,12 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; -- ALTER FOREIGN TABLE ft1 OPTIONS (SET table 'T 0'); --Testcase 377: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(4 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = c2)) +(3 rows) --Testcase 378: EXECUTE st6; @@ -5172,7 +5073,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft1 - Remote SQL: INSERT INTO `odbc_fdw_post`.`T1`(`C_1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.`T1`(`C_1`, c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1001, 101, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::text (4 rows) @@ -5183,27 +5084,27 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; PREPARE st8 AS SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 381: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) -- ALTER SERVER :DB_SERVERNAME OPTIONS (DROP extensions); --Testcase 382: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------ Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 383: @@ -5227,14 +5128,14 @@ DEALLOCATE st8; --Testcase 384: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.tableoid = 'pg_class'::regclass LIMIT 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.tableoid = '1259'::oid) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 385: @@ -5247,13 +5148,13 @@ SELECT * FROM ft1 t1 WHERE t1.tableoid = 'ft1'::regclass LIMIT 1; --Testcase 386: EXPLAIN (VERBOSE, COSTS OFF) SELECT tableoid::regclass, * FROM ft1 t1 LIMIT 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Limit Output: ((tableoid)::regclass), c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: (tableoid)::regclass, c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (5 rows) --Testcase 387: @@ -5266,12 +5167,12 @@ SELECT tableoid::regclass, * FROM ft1 t1 LIMIT 1; --Testcase 388: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.ctid = '(0,2)'; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.ctid = '(0,2)'::tid) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (4 rows) -- Does not support system column ctid @@ -5284,13 +5185,13 @@ SELECT * FROM ft1 t1 WHERE t1.ctid = '(0,2)'; --Testcase 390: EXPLAIN (VERBOSE, COSTS OFF) SELECT ctid, * FROM ft1 t1 LIMIT 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Limit Output: ctid, c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: ctid, c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (5 rows) --Testcase 391: @@ -5399,118 +5300,113 @@ create foreign table ft3 (f1 text collate "C", f2 text, f3 varchar(10)) -- can be sent to remote --Testcase 409: explain (verbose, costs off) select * from ft3 where f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f1 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f1 = 'foo')) +(3 rows) --Testcase 410: explain (verbose, costs off) select * from ft3 where f1 COLLATE "C" = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f1 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f1 = 'foo')) +(3 rows) --Testcase 411: explain (verbose, costs off) select * from ft3 where f2 = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f2 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f2 = 'foo')) +(3 rows) --Testcase 412: explain (verbose, costs off) select * from ft3 where f3 = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f3)::text = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 413: explain (verbose, costs off) select * from ft3 f, ft3 l where f.f3 = l.f3 and l.f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Nested Loop Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3 Join Filter: ((f.f3)::text = (l.f3)::text) -> Foreign Scan on public.ft3 f Output: f.f1, f.f2, f.f3 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 -> Foreign Scan on public.ft3 l Output: l.f1, l.f2, l.f3 - Filter: (l.f1 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(10 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f1 = 'foo')) +(9 rows) -- can't be sent to remote --Testcase 414: explain (verbose, costs off) select * from ft3 where f1 COLLATE "POSIX" = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f1)::text = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 415: explain (verbose, costs off) select * from ft3 where f1 = 'foo' COLLATE "C"; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: (ft3.f1 = 'foo'::text COLLATE "C") - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 416: explain (verbose, costs off) select * from ft3 where f2 COLLATE "C" = 'foo'; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f2)::text = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 417: explain (verbose, costs off) select * from ft3 where f2 = 'foo' COLLATE "C"; - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: (ft3.f2 = 'foo'::text COLLATE "C") - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 (4 rows) --Testcase 418: explain (verbose, costs off) select * from ft3 f, ft3 l where f.f3 = l.f3 COLLATE "POSIX" and l.f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Nested Loop Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3 Join Filter: ((f.f3)::text = (l.f3)::text) -> Foreign Scan on public.ft3 f Output: f.f1, f.f2, f.f3 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 -> Foreign Scan on public.ft3 l Output: l.f1, l.f2, l.f3 - Filter: (l.f1 = 'foo'::text) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct3` -(10 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct3 WHERE ((f1 = 'foo')) +(9 rows) -- =================================================================== -- test writable foreign table stuff @@ -5521,14 +5417,14 @@ INSERT INTO ft2 (c1,c2,c3) SELECT c1+1000,c2+100, c3 || c3 FROM ft2 LIMIT 20; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft2 - Remote SQL: INSERT INTO `odbc_fdw_post`.`T1`(`C_1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.`T1`(`C_1`, c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Subquery Scan on "*SELECT*" Output: "*SELECT*"."?column?", "*SELECT*"."?column?_1", "*SELECT*"."?column?_2", NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::text -> Limit Output: ((ft2_1.c1 + 1000)), ((ft2_1.c2 + 100)), ((ft2_1.c3 || ft2_1.c3)) -> Foreign Scan on public.ft2 ft2_1 Output: (ft2_1.c1 + 1000), (ft2_1.c2 + 100), (ft2_1.c3 || ft2_1.c3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3 FROM odbc_fdw_post.`T1` (9 rows) --Testcase 420: @@ -5550,30 +5446,28 @@ INSERT INTO ft2 (c1,c2,c3) VALUES (1104,204,'ddd'), (1105,205,'eee'); --Testcase 424: EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ?, `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ?, c3 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: (c2 + 300), (c3 || '_update3'::text), c1, ft2.* - Filter: ((ft2.c1 % 10) = 3) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 3)) +(5 rows) --Testcase 425: UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3; --Testcase 426: EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ?, `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ?, c3 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: (c2 + 400), (c3 || '_update7'::text), c1, ft2.* - Filter: ((ft2.c1 % 10) = 7) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 7)) +(5 rows) --Testcase 427: UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7; @@ -5689,23 +5583,22 @@ SELECT * FROM ft2 WHERE c1 % 10 = 7 ORDER BY c1; EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT FROM ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 9; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ?, `c3` = ?, `c7` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ?, c3 = ?, c7 = ? WHERE `C_1` = ? -> Hash Join Output: (ft2.c2 + 500), (ft2.c3 || '_update9'::text), 'ft2 '::character(10), ft2.c1, ft2.*, ft1.* Hash Cond: (ft2.c2 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c2, ft2.c3, ft2.c1, ft2.* - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` -> Hash Output: ft1.*, ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.*, ft1.c1 - Filter: ((ft1.c1 % 10) = 9) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 9)) +(13 rows) --Testcase 430: UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT @@ -5713,15 +5606,14 @@ UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT --Testcase 431: EXPLAIN (verbose, costs off) DELETE FROM ft2 WHERE c1 % 10 = 5; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: c1 - Filter: ((ft2.c1 % 10) = 5) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 5)) +(5 rows) --Testcase 432: SELECT c1, c4 FROM ft2 WHERE c1 % 10 = 5; @@ -5837,23 +5729,22 @@ DELETE FROM ft2 WHERE c1 % 10 = 5; --Testcase 434: EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Hash Join Output: ft2.c1, ft1.* Hash Cond: (ft2.c2 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` -> Hash Output: ft1.*, ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.*, ft1.c1 - Filter: ((ft1.c1 % 10) = 2) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE (((`C_1` % 10) = 2)) +(13 rows) --Testcase 435: DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2; @@ -6688,7 +6579,7 @@ INSERT INTO ft2 (c1,c2,c3) VALUES (1200,999,'foo'); QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft2 - Remote SQL: INSERT INTO `odbc_fdw_post`.`T1`(`C_1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.`T1`(`C_1`, c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1200, 999, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::text (4 rows) @@ -6705,15 +6596,14 @@ SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; --Testcase 440: EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'bar' WHERE c1 = 1200; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c3 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: 'bar'::text, c1, ft2.* - Filter: (ft2.c1 = 1200) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1200)) +(5 rows) --Testcase 441: UPDATE ft2 SET c3 = 'bar' WHERE c1 = 1200; @@ -6727,15 +6617,14 @@ SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; --Testcase 443: EXPLAIN (verbose, costs off) DELETE FROM ft2 WHERE c1 = 1200; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: c1 - Filter: (ft2.c1 = 1200) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + Remote SQL: SELECT `C_1` FROM odbc_fdw_post.`T1` WHERE ((`C_1` = 1200)) +(5 rows) --Testcase 444: SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; @@ -6755,17 +6644,16 @@ EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'foo' FROM ft4 INNER JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 1200 AND ft2.c2 = ft4.c1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c3 = ? WHERE `C_1` = ? -> Hash Join Output: 'foo'::text, ft2.c1, ft2.*, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.*, ft2.c2 - Filter: (ft2.c1 > 1200) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 1200)) -> Hash Output: ft4.*, ft4.c1, ft5.*, ft5.c1 -> Hash Join @@ -6773,13 +6661,13 @@ UPDATE ft2 SET c3 = 'foo' Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(21 rows) --Testcase 448: UPDATE ft2 SET c3 = 'foo' @@ -6812,17 +6700,16 @@ EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft4 LEFT JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 1200 AND ft2.c1 % 10 = 0 AND ft2.c2 = ft4.c1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Hash Join Output: ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: ((ft2.c1 > 1200) AND ((ft2.c1 % 10) = 0)) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 1200)) AND (((`C_1` % 10) = 0)) -> Hash Output: ft4.*, ft4.c1, ft5.* -> Hash Left Join @@ -6830,13 +6717,13 @@ DELETE FROM ft2 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(21 rows) --Testcase 451: DELETE FROM ft2 @@ -6853,20 +6740,19 @@ UPDATE ft2 AS target SET (c2, c7) = ( FROM ft2 AS src WHERE target.c1 = src.c1 ) WHERE c1 > 1100; - QUERY PLAN -------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------- Update on public.ft2 target - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ?, `c7` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ?, c7 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 target Output: $1, $2, (SubPlan 1 (returns $1,$2)), target.c1, target.* - Filter: (target.c1 > 1100) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 1100)) SubPlan 1 (returns $1,$2) -> Foreign Scan on public.ft2 src Output: (src.c2 * 10), src.c7 Filter: (target.c1 = src.c1) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(11 rows) + Remote SQL: SELECT `C_1`, c2, c7 FROM odbc_fdw_post.`T1` +(10 rows) --Testcase 454: UPDATE ft2 AS target SET (c2, c7) = ( @@ -6886,23 +6772,22 @@ UPDATE ft2 AS target SET (c2) = ( EXPLAIN (VERBOSE, COSTS OFF) UPDATE ft2 d SET c2 = CASE WHEN random() >= 0 THEN d.c2 ELSE 0 END FROM ft2 AS t WHERE d.c1 = t.c1 AND d.c1 > 1000; - QUERY PLAN ------------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- Update on public.ft2 d - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c2` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c2 = ? WHERE `C_1` = ? -> Hash Join Output: CASE WHEN (random() >= '0'::double precision) THEN d.c2 ELSE 0 END, d.c1, d.*, t.* Hash Cond: (d.c1 = t.c1) -> Foreign Scan on public.ft2 d Output: d.c2, d.c1, d.* - Filter: (d.c1 > 1000) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 1000)) -> Hash Output: t.*, t.c1 -> Foreign Scan on public.ft2 t Output: t.*, t.c1 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(14 rows) + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` +(13 rows) --Testcase 457: UPDATE ft2 d SET c2 = CASE WHEN random() >= 0 THEN d.c2 ELSE 0 END @@ -6916,14 +6801,14 @@ INSERT INTO ft2 (c1,c2,c3) --Testcase 459: EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'bar' WHERE postgres_fdw_abs(c1) > 2000; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c3 = ? WHERE `C_1` = ? -> Foreign Scan on public.ft2 Output: 'bar'::text, c1, ft2.* Filter: (postgres_fdw_abs(ft2.c1) > 2000) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (6 rows) --Testcase 460: @@ -6949,17 +6834,16 @@ EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'baz' FROM ft4 INNER JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 2000 AND ft2.c2 === ft4.c1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE `odbc_fdw_post`.`T1` SET `c3` = ? WHERE `C_1` = ? + Remote SQL: UPDATE odbc_fdw_post.`T1` SET c3 = ? WHERE `C_1` = ? -> Nested Loop Output: 'baz'::text, ft2.c1, ft2.*, ft4.*, ft5.* Join Filter: (ft2.c2 === ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.*, ft2.c2 - Filter: (ft2.c1 > 2000) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 2000)) -> Materialize Output: ft4.*, ft4.c1, ft5.* -> Hash Join @@ -6967,13 +6851,13 @@ UPDATE ft2 SET c3 = 'baz' Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(21 rows) --Testcase 463: UPDATE ft2 SET c3 = 'baz' @@ -6992,17 +6876,16 @@ EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft4 INNER JOIN ft5 ON (ft4.c1 === ft5.c1) WHERE ft2.c1 > 2000 AND ft2.c2 = ft4.c1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`T1` WHERE `C_1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.`T1` WHERE `C_1` = ? -> Hash Join Output: ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: (ft2.c1 > 2000) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2 FROM odbc_fdw_post.`T1` WHERE ((`C_1` > 2000)) -> Hash Output: ft4.*, ft4.c1, ft5.* -> Nested Loop @@ -7010,13 +6893,13 @@ DELETE FROM ft2 Join Filter: (ft4.c1 === ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T3` + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T3` -> Materialize Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT `c1`,`c2`,`c3` FROM `odbc_fdw_post`.`T4` -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM odbc_fdw_post.`T4` +(21 rows) --Testcase 466: DELETE FROM ft2 @@ -7444,8 +7327,8 @@ select c2, count(*) from "S 1"."T1" where c2 < 500 group by 1 order by 1; -- ORDER BY DESC NULLS LAST options --Testcase 495: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 OFFSET 795 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7453,7 +7336,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 O Sort Key: ft1.c6 DESC NULLS LAST, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 496: @@ -7475,8 +7358,8 @@ SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 OFFSET 795 LIMIT 10; -- ORDER BY DESC NULLS FIRST options --Testcase 497: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 OFFSET 15 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7484,7 +7367,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 Sort Key: ft1.c6 DESC, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 498: @@ -7506,8 +7389,8 @@ SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 OFFSET 15 LIMIT 10; -- ORDER BY ASC NULLS FIRST options --Testcase 499: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 OFFSET 15 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7515,7 +7398,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 O Sort Key: ft1.c6 NULLS FIRST, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` + Remote SQL: SELECT `C_1`, c2, c3, c4, c5, c6, c7, c8 FROM odbc_fdw_post.`T1` (8 rows) --Testcase 500: @@ -7542,15 +7425,12 @@ SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 OFFSET 15 LIMIT 10; ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2positive CHECK (c2 >= 0); --Testcase 502: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 < 0; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: count(*) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 0) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan + Output: (count(*)) + Remote SQL: SELECT count(*) FROM odbc_fdw_post.`T1` WHERE ((c2 < 0)) +(3 rows) --Testcase 503: SELECT count(*) FROM ft1 WHERE c2 < 0; @@ -7590,15 +7470,12 @@ ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c2positive; ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2negative CHECK (c2 < 0); --Testcase 510: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 >= 0; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Aggregate - Output: count(*) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 >= 0) - Remote SQL: SELECT `C_1`,`c2`,`c3`,`c4`,`c5`,`c6`,`c7`,`c8` FROM `odbc_fdw_post`.`T1` -(6 rows) + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan + Output: (count(*)) + Remote SQL: SELECT count(*) FROM odbc_fdw_post.`T1` WHERE ((c2 >= 0)) +(3 rows) --Testcase 511: SELECT count(*) FROM ft1 WHERE c2 >= 0; @@ -7665,10 +7542,10 @@ Options: check_option=cascaded --Testcase 524: EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view VALUES (0, 5); - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Insert on public.foreign_tbl - Remote SQL: INSERT INTO `odbc_fdw_post`.`base_tbl`(`a`, `b`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.base_tbl(a, b) VALUES (?, ?) -> Result Output: 0, 5 (4 rows) @@ -7681,10 +7558,10 @@ DETAIL: Failing row contains (10, 5). --Testcase 525: EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view VALUES (0, 15); - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Insert on public.foreign_tbl - Remote SQL: INSERT INTO `odbc_fdw_post`.`base_tbl`(`a`, `b`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.base_tbl(a, b) VALUES (?, ?) -> Result Output: 0, 15 (4 rows) @@ -7702,15 +7579,14 @@ SELECT * FROM foreign_tbl; --Testcase 528: EXPLAIN (VERBOSE, COSTS OFF) UPDATE rw_view SET b = b + 5; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Update on public.foreign_tbl - Remote SQL: UPDATE `odbc_fdw_post`.`base_tbl` SET `a` = ?, `b` = ? WHERE `a` = ? + Remote SQL: UPDATE odbc_fdw_post.base_tbl SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.foreign_tbl Output: (foreign_tbl.b + 5), foreign_tbl.a, foreign_tbl.* - Filter: (foreign_tbl.a < foreign_tbl.b) - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`base_tbl` -(6 rows) + Remote SQL: SELECT a, b FROM odbc_fdw_post.base_tbl WHERE ((a < b)) +(5 rows) --Testcase 529: UPDATE rw_view SET b = b + 5; -- should fail @@ -7719,15 +7595,14 @@ DETAIL: Failing row contains (20, 20). --Testcase 530: EXPLAIN (VERBOSE, COSTS OFF) UPDATE rw_view SET b = b + 15; - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Update on public.foreign_tbl - Remote SQL: UPDATE `odbc_fdw_post`.`base_tbl` SET `a` = ?, `b` = ? WHERE `a` = ? + Remote SQL: UPDATE odbc_fdw_post.base_tbl SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.foreign_tbl Output: (foreign_tbl.b + 15), foreign_tbl.a, foreign_tbl.* - Filter: (foreign_tbl.a < foreign_tbl.b) - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`base_tbl` -(6 rows) + Remote SQL: SELECT a, b FROM odbc_fdw_post.base_tbl WHERE ((a < b)) +(5 rows) --Testcase 531: UPDATE rw_view SET b = b + 15; -- ok @@ -7811,12 +7686,11 @@ UPDATE rw_view SET b = b + 5; ---------------------------------------------------------------------------------------------- Update on public.parent_tbl Foreign Update on public.foreign_tbl parent_tbl_1 - Remote SQL: UPDATE `odbc_fdw_post`.`child_tbl` SET `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.child_tbl SET b = ? WHERE id = ? -> Foreign Scan on public.foreign_tbl parent_tbl_1 Output: (parent_tbl_1.b + 5), parent_tbl_1.tableoid, parent_tbl_1.id, parent_tbl_1.* - Filter: (parent_tbl_1.a < parent_tbl_1.b) - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`child_tbl` -(7 rows) + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.child_tbl WHERE ((a < b)) +(6 rows) --Testcase 545: UPDATE rw_view SET b = b + 5; -- should fail @@ -7827,12 +7701,11 @@ UPDATE rw_view SET b = b + 15; ----------------------------------------------------------------------------------------------- Update on public.parent_tbl Foreign Update on public.foreign_tbl parent_tbl_1 - Remote SQL: UPDATE `odbc_fdw_post`.`child_tbl` SET `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.child_tbl SET b = ? WHERE id = ? -> Foreign Scan on public.foreign_tbl parent_tbl_1 Output: (parent_tbl_1.b + 15), parent_tbl_1.tableoid, parent_tbl_1.id, parent_tbl_1.* - Filter: (parent_tbl_1.a < parent_tbl_1.b) - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`child_tbl` -(7 rows) + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.child_tbl WHERE ((a < b)) +(6 rows) --Testcase 547: UPDATE rw_view SET b = b + 15; -- ok @@ -7907,10 +7780,10 @@ create foreign table grem1 ( --Testcase 562: explain (verbose, costs off) insert into grem1 (a) values (1), (2); - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------- Insert on public.grem1 - Remote SQL: INSERT INTO `odbc_fdw_post`.`gloc1`(`a`, `b`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_post.gloc1(a, b) VALUES (?, ?) -> Values Scan on "*VALUES*" Output: "*VALUES*".column1, NULL::integer (4 rows) @@ -7920,15 +7793,14 @@ insert into grem1 (a) values (1), (2); --Testcase 564: explain (verbose, costs off) update grem1 set a = 22 where a = 2; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------- Update on public.grem1 - Remote SQL: UPDATE `odbc_fdw_post`.`gloc1` SET `a` = ?, `b` = ? WHERE `a` = ? + Remote SQL: UPDATE odbc_fdw_post.gloc1 SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.grem1 Output: 22, a, grem1.* - Filter: (grem1.a = 2) - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`gloc1` -(6 rows) + Remote SQL: SELECT a, b FROM odbc_fdw_post.gloc1 WHERE ((a = 2)) +(5 rows) --Testcase 565: update grem1 set a = 22 where a = 2; @@ -8235,13 +8107,13 @@ SELECT f1, f2 from loc1; --Testcase 616: EXPLAIN (verbose, costs off) UPDATE rem1 set f1 = 10; -- all columns should be transmitted - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f1` = ?, `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f1 = ?, f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: 10, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 617: @@ -8394,22 +8266,22 @@ DROP TRIGGER trig_local_before ON loc1; --Testcase 652: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 653: EXPLAIN (verbose, costs off) DELETE FROM rem1 WHERE false; -- currently can't be pushed down - QUERY PLAN ------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Result Output: f1 One-Time Filter: false @@ -8423,25 +8295,25 @@ CREATE TRIGGER trig_stmt_before --Testcase 655: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 656: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 657: @@ -8453,25 +8325,25 @@ CREATE TRIGGER trig_stmt_after --Testcase 659: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 660: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 661: @@ -8484,25 +8356,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 663: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 664: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 665: @@ -8514,25 +8386,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 667: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 668: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 669: @@ -8545,25 +8417,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 671: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f1` = ?, `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f1 = ?, f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 672: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 673: @@ -8575,25 +8447,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 675: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can't be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 676: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 677: @@ -8606,25 +8478,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 679: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 680: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 681: @@ -8636,25 +8508,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 683: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE `odbc_fdw_post`.`loc1` SET `f2` = ? WHERE `f1` = ? + Remote SQL: UPDATE odbc_fdw_post.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 684: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loc1` WHERE `f1` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, rem1.* - Remote SQL: SELECT `f1`,`f2` FROM `odbc_fdw_post`.`loc1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loc1 (5 rows) --Testcase 685: @@ -8881,7 +8753,7 @@ select * from bar where f1 in (select f1 from foo) for update; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -8889,7 +8761,7 @@ select * from bar where f1 in (select f1 from foo) for update; Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 (19 rows) --Testcase 732: @@ -8917,7 +8789,7 @@ select * from bar where f1 in (select f1 from foo) for share; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -8925,7 +8797,7 @@ select * from bar where f1 in (select f1 from foo) for share; Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 (19 rows) --Testcase 734: @@ -8948,8 +8820,8 @@ DETAIL: User-specified column moved to the position of the inherited column. --Testcase 736: explain (verbose, costs off) select * from bar where f1 in (select f1 from foo2) for share; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- LockRows Output: bar.f1, bar.f2, bar.ctid, foo2.*, bar.*, bar.tableoid, foo2.tableoid -> Hash Semi Join @@ -8960,16 +8832,16 @@ select * from bar where f1 in (select f1 from foo2) for share; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 -> Hash Output: foo2.*, foo2.f1, foo2.tableoid -> Append -> Foreign Scan on public.foo2 foo2_1 Output: foo2_1.*, foo2_1.f1, foo2_1.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 -> Foreign Scan on public.foo2child foo2_2 Output: foo2_2.*, foo2_2.f1, foo2_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct4` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct4 (20 rows) --Testcase 737: @@ -9003,7 +8875,7 @@ select * from bar where f1 in (select f1 from foo2) for share; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 -> Hash Output: foo2.*, foo2.f1, foo2.ctid, foo2.tableoid -> HashAggregate @@ -9012,7 +8884,7 @@ select * from bar where f1 in (select f1 from foo2) for share; -> Append -> Foreign Scan on public.foo2 foo2_1 Output: foo2_1.*, foo2_1.f1, foo2_1.ctid, foo2_1.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 -> Seq Scan on public.foo2child foo2_2 Output: foo2_2.*, foo2_2.f1, foo2_2.ctid, foo2_2.tableoid (23 rows) @@ -9036,7 +8908,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Update on public.bar Update on public.bar bar_1 Foreign Update on public.bar2 bar_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct2` SET `f2` = ? WHERE `f3` = ? + Remote SQL: UPDATE odbc_fdw_post.loct2 SET f2 = ? WHERE f3 = ? -> Hash Semi Join Output: (bar.f2 + 100), foo.ctid, bar.tableoid, bar.ctid, (NULL::integer), (NULL::record), foo.*, foo.tableoid Hash Cond: (bar.f1 = foo.f1) @@ -9045,7 +8917,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Output: bar_1.f2, bar_1.f1, bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f2, bar_2.f1, bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -9053,7 +8925,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct1 (21 rows) --Testcase 744: @@ -9082,7 +8954,7 @@ where bar.f1 = ss.f1; Update on public.bar Update on public.bar bar_1 Foreign Update on public.bar2 bar_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct2` SET `f2` = ? WHERE `f3` = ? + Remote SQL: UPDATE odbc_fdw_post.loct2 SET f2 = ? WHERE f3 = ? -> Hash Join Output: (bar.f2 + 100), (ROW(foo.f1)), bar.tableoid, bar.ctid, (NULL::integer), (NULL::record) Hash Cond: (foo.f1 = bar.f1) @@ -9091,12 +8963,12 @@ where bar.f1 = ss.f1; Output: ROW(foo.f1), foo.f1 -> Foreign Scan on public.foo2 foo_1 Output: ROW(foo_1.f1), foo_1.f1 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 -> Seq Scan on public.foo foo_2 Output: ROW((foo_2.f1 + 3)), (foo_2.f1 + 3) -> Foreign Scan on public.foo2 foo_3 Output: ROW((foo_3.f1 + 3)), (foo_3.f1 + 3) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 -> Hash Output: bar.f2, bar.f1, bar.tableoid, bar.ctid, (NULL::integer), (NULL::record) -> Append @@ -9104,7 +8976,7 @@ where bar.f1 = ss.f1; Output: bar_1.f2, bar_1.f1, bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f2, bar_2.f1, bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 (26 rows) --Testcase 747: @@ -9149,8 +9021,8 @@ analyze foo; --Testcase 755: explain (verbose, costs off) select foo.f1, foo2.f1 from foo join foo2 on (foo.f1 = foo2.f1) order by foo.f2 offset 10 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: foo.f1, foo2.f1, foo.f2 -> Sort @@ -9168,13 +9040,13 @@ explain (verbose, costs off) Sort Key: foo_2.f1 -> Foreign Scan on public.foo2 foo_2 Output: foo_2.f1, foo_2.f2 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loct1 -> Sort Output: foo2.f1 Sort Key: foo2.f1 -> Foreign Scan on public.foo2 Output: foo2.f1 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 (24 rows) --Testcase 756: @@ -9198,8 +9070,8 @@ select foo.f1, foo2.f1 from foo join foo2 on (foo.f1 = foo2.f1) order by foo.f2 --Testcase 757: explain (verbose, costs off) select foo.f1, foo2.f1 from foo left join foo2 on (foo.f1 = foo2.f1) order by foo.f2 offset 10 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: foo.f1, foo2.f1, foo.f2 -> Sort @@ -9217,13 +9089,13 @@ explain (verbose, costs off) Sort Key: foo_2.f1 -> Foreign Scan on public.foo2 foo_2 Output: foo_2.f1, foo_2.f2 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1, f2 FROM odbc_fdw_post.loct1 -> Sort Output: foo2.f1 Sort Key: foo2.f1 -> Foreign Scan on public.foo2 Output: foo2.f1 - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` + Remote SQL: SELECT f1 FROM odbc_fdw_post.loct1 (24 rows) --Testcase 758: @@ -9255,21 +9127,20 @@ RESET enable_nestloop; --Testcase 761: explain (verbose, costs off) delete from foo where f1 < 5; - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Delete on public.foo Delete on public.foo foo_1 Foreign Delete on public.foo2 foo_2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loct1` WHERE `f3` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loct1 WHERE f3 = ? -> Append -> Index Scan using i_foo_f1 on public.foo foo_1 Output: foo_1.tableoid, foo_1.ctid, NULL::integer Index Cond: (foo_1.f1 < 5) -> Foreign Scan on public.foo2 foo_2 Output: foo_2.tableoid, NULL::tid, foo_2.f3 - Filter: (foo_2.f1 < 5) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct1` -(12 rows) + Remote SQL: SELECT f3 FROM odbc_fdw_post.loct1 WHERE ((f1 < 5)) +(11 rows) --Testcase 762: delete from foo where f1 < 5; @@ -9281,7 +9152,7 @@ update bar set f2 = f2 + 100; Update on public.bar Update on public.bar bar_1 Foreign Update on public.bar2 bar_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct2` SET `f2` = ? WHERE `f3` = ? + Remote SQL: UPDATE odbc_fdw_post.loct2 SET f2 = ? WHERE f3 = ? -> Result Output: (bar.f2 + 100), bar.tableoid, bar.ctid, (NULL::integer), (NULL::record) -> Append @@ -9289,7 +9160,7 @@ update bar set f2 = f2 + 100; Output: bar_1.f2, bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f2, bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 (12 rows) --Testcase 764: @@ -9306,12 +9177,12 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 767: explain (verbose, costs off) update bar set f2 = f2 + 100; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------- Update on public.bar Update on public.bar bar_1 Foreign Update on public.bar2 bar_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct2` SET `f1` = ?, `f2` = ?, `f3` = ? WHERE `f3` = ? + Remote SQL: UPDATE odbc_fdw_post.loct2 SET f1 = ?, f2 = ?, f3 = ? WHERE f3 = ? -> Result Output: (bar.f2 + 100), bar.tableoid, bar.ctid, (NULL::integer), (NULL::record) -> Append @@ -9319,7 +9190,7 @@ update bar set f2 = f2 + 100; Output: bar_1.f2, bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f2, bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 (12 rows) --Testcase 768: @@ -9339,21 +9210,20 @@ psql:sql/14.0/ported_postgres_fdw.sql:2740: NOTICE: OLD: (7,277,77),NEW: (7,377 --Testcase 769: explain (verbose, costs off) delete from bar where f2 < 400; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------- Delete on public.bar Delete on public.bar bar_1 Foreign Delete on public.bar2 bar_2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loct2` WHERE `f3` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loct2 WHERE f3 = ? -> Append -> Seq Scan on public.bar bar_1 Output: bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record Filter: (bar_1.f2 < 400) -> Foreign Scan on public.bar2 bar_2 Output: bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Filter: (bar_2.f2 < 400) - Remote SQL: SELECT `f1`,`f2`,`f3` FROM `odbc_fdw_post`.`loct2` -(12 rows) + Remote SQL: SELECT f1, f2, f3 FROM odbc_fdw_post.loct2 WHERE ((f2 < 400)) +(11 rows) --Testcase 770: delete from bar where f2 < 400; @@ -9405,7 +9275,7 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; Update on public.parent Update on public.parent parent_1 Foreign Update on public.remt1 parent_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct1_2` SET `b` = ? WHERE `a` = ? + Remote SQL: UPDATE odbc_fdw_post.loct1_2 SET b = ? WHERE a = ? -> Nested Loop Output: (parent.b || remt2.b), remt2.*, parent.tableoid, parent.ctid, (NULL::integer), (NULL::record) Join Filter: (parent.a = remt2.a) @@ -9414,12 +9284,12 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; Output: parent_1.b, parent_1.a, parent_1.tableoid, parent_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.remt1 parent_2 Output: parent_2.b, parent_2.a, parent_2.tableoid, NULL::tid, parent_2.a, parent_2.* - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct1_2` + Remote SQL: SELECT a, b FROM odbc_fdw_post.loct1_2 -> Materialize Output: remt2.b, remt2.*, remt2.a -> Foreign Scan on public.remt2 Output: remt2.b, remt2.*, remt2.a - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct2_2` + Remote SQL: SELECT a, b FROM odbc_fdw_post.loct2_2 (18 rows) --Testcase 784: @@ -9432,7 +9302,7 @@ delete from parent using remt2 where parent.a = remt2.a; Delete on public.parent Delete on public.parent parent_1 Foreign Delete on public.remt1 parent_2 - Remote SQL: DELETE FROM `odbc_fdw_post`.`loct1_2` WHERE `a` = ? + Remote SQL: DELETE FROM odbc_fdw_post.loct1_2 WHERE a = ? -> Nested Loop Output: remt2.*, parent.tableoid, parent.ctid, (NULL::integer) Join Filter: (parent.a = remt2.a) @@ -9441,12 +9311,12 @@ delete from parent using remt2 where parent.a = remt2.a; Output: parent_1.a, parent_1.tableoid, parent_1.ctid, NULL::integer -> Foreign Scan on public.remt1 parent_2 Output: parent_2.a, parent_2.tableoid, NULL::tid, parent_2.a - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct1_2` + Remote SQL: SELECT a FROM odbc_fdw_post.loct1_2 -> Materialize Output: remt2.*, remt2.a -> Foreign Scan on public.remt2 Output: remt2.*, remt2.a - Remote SQL: SELECT `a`,`b` FROM `odbc_fdw_post`.`loct2_2` + Remote SQL: SELECT a, b FROM odbc_fdw_post.loct2_2 (18 rows) --Testcase 786: @@ -9657,21 +9527,20 @@ insert into utrtest values (2, 'qux'); --Testcase 844: explain (verbose, costs off) update utrtest set a = 1 where a = 1 or a = 2; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Append -> Foreign Scan on public.remp utrtest_1 Output: 1, utrtest_1.tableoid, utrtest_1.id, utrtest_1.*, NULL::tid - Filter: ((utrtest_1.a = 1) OR (utrtest_1.a = 2)) - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.loct_2 WHERE (((a = 1) OR (a = 2))) -> Seq Scan on public.locp utrtest_2 Output: 1, utrtest_2.tableoid, NULL::integer, NULL::record, utrtest_2.ctid Filter: ((utrtest_2.a = 1) OR (utrtest_2.a = 2)) -(12 rows) +(11 rows) -- The new values are concatenated with ' triggered !' --Testcase 845: @@ -9718,12 +9587,12 @@ update utrtest set a = 1; ------------------------------------------------------------------------------------------ Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Append -> Foreign Scan on public.remp utrtest_1 Output: 1, utrtest_1.tableoid, utrtest_1.id, utrtest_1.*, NULL::tid - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.loct_2 -> Seq Scan on public.locp utrtest_2 Output: 1, utrtest_2.tableoid, NULL::integer, NULL::record, utrtest_2.ctid (10 rows) @@ -9746,7 +9615,7 @@ update utrtest set a = 1 from (values (1), (2)) s(x) where a = s.x; ---------------------------------------------------------------------------------------------------------- Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Hash Join Output: 1, "*VALUES*".*, utrtest.tableoid, utrtest.id, utrtest.*, (NULL::tid) @@ -9754,7 +9623,7 @@ update utrtest set a = 1 from (values (1), (2)) s(x) where a = s.x; -> Append -> Foreign Scan on public.remp utrtest_1 Output: utrtest_1.a, utrtest_1.tableoid, utrtest_1.id, utrtest_1.*, NULL::tid - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.loct_2 -> Seq Scan on public.locp utrtest_2 Output: utrtest_2.a, utrtest_2.tableoid, NULL::integer, NULL::record, utrtest_2.ctid -> Hash @@ -9797,13 +9666,13 @@ update utrtest set a = 3; Update on public.utrtest Update on public.locp utrtest_1 Foreign Update on public.remp utrtest_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? -> Append -> Seq Scan on public.locp utrtest_1 Output: 3, utrtest_1.tableoid, utrtest_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.remp utrtest_2 Output: 3, utrtest_2.tableoid, NULL::tid, utrtest_2.id, utrtest_2.* - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.loct_2 (10 rows) --Testcase 871: @@ -9818,7 +9687,7 @@ update utrtest set a = 3 from (values (2), (3)) s(x) where a = s.x; Update on public.utrtest Update on public.locp utrtest_1 Foreign Update on public.remp utrtest_2 - Remote SQL: UPDATE `odbc_fdw_post`.`loct_2` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_post.loct_2 SET a = ? WHERE id = ? -> Hash Join Output: 3, "*VALUES*".*, utrtest.tableoid, utrtest.ctid, (NULL::integer), (NULL::record) Hash Cond: (utrtest.a = "*VALUES*".column1) @@ -9827,7 +9696,7 @@ update utrtest set a = 3 from (values (2), (3)) s(x) where a = s.x; Output: utrtest_1.a, utrtest_1.tableoid, utrtest_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.remp utrtest_2 Output: utrtest_2.a, utrtest_2.tableoid, NULL::tid, utrtest_2.id, utrtest_2.* - Remote SQL: SELECT `a`,`b`,`id` FROM `odbc_fdw_post`.`loct_2` + Remote SQL: SELECT a, b, id FROM odbc_fdw_post.loct_2 -> Hash Output: "*VALUES*".*, "*VALUES*".column1 -> Values Scan on "*VALUES*" diff --git a/expected/14.0/mysql/select.out b/expected/14.0/mysql/select.out index bd44cba..191b3e9 100644 --- a/expected/14.0/mysql/select.out +++ b/expected/14.0/mysql/select.out @@ -60,17 +60,16 @@ EXPLAIN VERBOSE SELECT * FROM onek WHERE onek.unique1 < 10 ORDER BY onek.unique1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 Sort Key: onek.unique1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 - Filter: (onek.unique1 < 10) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 < 10)) +(7 rows) --Testcase 8: SELECT * FROM onek @@ -98,17 +97,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using >; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek.unique1 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM odbc_fdw_regress.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 10: SELECT onek.unique1, onek.stringu1 FROM onek @@ -146,17 +144,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 > 980 ORDER BY stringu1 using <; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek.stringu1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM odbc_fdw_regress.onek WHERE ((unique1 > 980)) +(7 rows) SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 > 980 @@ -193,17 +190,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 > 980 ORDER BY string4 using <, unique1 using >; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.string4, onek.unique1 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 13: SELECT onek.unique1, onek.string4 FROM onek @@ -241,17 +237,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 > 980 ORDER BY string4 using >, unique1 using <; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.string4 DESC, onek.unique1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 15: SELECT onek.unique1, onek.string4 FROM onek @@ -289,17 +284,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using >, string4 using <; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.unique1 DESC, onek.string4 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 17: SELECT onek.unique1, onek.string4 FROM onek @@ -338,17 +332,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using <, string4 using >; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.unique1, onek.string4 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 19: SELECT onek.unique1, onek.string4 FROM onek @@ -398,17 +391,16 @@ SET enable_sort TO off; --Testcase 23: EXPLAIN VERBOSE SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY onek2.unique1; -- add ORDER BY to stablize test result - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 Sort Key: onek2.unique1 -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 - Filter: (onek2.unique1 < 10) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek WHERE ((unique1 < 10)) +(7 rows) --Testcase 24: SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY onek2.unique1; -- add ORDER BY to stablize test result @@ -434,17 +426,16 @@ EXPLAIN VERBOSE SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 < 20 ORDER BY unique1 using >; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort (cost=10000001074.83..10000001077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek2.unique1 DESC -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek2.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM odbc_fdw_regress.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 26: SELECT onek2.unique1, onek2.stringu1 FROM onek2 @@ -481,17 +472,16 @@ SELECT onek2.unique1, onek2.stringu1 FROM onek2 EXPLAIN VERBOSE SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 > 980 ORDER BY onek2.unique1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek2.unique1 -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek2.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM odbc_fdw_regress.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 28: SELECT onek2.unique1, onek2.stringu1 FROM onek2 @@ -530,12 +520,12 @@ EXPLAIN VERBOSE SELECT two, stringu1, ten, string4 INTO TABLE tmp FROM onek; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=136) Output: two, stringu1, ten, string4 Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` + Remote SQL: SELECT two, ten, stringu1, string4 FROM odbc_fdw_regress.onek (4 rows) --Testcase 33: @@ -557,7 +547,7 @@ select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j) -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4 Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek -> Hash (cost=0.03..0.03 rows=2 width=36) Output: "*VALUES*".column1, "*VALUES*".column2 -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=36) @@ -588,7 +578,7 @@ select * from onek, Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4, $1 Filter: (onek.unique1 = $3) Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek InitPlan 2 (returns $1) -> Limit (cost=0.12..0.12 rows=1 width=4) Output: "*VALUES*".column1 @@ -641,7 +631,7 @@ select * from onek -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4 Foreign Table Size: 1000 b - Remote SQL: SELECT `unique1`,`unique2`,`two`,`four`,`ten`,`twenty`,`hundred`,`thousand`,`twothousand`,`fivethous`,`tenthous`,`odd`,`even`,`stringu1`,`stringu2`,`string4` FROM `odbc_fdw_regress`.`onek` + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM odbc_fdw_regress.onek -> Hash (cost=0.05..0.05 rows=4 width=8) Output: "*VALUES*".column1, "*VALUES*".column2 -> Values Scan on "*VALUES*" (cost=0.00..0.05 rows=4 width=8) @@ -684,7 +674,7 @@ SELECT q1, q2 FROM int8_tbl; -> Foreign Scan on public.int8_tbl (cost=25.00..30.00 rows=5 width=16) Output: int8_tbl.q1, int8_tbl.q2 Foreign Table Size: 5 b - Remote SQL: SELECT `q1`,`q2` FROM `odbc_fdw_regress`.`int8_tbl` + Remote SQL: SELECT q1, q2 FROM odbc_fdw_regress.int8_tbl (16 rows) --Testcase 41: @@ -722,7 +712,7 @@ SELECT * FROM foo ORDER BY f1; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 44: @@ -749,7 +739,7 @@ SELECT * FROM foo ORDER BY f1 ASC; -- same thing -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 46: @@ -776,7 +766,7 @@ SELECT * FROM foo ORDER BY f1 NULLS FIRST; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 48: @@ -803,7 +793,7 @@ SELECT * FROM foo ORDER BY f1 DESC; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 50: @@ -830,7 +820,7 @@ SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT `id`,`f1` FROM `odbc_fdw_regress`.`foo` + Remote SQL: SELECT id, f1 FROM odbc_fdw_regress.foo (7 rows) --Testcase 52: @@ -853,10 +843,10 @@ SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; --Testcase 53: explain (costs off) select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +--------------------------------------- Foreign Scan on onek2 - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) + Filter: (stringu1 = 'ATAAAA'::name) (2 rows) --Testcase 54: @@ -870,20 +860,19 @@ select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; --Testcase 55: explain (costs off, analyze on, timing off, summary off) select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +----------------------------------------------- Foreign Scan on onek2 (actual rows=1 loops=1) - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) - Rows Removed by Filter: 999 -(3 rows) + Filter: (stringu1 = 'ATAAAA'::name) +(2 rows) --Testcase 56: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +--------------------------------------- Foreign Scan on onek2 - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) + Filter: (stringu1 = 'ATAAAA'::name) (2 rows) --Testcase 57: @@ -897,10 +886,10 @@ select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; --Testcase 58: explain (costs off) select * from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 59: @@ -913,10 +902,10 @@ select * from onek2 where unique2 = 11 and stringu1 < 'B'; --Testcase 60: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 61: @@ -930,11 +919,11 @@ select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; --Testcase 62: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; - QUERY PLAN -------------------------------------------------------------- + QUERY PLAN +---------------------------------------- LockRows -> Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (3 rows) --Testcase 63: @@ -948,10 +937,10 @@ select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; --Testcase 64: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'C'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'C'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'C'::name) (2 rows) --Testcase 65: @@ -967,10 +956,10 @@ SET enable_indexscan TO off; --Testcase 67: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 68: @@ -987,10 +976,10 @@ RESET enable_indexscan; explain (costs off) select unique1, unique2 from onek2 where (unique2 = 11 or unique1 = 0) and stringu1 < 'B'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND ((unique2 = 11) OR (unique1 = 0))) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 71: diff --git a/expected/14.0/mysql/update.out b/expected/14.0/mysql/update.out index 73a4583..485ad2d 100644 --- a/expected/14.0/mysql/update.out +++ b/expected/14.0/mysql/update.out @@ -29,10 +29,10 @@ CREATE FOREIGN TABLE upsert_test ( --Testcase 6: EXPLAIN VERBOSE INSERT INTO update_test VALUES (5, 10, 'foo'); - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------- Insert on public.update_test (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`update_test`(`a`, `b`, `c`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 5, 10, 'foo'::text, nextval('update_test_id_seq'::regclass) (4 rows) @@ -42,10 +42,10 @@ INSERT INTO update_test VALUES (5, 10, 'foo'); --Testcase 8: EXPLAIN VERBOSE INSERT INTO update_test(b, a) VALUES (15, 10); - QUERY PLAN ------------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------- Insert on public.update_test (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`update_test`(`a`, `b`, `c`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 10, 15, NULL::text, nextval('update_test_id_seq'::regclass) (4 rows) @@ -55,12 +55,12 @@ INSERT INTO update_test(b, a) VALUES (15, 10); --Testcase 10: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 11: @@ -74,14 +74,14 @@ SELECT * FROM update_test; --Testcase 12: EXPLAIN VERBOSE UPDATE update_test SET a = DEFAULT, b = DEFAULT; - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..27.00 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=80) Output: 10, NULL::integer, id, update_test.* Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (6 rows) --Testcase 13: @@ -89,12 +89,12 @@ UPDATE update_test SET a = DEFAULT, b = DEFAULT; --Testcase 14: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 15: @@ -109,28 +109,27 @@ SELECT * FROM update_test; --Testcase 16: EXPLAIN VERBOSE UPDATE update_test AS t SET b = 10 WHERE t.a = 10; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Update on public.update_test t (cost=25.00..27.00 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET b = ? WHERE id = ? -> Foreign Scan on public.update_test t (cost=25.00..27.00 rows=2 width=76) Output: 10, id, t.* - Filter: (t.a = 10) Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((a = 10)) +(6 rows) --Testcase 17: UPDATE update_test AS t SET b = 10 WHERE t.a = 10; --Testcase 18: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 19: @@ -144,28 +143,27 @@ SELECT * FROM update_test; --Testcase 20: EXPLAIN VERBOSE UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Update on public.update_test t (cost=25.00..27.00 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET b = ? WHERE id = ? -> Foreign Scan on public.update_test t (cost=25.00..27.00 rows=2 width=76) Output: (b + 10), id, t.* - Filter: (t.a = 10) Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((a = 10)) +(6 rows) --Testcase 21: UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; --Testcase 22: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 23: @@ -183,16 +181,15 @@ SELECT * FROM update_test; EXPLAIN VERBOSE UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) WHERE update_test.b = v.j; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..27.00 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=76) Output: 100, update_test.id, update_test.* - Filter: (update_test.b = 20) Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((b = 20)) +(6 rows) --Testcase 25: UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) @@ -200,12 +197,12 @@ UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) --Testcase 26: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 27: @@ -241,11 +238,11 @@ INSERT INTO update_test(a, b, c) SELECT a,b+1,c FROM update_test; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Insert on public.update_test (cost=25.00..27.02 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`update_test`(`a`, `b`, `c`, `id`) VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..27.02 rows=2 width=44) Output: update_test_1.a, (update_test_1.b + 1), update_test_1.c, nextval('update_test_id_seq'::regclass) Foreign Table Size: 2 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c FROM odbc_fdw_regress.update_test (6 rows) --Testcase 31: @@ -253,12 +250,12 @@ INSERT INTO update_test(a, b, c) SELECT a,b+1,c FROM update_test; --Testcase 32: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 33: @@ -274,31 +271,30 @@ SELECT * FROM update_test; --Testcase 34: EXPLAIN VERBOSE UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.01 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ?, `c` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ?, c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=112) Output: 10, (b + 11), 'bugle'::text, id, update_test.* - Filter: (update_test.c = 'foo'::text) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((c = 'foo')) +(6 rows) --Testcase 35: UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; --Testcase 36: EXPLAIN VERBOSE SELECT * FROM update_test ORDER BY b; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------- Sort (cost=29.04..29.05 rows=4 width=44) Output: a, b, c, id Sort Key: update_test.b -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (7 rows) --Testcase 37: @@ -314,31 +310,30 @@ SELECT * FROM update_test ORDER BY b; --Testcase 38: EXPLAIN VERBOSE UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.02 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ?, `c` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ?, c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.02 rows=4 width=112) Output: (a + 1), (a + b), 'car'::text, id, update_test.* - Filter: (update_test.a = 10) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((a = 10)) +(6 rows) --Testcase 39: UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; --Testcase 40: EXPLAIN VERBOSE SELECT * FROM update_test ORDER BY b; - QUERY PLAN ------------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------- Sort (cost=29.04..29.05 rows=4 width=44) Output: a, b, c, id Sort Key: update_test.b -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (7 rows) --Testcase 41: @@ -365,22 +360,20 @@ EXPLAIN VERBOSE UPDATE update_test SET (b,a) = (select a,b from update_test where b = 41 and c = 'car') WHERE a = 100 AND b = 20; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.00..58.00 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.00 rows=4 width=8) Output: update_test_1.a, update_test_1.b - Filter: ((update_test_1.b = 41) AND (update_test_1.c = 'car'::text)) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b FROM odbc_fdw_regress.update_test WHERE ((b = 41)) AND ((c = 'car')) -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=112) Output: $1, $0, NULL::record, update_test.id, update_test.* - Filter: ((update_test.a = 100) AND (update_test.b = 20)) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(13 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((a = 100)) AND ((b = 20)) +(11 rows) --Testcase 45: UPDATE update_test @@ -389,12 +382,12 @@ UPDATE update_test --Testcase 46: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 47: @@ -416,17 +409,17 @@ UPDATE update_test o QUERY PLAN -------------------------------------------------------------------------------------------- Update on public.update_test o (cost=25.00..145.04 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test o (cost=25.00..145.04 rows=4 width=112) Output: $4, $3, (SubPlan 1 (returns $3,$4)), o.id, o.* Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test SubPlan 1 (returns $3,$4) -> Foreign Scan on public.update_test i (cost=25.00..29.01 rows=4 width=8) Output: (i.a + 1), i.b Filter: ((NOT (i.c IS DISTINCT FROM o.c)) AND (i.a = o.a) AND (i.b = o.b)) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c FROM odbc_fdw_regress.update_test (12 rows) --Testcase 49: @@ -436,12 +429,12 @@ UPDATE update_test o --Testcase 50: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 51: @@ -461,16 +454,16 @@ UPDATE update_test SET (b,a) = (select a+1,b from update_test); QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.01..58.01 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.01 rows=4 width=8) Output: (update_test_1.a + 1), update_test_1.b Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b FROM odbc_fdw_regress.update_test -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=112) Output: $1, $0, NULL::record, update_test.id, update_test.* Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (11 rows) --Testcase 53: @@ -484,19 +477,17 @@ UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000) QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.01..58.01 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.01 rows=4 width=8) Output: (update_test_1.a + 1), update_test_1.b - Filter: (update_test_1.a = 1000) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b FROM odbc_fdw_regress.update_test WHERE ((a = 1000)) -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=112) Output: $1, $0, NULL::record, update_test.id, update_test.* - Filter: (update_test.a = 11) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(13 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((a = 11)) +(11 rows) --Testcase 55: UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000) @@ -513,12 +504,12 @@ SELECT * FROM update_test; --Testcase 56: EXPLAIN VERBOSE SELECT * FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test (4 rows) --Testcase 57: @@ -539,13 +530,12 @@ UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j) QUERY PLAN ------------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.00 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=80) Output: 21, 100, update_test.id, update_test.* - Filter: (update_test.a = 21) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((a = 21)) +(6 rows) --Testcase 59: UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j) @@ -586,25 +576,24 @@ UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car'; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.00 rows=0 width=0) - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `c` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=104) Output: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'::text, id, update_test.* - Filter: (update_test.c = 'car'::text) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` -(7 rows) + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test WHERE ((c = 'car')) +(6 rows) --Testcase 65: UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car'; --Testcase 66: EXPLAIN VERBOSE SELECT a, b, char_length(c) FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=12) Output: a, b, char_length(c) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c FROM odbc_fdw_regress.update_test (4 rows) --Testcase 67: @@ -623,21 +612,21 @@ EXPLAIN (VERBOSE, COSTS OFF) UPDATE update_test t SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a) WHERE CURRENT_USER = SESSION_USER; - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Update on public.update_test t - Remote SQL: UPDATE `odbc_fdw_regress`.`update_test` SET `a` = ?, `b` = ? WHERE `id` = ? + Remote SQL: UPDATE odbc_fdw_regress.update_test SET a = ?, b = ? WHERE id = ? -> Result Output: $1, $2, (SubPlan 1 (returns $1,$2)), t.id, t.* One-Time Filter: (CURRENT_USER = SESSION_USER) -> Foreign Scan on public.update_test t Output: t.a, t.id, t.* - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c, id FROM odbc_fdw_regress.update_test SubPlan 1 (returns $1,$2) -> Foreign Scan on public.update_test s Output: s.b, s.a Filter: (s.a = t.a) - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b FROM odbc_fdw_regress.update_test (13 rows) --Testcase 69: @@ -647,12 +636,12 @@ UPDATE update_test t --Testcase 70: EXPLAIN VERBOSE SELECT a, b, char_length(c) FROM update_test; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=12) Output: a, b, char_length(c) Foreign Table Size: 4 b - Remote SQL: SELECT `a`,`b`,`c`,`id` FROM `odbc_fdw_regress`.`update_test` + Remote SQL: SELECT a, b, c FROM odbc_fdw_regress.update_test (4 rows) --Testcase 71: @@ -669,10 +658,10 @@ SELECT a, b, char_length(c) FROM update_test; --Testcase 72: EXPLAIN VERBOSE INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo'); - QUERY PLAN ------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.upsert_test (cost=0.00..0.03 rows=0 width=0) - Remote SQL: INSERT INTO `odbc_fdw_regress`.`upsert_test`(`a`, `b`) VALUES (?, ?) + Remote SQL: INSERT INTO odbc_fdw_regress.upsert_test(a, b) VALUES (?, ?) -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=36) Output: "*VALUES*".column1, "*VALUES*".column2 (4 rows) diff --git a/expected/14.0/postgresql/char.out b/expected/14.0/postgresql/char.out index 6c6d564..a23e2e0 100644 --- a/expected/14.0/postgresql/char.out +++ b/expected/14.0/postgresql/char.out @@ -42,7 +42,7 @@ INSERT INTO char_tbl VALUES ('a'); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'a'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -55,7 +55,7 @@ INSERT INTO char_tbl VALUES ('A'); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'A'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -69,7 +69,7 @@ INSERT INTO char_tbl VALUES ('1'); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -82,7 +82,7 @@ INSERT INTO char_tbl VALUES (2); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '2'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -95,7 +95,7 @@ INSERT INTO char_tbl VALUES ('3'); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '3'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -109,7 +109,7 @@ INSERT INTO char_tbl VALUES (''); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: ' '::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -130,7 +130,7 @@ INSERT INTO char_tbl VALUES ('c '); QUERY PLAN ------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'c'::character(1), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -145,7 +145,7 @@ SELECT f1 FROM CHAR_TBL; Foreign Scan on public.char_tbl (cost=25.00..32.00 rows=7 width=8) Output: f1 Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" + Remote SQL: SELECT f1 FROM public.char_tbl (4 rows) --Testcase 24: @@ -161,6 +161,8 @@ SELECT f1 FROM CHAR_TBL; c (7 rows) +-- For Char, varchar, text in MySQL, comparison is case-insensitive. +-- Result at MySQL will not same as Postgres. --Testcase 25: EXPLAIN VERBOSE SELECT c.f1 @@ -170,10 +172,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 <> 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 <> 'a')) +(4 rows) --Testcase 26: SELECT c.f1 @@ -198,10 +199,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 = 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 = 'a')) +(4 rows) --Testcase 28: SELECT c.f1 @@ -221,10 +221,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 < 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 < 'a')) +(4 rows) --Testcase 30: SELECT c.f1 @@ -247,10 +246,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 <= 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 <= 'a')) +(4 rows) --Testcase 32: SELECT c.f1 @@ -274,10 +272,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 > 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 > 'a')) +(4 rows) --Testcase 34: SELECT c.f1 @@ -298,10 +295,9 @@ SELECT c.f1 ----------------------------------------------------------------------- Foreign Scan on public.char_tbl c (cost=25.00..32.00 rows=7 width=8) Output: f1 - Filter: (c.f1 >= 'a'::bpchar) Foreign Table Size: 7 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.char_tbl WHERE ((f1 >= 'a')) +(4 rows) --Testcase 36: SELECT c.f1 @@ -327,7 +323,7 @@ INSERT INTO CHAR_TBL VALUES ('a'); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl_2"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'a '::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -340,7 +336,7 @@ INSERT INTO CHAR_TBL VALUES ('ab'); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl_2"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'ab '::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -353,7 +349,7 @@ INSERT INTO CHAR_TBL VALUES ('abcd'); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl_2"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'abcd'::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -363,17 +359,17 @@ INSERT INTO CHAR_TBL VALUES ('abcd'); --Testcase 45: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcde'); -psql:sql/14.0/char.sql:154: ERROR: value too long for type character(4) +psql:sql/14.0/char.sql:156: ERROR: value too long for type character(4) --Testcase 46: INSERT INTO CHAR_TBL VALUES ('abcde'); -psql:sql/14.0/char.sql:156: ERROR: value too long for type character(4) +psql:sql/14.0/char.sql:158: ERROR: value too long for type character(4) --Testcase 47: EXPLAIN VERBOSE INSERT INTO CHAR_TBL VALUES ('abcd '); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.char_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."char_tbl_2"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.char_tbl_2(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=24) Output: 'abcd'::character(4), nextval('char_tbl_id_seq'::regclass) (4 rows) @@ -387,7 +383,7 @@ EXPLAIN VERBOSE SELECT f1 FROM CHAR_TBL; Foreign Scan on public.char_tbl (cost=25.00..29.00 rows=4 width=20) Output: f1 Foreign Table Size: 4 b - Remote SQL: SELECT "f1","id" FROM "public"."char_tbl_2" + Remote SQL: SELECT f1 FROM public.char_tbl_2 (4 rows) --Testcase 50: @@ -402,7 +398,7 @@ SELECT f1 FROM CHAR_TBL; --Testcase 51: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/14.0/char.sql:168: NOTICE: drop cascades to 2 other objects +psql:sql/14.0/char.sql:170: NOTICE: drop cascades to 2 other objects DETAIL: drop cascades to user mapping for public on server postgres_server drop cascades to foreign table char_tbl --Testcase 52: diff --git a/expected/14.0/postgresql/date.out b/expected/14.0/postgresql/date.out index 081f6fc..582758c 100644 --- a/expected/14.0/postgresql/date.out +++ b/expected/14.0/postgresql/date.out @@ -176,7 +176,7 @@ SELECT f1 as "date", Foreign Scan on public.date_tbl (cost=25.00..41.05 rows=15 width=116) Output: f1, date_part('year'::text, (f1)::timestamp without time zone), date_part('month'::text, (f1)::timestamp without time zone), date_part('day'::text, (f1)::timestamp without time zone), date_part('quarter'::text, (f1)::timestamp without time zone), date_part('decade'::text, (f1)::timestamp without time zone), date_part('century'::text, (f1)::timestamp without time zone), date_part('millennium'::text, (f1)::timestamp without time zone), date_part('isoyear'::text, (f1)::timestamp without time zone), date_part('week'::text, (f1)::timestamp without time zone), date_part('dow'::text, (f1)::timestamp without time zone), date_part('isodow'::text, (f1)::timestamp without time zone), date_part('doy'::text, (f1)::timestamp without time zone), date_part('julian'::text, (f1)::timestamp without time zone), date_part('epoch'::text, (f1)::timestamp without time zone) Foreign Table Size: 15 b - Remote SQL: SELECT "f1","id" FROM "public"."date_tbl" + Remote SQL: SELECT f1 FROM public.date_tbl (4 rows) --Testcase 29: diff --git a/expected/14.0/postgresql/delete.out b/expected/14.0/postgresql/delete.out index 2e01efe..2c213d9 100644 --- a/expected/14.0/postgresql/delete.out +++ b/expected/14.0/postgresql/delete.out @@ -27,13 +27,12 @@ EXPLAIN VERBOSE DELETE FROM delete_test AS dt WHERE dt.a > 75; QUERY PLAN --------------------------------------------------------------------------------- Delete on public.delete_test dt (cost=25.00..28.00 rows=0 width=0) - Remote SQL: DELETE FROM "public"."delete_test" WHERE "id" = ? + Remote SQL: DELETE FROM public.delete_test WHERE id = ? -> Foreign Scan on public.delete_test dt (cost=25.00..28.00 rows=3 width=4) Output: id - Filter: (dt.a > 75) Foreign Table Size: 3 b - Remote SQL: SELECT "id","a","b" FROM "public"."delete_test" -(7 rows) + Remote SQL: SELECT id FROM public.delete_test WHERE ((a > 75)) +(6 rows) --Testcase 6: DELETE FROM delete_test AS dt WHERE dt.a > 75; @@ -58,7 +57,7 @@ EXPLAIN VERBOSE SELECT id, a, char_length(b) FROM delete_test; Foreign Scan on public.delete_test (cost=25.00..27.00 rows=2 width=12) Output: id, a, char_length(b) Foreign Table Size: 2 b - Remote SQL: SELECT "id","a","b" FROM "public"."delete_test" + Remote SQL: SELECT id, a, b FROM public.delete_test (4 rows) --Testcase 10: @@ -75,13 +74,12 @@ EXPLAIN VERBOSE DELETE FROM delete_test WHERE a > 25; QUERY PLAN ------------------------------------------------------------------------------ Delete on public.delete_test (cost=25.00..27.00 rows=0 width=0) - Remote SQL: DELETE FROM "public"."delete_test" WHERE "id" = ? + Remote SQL: DELETE FROM public.delete_test WHERE id = ? -> Foreign Scan on public.delete_test (cost=25.00..27.00 rows=2 width=4) Output: id - Filter: (delete_test.a > 25) Foreign Table Size: 2 b - Remote SQL: SELECT "id","a","b" FROM "public"."delete_test" -(7 rows) + Remote SQL: SELECT id FROM public.delete_test WHERE ((a > 25)) +(6 rows) --Testcase 12: DELETE FROM delete_test WHERE a > 25; @@ -92,7 +90,7 @@ EXPLAIN VERBOSE SELECT id, a, char_length(b) FROM delete_test; Foreign Scan on public.delete_test (cost=25.00..26.00 rows=1 width=12) Output: id, a, char_length(b) Foreign Table Size: 1 b - Remote SQL: SELECT "id","a","b" FROM "public"."delete_test" + Remote SQL: SELECT id, a, b FROM public.delete_test (4 rows) --Testcase 14: diff --git a/expected/14.0/postgresql/float4.out b/expected/14.0/postgresql/float4.out index 81605be..052048e 100644 --- a/expected/14.0/postgresql/float4.out +++ b/expected/14.0/postgresql/float4.out @@ -267,6 +267,11 @@ SELECT (f1::float4) AS float4 FROM FLOAT4_TBL; NaN (1 row) +-- The comparison of floating-point values for equality is not safe +-- because of the rounding errors when converting between binary and decimal. +-- A floating-point value as written in an SQL statement may not be +-- the same as the value represented internally. +-- E.g: binary value of 1004.3 may be 1004.2999999999999 --Testcase 67: ALTER FOREIGN TABLE FLOAT4_TBL OPTIONS (SET table 'float4_tbl'); --Testcase 68: @@ -285,35 +290,37 @@ SELECT f1 FROM FLOAT4_TBL f WHERE f.f1 <> '1004.3'; f1 --------------- 0 + 1004.3 -34.84 1.2345679e+20 1.2345679e-20 -(4 rows) +(5 rows) --Testcase 70: SELECT f1 FROM FLOAT4_TBL f WHERE f.f1 = '1004.3'; - f1 --------- - 1004.3 -(1 row) + f1 +---- +(0 rows) --Testcase 71: SELECT f1 FROM FLOAT4_TBL f WHERE '1004.3' > f.f1; f1 --------------- 0 + 1004.3 -34.84 1.2345679e-20 -(3 rows) +(4 rows) --Testcase 72: SELECT f1 FROM FLOAT4_TBL f WHERE f.f1 < '1004.3'; f1 --------------- 0 + 1004.3 -34.84 1.2345679e-20 -(3 rows) +(4 rows) --Testcase 73: SELECT f.f1 FROM FLOAT4_TBL f WHERE '1004.3' >= f.f1; @@ -378,7 +385,7 @@ SELECT f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f -- test divide by zero --Testcase 79: SELECT f.f1 / '0.0' from FLOAT4_TBL f; -psql:sql/14.0/float4.sql:201: ERROR: division by zero +psql:sql/14.0/float4.sql:205: ERROR: division by zero --Testcase 80: SELECT f1 FROM FLOAT4_TBL; f1 @@ -437,7 +444,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('32767.6'::float4); --Testcase 90: SELECT f1::int2 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:233: ERROR: smallint out of range +psql:sql/14.0/float4.sql:237: ERROR: smallint out of range --Testcase 91: DELETE FROM FLOAT4_TBL; --Testcase 92: @@ -455,7 +462,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-32768.6'::float4); --Testcase 96: SELECT f1::int2 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:247: ERROR: smallint out of range +psql:sql/14.0/float4.sql:251: ERROR: smallint out of range --Testcase 97: DELETE FROM FLOAT4_TBL; --Testcase 98: @@ -473,7 +480,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('2147483647'::float4); --Testcase 102: SELECT f1::int4 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:261: ERROR: integer out of range +psql:sql/14.0/float4.sql:265: ERROR: integer out of range --Testcase 103: DELETE FROM FLOAT4_TBL; --Testcase 104: @@ -491,7 +498,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-2147483900'::float4); --Testcase 108: SELECT f1::int4 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:275: ERROR: integer out of range +psql:sql/14.0/float4.sql:279: ERROR: integer out of range --Testcase 109: DELETE FROM FLOAT4_TBL; --Testcase 110: @@ -509,7 +516,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('9223372036854775807'::float4); --Testcase 114: SELECT f1::int8 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:289: ERROR: bigint out of range +psql:sql/14.0/float4.sql:293: ERROR: bigint out of range --Testcase 115: DELETE FROM FLOAT4_TBL; --Testcase 116: @@ -527,7 +534,7 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('-9223380000000000000'::float4); --Testcase 120: SELECT f1::int8 FROM FLOAT4_TBL; -psql:sql/14.0/float4.sql:303: ERROR: bigint out of range +psql:sql/14.0/float4.sql:307: ERROR: bigint out of range -- Test for correct input rounding in edge cases. -- These lists are from Paxson 1991, excluding subnormals and -- inputs of over 9 sig. digits. @@ -613,6 +620,6 @@ SELECT float4send(f1) FROM FLOAT4_TBL; DROP FOREIGN TABLE FLOAT4_TBL; --Testcase 143: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/14.0/float4.sql:368: NOTICE: drop cascades to user mapping for public on server postgres_server +psql:sql/14.0/float4.sql:372: NOTICE: drop cascades to user mapping for public on server postgres_server --Testcase 144: DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/expected/14.0/postgresql/float8.out b/expected/14.0/postgresql/float8.out index 5def864..225419e 100644 --- a/expected/14.0/postgresql/float8.out +++ b/expected/14.0/postgresql/float8.out @@ -24,7 +24,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES (' 0.0 '); QUERY PLAN ------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '0'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -37,7 +37,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30 '); QUERY PLAN ------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1004.3'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -50,7 +50,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES (' -34.84'); QUERY PLAN ------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-34.84'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -63,7 +63,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200'); QUERY PLAN -------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1.2345678901234e+200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -76,7 +76,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200'); QUERY PLAN -------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '1.2345678901234e-200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -322,7 +322,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 71: @@ -343,10 +343,9 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: (f.f1 <> '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 <> 1004.3)) +(4 rows) --Testcase 73: SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3'; @@ -365,10 +364,9 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: (f.f1 = '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 = 1004.3)) +(4 rows) --Testcase 75: SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 = '1004.3'; @@ -384,10 +382,9 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: ('1004.3'::double precision > f.f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((1004.3 > f1)) +(4 rows) --Testcase 77: SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' > f.f1; @@ -405,10 +402,9 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: (f.f1 < '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 < 1004.3)) +(4 rows) --Testcase 79: SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 < '1004.3'; @@ -426,10 +422,9 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: ('1004.3'::double precision >= f.f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((1004.3 >= f1)) +(4 rows) --Testcase 81: SELECT f.f1 FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1; @@ -448,10 +443,9 @@ SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3'; ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.00 rows=5 width=8) Output: f1 - Filter: (f.f1 <= '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 <= 1004.3)) +(4 rows) --Testcase 83: SELECT f.f1 FROM FLOAT8_TBL f WHERE f.f1 <= '1004.3'; @@ -472,10 +466,9 @@ SELECT f.f1, f.f1 * '-10' AS x -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (f1 * '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 85: SELECT f.f1, f.f1 * '-10' AS x @@ -497,10 +490,9 @@ SELECT f.f1, f.f1 + '-10' AS x -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (f1 + '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 87: SELECT f.f1, f.f1 + '-10' AS x @@ -522,10 +514,9 @@ SELECT f.f1, f.f1 / '-10' AS x -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (f1 / '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 89: SELECT f.f1, f.f1 / '-10' AS x @@ -547,10 +538,9 @@ SELECT f.f1, f.f1 - '-10' AS x -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (f1 - '-10'::double precision) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 91: SELECT f.f1, f.f1 - '-10' AS x @@ -571,10 +561,9 @@ SELECT f.f1 ^ '2.0' AS square_f1 ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: (f1 ^ '2'::double precision) - Filter: (f.f1 = '1004.3'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 = 1004.3)) +(4 rows) --Testcase 93: SELECT f.f1 ^ '2.0' AS square_f1 @@ -594,7 +583,7 @@ SELECT f.f1, @f.f1 AS abs_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (@ f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 95: @@ -619,7 +608,7 @@ SELECT f.f1, trunc(f.f1) AS trunc_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, trunc(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 97: @@ -644,7 +633,7 @@ SELECT f.f1, round(f.f1) AS round_f1 Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, round(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 99: @@ -668,7 +657,7 @@ select ceil(f1) as ceil_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ceil(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 101: @@ -690,7 +679,7 @@ select ceiling(f1) as ceiling_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ceiling(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 103: @@ -713,7 +702,7 @@ select floor(f1) as floor_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: floor(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 105: @@ -736,7 +725,7 @@ select sign(f1) as sign_f1 from float8_tbl f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: sign(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 107: @@ -795,10 +784,9 @@ SELECT f.f1, |/f.f1 AS sqrt_f1 -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (|/ f1) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 114: SELECT f.f1, |/f.f1 AS sqrt_f1 @@ -817,6 +805,17 @@ DELETE FROM FLOAT8_TMP; --Testcase 116: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '144', float8 '0.5'); --Testcase 117: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.float8_tmp (cost=25.00..26.00 rows=1 width=8) + Output: power(f1, f2) + Foreign Table Size: 1 b + Remote SQL: SELECT f1, f2 FROM public.float8_tmp +(4 rows) + +--Testcase 164: SELECT power(f1, f2) FROM FLOAT8_TMP; power ------- @@ -828,6 +827,17 @@ DELETE FROM FLOAT8_TMP; --Testcase 119: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'NaN', float8 '0.5'); --Testcase 120: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.float8_tmp (cost=25.00..26.00 rows=1 width=8) + Output: power(f1, f2) + Foreign Table Size: 1 b + Remote SQL: SELECT f1, f2 FROM public.float8_tmp +(4 rows) + +--Testcase 165: SELECT power(f1, f2) FROM FLOAT8_TMP; power ------- @@ -839,6 +849,17 @@ DELETE FROM FLOAT8_TMP; --Testcase 122: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '144', float8 'NaN'); --Testcase 123: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.float8_tmp (cost=25.00..26.00 rows=1 width=8) + Output: power(f1, f2) + Foreign Table Size: 1 b + Remote SQL: SELECT f1, f2 FROM public.float8_tmp +(4 rows) + +--Testcase 166: SELECT power(f1, f2) FROM FLOAT8_TMP; power ------- @@ -928,7 +949,7 @@ DELETE FROM FLOAT8_TMP; INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '0', float8 '-inf'); --Testcase 147: SELECT power(f1, f2) FROM FLOAT8_TMP; -psql:sql/14.0/float8.sql:395: ERROR: zero raised to a negative power is undefined +psql:sql/14.0/float8.sql:404: ERROR: zero raised to a negative power is undefined --Testcase 148: DELETE FROM FLOAT8_TMP; --Testcase 149: @@ -1157,7 +1178,7 @@ DELETE FROM FLOAT8_TMP; INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '-inf', float8 '3.5'); --Testcase 210: SELECT power(f1, f2) FROM FLOAT8_TMP; -psql:sql/14.0/float8.sql:544: ERROR: a negative number raised to a non-integer power yields a complex result +psql:sql/14.0/float8.sql:553: ERROR: a negative number raised to a non-integer power yields a complex result --Testcase 211: DELETE FROM FLOAT8_TMP; --Testcase 212: @@ -1190,10 +1211,9 @@ SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1 -------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.02 rows=5 width=16) Output: f1, exp(ln(f1)) - Filter: (f.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 > 0)) +(4 rows) --Testcase 218: SELECT f.f1, exp(ln(f.f1)) AS exp_ln_f1 @@ -1214,7 +1234,7 @@ SELECT f.f1, ||/f.f1 AS cbrt_f1 FROM FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=16) Output: f1, (||/ f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 220: @@ -1236,7 +1256,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 222: @@ -1258,13 +1278,12 @@ UPDATE FLOAT8_TBL QUERY PLAN ------------------------------------------------------------------------------ Update on public.float8_tbl (cost=25.00..30.01 rows=0 width=0) - Remote SQL: UPDATE "public"."float8_tbl" SET "f1" = ? WHERE "id" = ? + Remote SQL: UPDATE public.float8_tbl SET f1 = ? WHERE id = ? -> Foreign Scan on public.float8_tbl (cost=25.00..30.01 rows=5 width=48) Output: (f1 * '-1'::double precision), id, float8_tbl.* - Filter: (float8_tbl.f1 > '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(7 rows) + Remote SQL: SELECT f1, id FROM public.float8_tbl WHERE ((f1 > 0)) +(6 rows) --Testcase 224: UPDATE FLOAT8_TBL @@ -1278,12 +1297,12 @@ SELECT f.f1 * '1e200' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: (f1 * '1e+200'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 226: SELECT f.f1 * '1e200' from FLOAT8_TBL f; -psql:sql/14.0/float8.sql:593: ERROR: value out of range: overflow +psql:sql/14.0/float8.sql:602: ERROR: value out of range: overflow --Testcase 227: EXPLAIN VERBOSE SELECT f.f1 ^ '1e200' from FLOAT8_TBL f; @@ -1292,12 +1311,12 @@ SELECT f.f1 ^ '1e200' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: (f1 ^ '1e+200'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 228: SELECT f.f1 ^ '1e200' from FLOAT8_TBL f; -psql:sql/14.0/float8.sql:598: ERROR: value out of range: overflow +psql:sql/14.0/float8.sql:607: ERROR: value out of range: overflow -- EXPLAIN VERBOSE -- SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5; -- comment out because of no foreign table -- SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5; -- comment out because of no foreign table @@ -1308,14 +1327,13 @@ SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ln(f1) - Filter: (f.f1 = '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 = 0)) +(4 rows) --Testcase 230: SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 = '0.0' ; -psql:sql/14.0/float8.sql:606: ERROR: cannot take logarithm of zero +psql:sql/14.0/float8.sql:615: ERROR: cannot take logarithm of zero --Testcase 231: EXPLAIN VERBOSE SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; @@ -1323,14 +1341,13 @@ SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; ------------------------------------------------------------------------- Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: ln(f1) - Filter: (f.f1 < '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" -(5 rows) + Remote SQL: SELECT f1 FROM public.float8_tbl WHERE ((f1 < 0)) +(4 rows) --Testcase 232: SELECT ln(f.f1) from FLOAT8_TBL f where f.f1 < '0.0' ; -psql:sql/14.0/float8.sql:611: ERROR: cannot take logarithm of a negative number +psql:sql/14.0/float8.sql:620: ERROR: cannot take logarithm of a negative number --Testcase 233: EXPLAIN VERBOSE SELECT exp(f.f1) from FLOAT8_TBL f; @@ -1339,12 +1356,12 @@ SELECT exp(f.f1) from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: exp(f1) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 234: SELECT exp(f.f1) from FLOAT8_TBL f; -psql:sql/14.0/float8.sql:616: ERROR: value out of range: underflow +psql:sql/14.0/float8.sql:625: ERROR: value out of range: underflow --Testcase 235: EXPLAIN VERBOSE SELECT f.f1 / '0.0' from FLOAT8_TBL f; @@ -1353,12 +1370,12 @@ SELECT f.f1 / '0.0' from FLOAT8_TBL f; Foreign Scan on public.float8_tbl f (cost=25.00..30.01 rows=5 width=8) Output: (f1 / '0'::double precision) Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 236: SELECT f.f1 / '0.0' from FLOAT8_TBL f; -psql:sql/14.0/float8.sql:621: ERROR: division by zero +psql:sql/14.0/float8.sql:630: ERROR: division by zero --Testcase 237: EXPLAIN VERBOSE SELECT f1 FROM FLOAT8_TBL; @@ -1367,7 +1384,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 238: @@ -1387,45 +1404,45 @@ RESET extra_float_digits; --Testcase 240: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); -psql:sql/14.0/float8.sql:632: ERROR: "10e400" is out of range for type double precision +psql:sql/14.0/float8.sql:641: ERROR: "10e400" is out of range for type double precision LINE 2: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); ^ --Testcase 241: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); -psql:sql/14.0/float8.sql:634: ERROR: "10e400" is out of range for type double precision +psql:sql/14.0/float8.sql:643: ERROR: "10e400" is out of range for type double precision LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400'); ^ --Testcase 242: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); -psql:sql/14.0/float8.sql:637: ERROR: "-10e400" is out of range for type double precision +psql:sql/14.0/float8.sql:646: ERROR: "-10e400" is out of range for type double precision LINE 2: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); ^ --Testcase 243: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); -psql:sql/14.0/float8.sql:639: ERROR: "-10e400" is out of range for type double precision +psql:sql/14.0/float8.sql:648: ERROR: "-10e400" is out of range for type double precision LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400'); ^ --Testcase 244: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); -psql:sql/14.0/float8.sql:642: ERROR: "10e-400" is out of range for type double precision +psql:sql/14.0/float8.sql:651: ERROR: "10e-400" is out of range for type double precision LINE 2: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); ^ --Testcase 245: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); -psql:sql/14.0/float8.sql:644: ERROR: "10e-400" is out of range for type double precision +psql:sql/14.0/float8.sql:653: ERROR: "10e-400" is out of range for type double precision LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400'); ^ --Testcase 246: EXPLAIN VERBOSE INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); -psql:sql/14.0/float8.sql:647: ERROR: "-10e-400" is out of range for type double precision +psql:sql/14.0/float8.sql:656: ERROR: "-10e-400" is out of range for type double precision LINE 2: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); ^ --Testcase 247: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); -psql:sql/14.0/float8.sql:649: ERROR: "-10e-400" is out of range for type double precision +psql:sql/14.0/float8.sql:658: ERROR: "-10e-400" is out of range for type double precision LINE 1: INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400'); ^ -- maintain external table consistency across platforms @@ -1436,11 +1453,11 @@ DELETE FROM FLOAT8_TBL; QUERY PLAN ----------------------------------------------------------------------------- Delete on public.float8_tbl (cost=25.00..30.00 rows=0 width=0) - Remote SQL: DELETE FROM "public"."float8_tbl" WHERE "id" = ? + Remote SQL: DELETE FROM public.float8_tbl WHERE id = ? -> Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=4) Output: id Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT id FROM public.float8_tbl (6 rows) --Testcase 249: @@ -1451,7 +1468,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0'); QUERY PLAN ------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '0'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1464,7 +1481,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84'); QUERY PLAN ------------------------------------------------------------------------------------ Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-34.84'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1477,7 +1494,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1004.30'); QUERY PLAN ------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1004.3'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1490,7 +1507,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e+200'); QUERY PLAN --------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1.2345678901234e+200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1503,7 +1520,7 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('-1.2345678901234e-200'); QUERY PLAN --------------------------------------------------------------------------------------------------- Insert on public.float8_tbl (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."float8_tbl"("f1", "id") VALUES (?, ?) + Remote SQL: INSERT INTO public.float8_tbl(f1, id) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '-1.2345678901234e-200'::double precision, nextval('float8_tbl_id_seq'::regclass) (4 rows) @@ -1518,7 +1535,7 @@ SELECT f1 FROM FLOAT8_TBL; Foreign Scan on public.float8_tbl (cost=25.00..30.00 rows=5 width=8) Output: f1 Foreign Table Size: 5 b - Remote SQL: SELECT "f1","id" FROM "public"."float8_tbl" + Remote SQL: SELECT f1 FROM public.float8_tbl (4 rows) --Testcase 261: @@ -1534,7 +1551,7 @@ SELECT f1 FROM FLOAT8_TBL; --Testcase 262: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/14.0/float8.sql:688: NOTICE: drop cascades to 3 other objects +psql:sql/14.0/float8.sql:697: NOTICE: drop cascades to 3 other objects DETAIL: drop cascades to user mapping for public on server postgres_server drop cascades to foreign table float8_tbl drop cascades to foreign table float8_tmp diff --git a/expected/14.0/postgresql/function_pushdown.out b/expected/14.0/postgresql/function_pushdown.out new file mode 100644 index 0000000..962e8a2 --- /dev/null +++ b/expected/14.0/postgresql/function_pushdown.out @@ -0,0 +1,1861 @@ +-- +-- postgreSql +-- +\set ECHO none +\i sql/14.0/function_pushdown.sql +-- +-- function push-down +-- +--Testcase 1: +CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; +--Testcase 2: +CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME + OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); +--Testcase 3: +CREATE USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); +--Testcase 4: +CREATE FOREIGN TABLE s1(id int, tag1 text, value1 float, value2 int, value3 float, value4 int, value5 numeric, str1 text, str2 text) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 's1'); +--Testcase 5: +CREATE FOREIGN TABLE tbl04 (id int OPTIONS (key 'true'), c1 float8, c2 bigint, c3 text, c4 boolean, c5 timestamp) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl04'); +--Testcase 6: +EXPLAIN VERBOSE +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=4) + Output: NULLIF(value2, 100) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 WHERE ((nullif(value2, 100) IS NULL)) +(4 rows) + +--Testcase 7: +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + nullif +-------- + + + +(3 rows) + +-- numeric function +--Testcase 8: +EXPLAIN VERBOSE +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: abs(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((abs(value1) > 1)) +(4 rows) + +--Testcase 9: +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + abs +----- + 1.1 + 2.2 + 3.3 +(3 rows) + +--Testcase 10: +EXPLAIN VERBOSE +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + QUERY PLAN +------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: acos(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((value1 < 1)) AND ((acos(value1) > 1)) +(4 rows) + +--Testcase 11: +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + acos +-------------------- + 1.4706289056333368 + 1.369438406004566 + 1.2661036727794992 +(3 rows) + +--Testcase 12: +EXPLAIN VERBOSE +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + QUERY PLAN +------------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: asin(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((value1 < 1)) AND ((asin(value1) < 1)) +(4 rows) + +--Testcase 13: +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + asin +-------------------- + 0.1001674211615598 + 0.2013579207903308 + 0.3046926540153975 +(3 rows) + +--Testcase 14: +EXPLAIN VERBOSE +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + QUERY PLAN +----------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: atan((id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id FROM public.s1 WHERE ((atan(id) > 0.2)) +(4 rows) + +--Testcase 15: +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + atan +-------------------- + 0.7853981633974483 + 1.1071487177940904 + 1.2490457723982544 + 1.3258176636680326 + 1.373400766945016 +(5 rows) + +--Testcase 16: +EXPLAIN VERBOSE +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: atan2('3.141592653589793'::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id FROM public.s1 WHERE ((atan2(3.141592653589793, id) > 0.2)) +(4 rows) + +--Testcase 17: +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + atan2 +-------------------- + 1.5707963267948966 + 1.2626272556789118 + 1.0038848218538872 + 0.808448792630022 + 0.6657737500283538 + 0.5609821161086238 +(6 rows) + +--Testcase 18: +EXPLAIN VERBOSE +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ceil(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((ceil(value1) > 0)) +(4 rows) + +--Testcase 19: +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + ceil +------ + 1 + 1 + 1 + 2 + 3 + 4 +(6 rows) + +--Testcase 20: +EXPLAIN VERBOSE +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ceiling(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((ceiling(value1) > 0)) +(4 rows) + +--Testcase 21: +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + ceiling +--------- + 1 + 1 + 1 + 2 + 3 + 4 +(6 rows) + +--Testcase 22: +EXPLAIN VERBOSE +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: cos(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((cos(value1) > 0)) +(4 rows) + +--Testcase 23: +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + cos +-------------------- + 0.9950041652780258 + 0.9800665778412416 + 0.955336489125606 + 0.4535961214255773 +(4 rows) + +--Testcase 24: +EXPLAIN VERBOSE +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: cot(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((cot(value1) > 0)) +(4 rows) + +--Testcase 25: +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + cot +-------------------- + 9.966644423259238 + 4.933154875586893 + 3.2327281437658275 + 0.5089681052390643 + 6.259947539437359 +(5 rows) + +--Testcase 26: +EXPLAIN VERBOSE +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: degrees(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((degrees(value1) > 0)) +(4 rows) + +--Testcase 27: +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + degrees +-------------------- + 5.729577951308232 + 11.459155902616464 + 17.188733853924695 + 63.02535746439056 + 126.05071492878112 + 189.07607239317164 +(6 rows) + +--Testcase 28: +EXPLAIN VERBOSE +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: exp(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((exp(value1) > 0)) +(4 rows) + +--Testcase 29: +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + exp +-------------------- + 1.1051709180756477 + 1.2214027581601699 + 1.3498588075760032 + 3.0041660239464334 + 9.025013499434122 + 27.112638920657883 +(6 rows) + +--Testcase 30: +EXPLAIN VERBOSE +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: floor(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((floor(value1) > 0)) +(4 rows) + +--Testcase 31: +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + floor +------- + 1 + 2 + 3 +(3 rows) + +--Testcase 32: +EXPLAIN VERBOSE +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: ln(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((ln(value1) > 0)) +(4 rows) + +--Testcase 33: +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + ln +--------------------- + 0.09531017980432493 + 0.7884573603642703 + 1.1939224684724346 +(3 rows) + +--Testcase 34: +EXPLAIN VERBOSE +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=64) + Output: value5, log('2'::numeric, value5) + Foreign Table Size: 6 b + Remote SQL: SELECT value5 FROM public.s1 WHERE ((log(2, value5) > 0)) +(4 rows) + +--Testcase 35: +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + value5 | log +--------+--------------------- + 1.1 | 0.13750352374993491 + 1.2 | 0.2630344058337938 + 1.3 | 0.3785116232537298 +(3 rows) + +--Testcase 37: +EXPLAIN VERBOSE +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: log(value1) + Filter: (log(s1.value1) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 38: +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + log +--------------------- + 0.04139268515822507 + 0.3424226808222063 + 0.5185139398778874 +(3 rows) + +--Testcase 39: +EXPLAIN VERBOSE +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: log10(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((log10(value1) > 0)) +(4 rows) + +--Testcase 40: +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + log10 +--------------------- + 0.04139268515822507 + 0.3424226808222063 + 0.5185139398778874 +(3 rows) + +--Testcase 41: +EXPLAIN VERBOSE +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=4) + Output: mod(value2, (id + 1)) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM public.s1 WHERE ((mod(value2, (id + 1)) > 0)) +(4 rows) + +--Testcase 42: +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + mod +----- + 1 + 2 +(2 rows) + +--Testcase 43: +EXPLAIN VERBOSE +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: pow((value2)::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM public.s1 WHERE ((pow(value2, id) > 0)) +(4 rows) + +--Testcase 44: +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + pow +-------------- + 1 + 100 + 10000 + 8000000 + 1600000000 + 320000000000 +(6 rows) + +--Testcase 45: +EXPLAIN VERBOSE +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: power((value2)::double precision, (id)::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT id, value2 FROM public.s1 WHERE ((power(value2, id) > 0)) +(4 rows) + +--Testcase 46: +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + power +-------------- + 1 + 100 + 10000 + 8000000 + 1600000000 + 320000000000 +(6 rows) + +--Testcase 47: +EXPLAIN VERBOSE +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: radians(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((radians(value1) > 0)) +(4 rows) + +--Testcase 48: +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + radians +----------------------- + 0.0017453292519943296 + 0.003490658503988659 + 0.005235987755982988 + 0.019198621771937627 + 0.038397243543875255 + 0.05759586531581287 +(6 rows) + +--Testcase 49: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: round(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((round(value1) > 0)) +(4 rows) + +--Testcase 50: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + round +------- + 1 + 2 + 3 +(3 rows) + +--Testcase 51: +EXPLAIN VERBOSE +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=16) + Output: sign(value3), value3 + Foreign Table Size: 6 b + Remote SQL: SELECT value3 FROM public.s1 WHERE ((sign(value3) = (-1))) +(4 rows) + +--Testcase 52: +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + sign | value3 +------+-------- + -1 | -0.1 + -1 | -0.2 + -1 | -0.3 + -1 | -1.1 + -1 | -2.2 + -1 | -3.3 +(6 rows) + +--Testcase 53: +EXPLAIN VERBOSE +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: sin(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((sin(value1) > 0)) +(4 rows) + +--Testcase 54: +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + sin +--------------------- + 0.09983341664682815 + 0.19866933079506122 + 0.29552020666133955 + 0.8912073600614354 + 0.8084964038195901 +(5 rows) + +--Testcase 55: +EXPLAIN VERBOSE +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: sqrt(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((sqrt(value1) > 0)) +(4 rows) + +--Testcase 56: +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + sqrt +--------------------- + 0.31622776601683794 + 0.4472135954999579 + 0.5477225575051661 + 1.0488088481701516 + 1.4832396974191326 + 1.816590212458495 +(6 rows) + +--Testcase 57: +EXPLAIN VERBOSE +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: tan(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((tan(value1) > 0)) +(4 rows) + +--Testcase 58: +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + tan +--------------------- + 0.10033467208545055 + 0.2027100355086725 + 0.30933624960962325 + 1.9647596572486523 + 0.15974574766003222 +(5 rows) + +--Testcase 59: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=8) + Output: round(value1) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 WHERE ((round(value1) > 0)) +(4 rows) + +--Testcase 60: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + round +------- + 1 + 2 + 3 +(3 rows) + +-- date/time function: +--Testcase 61: +EXPLAIN VERBOSE +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: date(c5) + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM public.tbl04 WHERE ((date(c5) > '1970-01-01')) +(4 rows) + +--Testcase 62: +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + date +------------ + 01-01-2000 + 01-01-2000 + 01-01-2000 + 11-01-1990 + 11-01-2010 + 10-01-1999 + 10-01-2010 + 10-01-1999 + 10-01-2010 +(9 rows) + +-- string function: +--Testcase 63: +EXPLAIN VERBOSE +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: ascii(str1), ascii(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((ascii(str1) > 0)) +(4 rows) + +--Testcase 64: +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + ascii | ascii +-------+------- + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 + 45 | 32 +(6 rows) + +--Testcase 65: +-- for bit_length() function, postgre's core will optimize it to octet_length() * 8 and push it down +EXPLAIN VERBOSE +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=8) + Output: (octet_length(str1) * 8), (octet_length(str2) * 8) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE (((octet_length(str1) * 8) > 0)) +(4 rows) + +--Testcase 66: +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + bit_length | bit_length +------------+------------ + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 + 72 | 72 +(6 rows) + +--Testcase 67: +EXPLAIN VERBOSE +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2) + Filter: (btrim(s1.str2) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 68: +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 69: +EXPLAIN VERBOSE +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: btrim(str2, ' '::text) + Filter: (btrim(s1.str2, ' '::text) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 70: +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 71: +EXPLAIN VERBOSE +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + QUERY PLAN +-------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: char_length(str1), char_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((char_length(str1) > 0)) +(4 rows) + +--Testcase 72: +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + char_length | char_length +-------------+------------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 73: +EXPLAIN VERBOSE +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: character_length(str1), character_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((character_length(str1) > 0)) +(4 rows) + +--Testcase 74: +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + character_length | character_length +------------------+------------------ + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 75: +EXPLAIN VERBOSE +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + QUERY PLAN +------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: concat(str1, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((concat(str1, str2) LIKE '---XYZ--- XYZ ')) +(4 rows) + +--Testcase 76: +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + concat +-------------------- + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ + ---XYZ--- XYZ +(6 rows) + +--Testcase 77: +EXPLAIN VERBOSE +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: concat_ws(','::text, str1, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ ')) +(4 rows) + +--Testcase 78: +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + concat_ws +--------------------- + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ + ---XYZ---, XYZ +(6 rows) + +--Testcase 79: +EXPLAIN VERBOSE +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "left"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((left(str1, 3) LIKE '---')) +(4 rows) + +--Testcase 80: +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + left +------ + --- + --- + --- + --- + --- + --- +(6 rows) + +--Testcase 81: +EXPLAIN VERBOSE +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: length(str1), length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((length(str1) > 0)) +(4 rows) + +--Testcase 82: +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + length | length +--------+-------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 83: +EXPLAIN VERBOSE +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: lower(str1), lower(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((lower(str1) LIKE '%xyz%')) +(4 rows) + +--Testcase 84: +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + lower | lower +-----------+----------- + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz + ---xyz--- | xyz +(6 rows) + +--Testcase 85: +EXPLAIN VERBOSE +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: lpad(str1, 20, 'ABCD'::text), lpad(str2, 20, 'ABCD'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((lpad(str1, 20, 'ABCD') LIKE '%XYZ%')) +(4 rows) + +--Testcase 86: +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + lpad | lpad +----------------------+---------------------- + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ + ABCDABCDABC---XYZ--- | ABCDABCDABC XYZ +(6 rows) + +--Testcase 87: +EXPLAIN VERBOSE +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str2) + Filter: (ltrim(s1.str2) ~~ 'XYZ '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 88: +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + ltrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 89: +EXPLAIN VERBOSE +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: ltrim(str2, ' '::text) + Filter: (ltrim(s1.str2, ' '::text) ~~ 'XYZ '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 90: +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + ltrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 91: +EXPLAIN VERBOSE +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + QUERY PLAN +--------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=8) + Output: octet_length(str1), octet_length(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((octet_length(str1) > 0)) +(4 rows) + +--Testcase 92: +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + octet_length | octet_length +--------------+-------------- + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 + 9 | 9 +(6 rows) + +--Testcase 93: +EXPLAIN VERBOSE +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=4) + Output: POSITION(('X'::text) IN (str1)) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((position('X' IN str1) > 0)) +(4 rows) + +--Testcase 94: +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + position +---------- + 4 + 4 + 4 + 4 + 4 + 4 +(6 rows) + +--Testcase 95: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: regexp_replace(str1, 'X..'::text, 'xyz'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%')) +(4 rows) + +--Testcase 96: +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + regexp_replace +---------------- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- + ---xyz--- +(6 rows) + +--Testcase 97: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: regexp_replace(str1, '[Y]'::text, 'y'::text, 'i'::text) + Filter: (regexp_replace(s1.str1, '[Y]'::text, 'y'::text, 'i'::text) ~~ '%XyZ%'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 98: +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + regexp_replace +---------------- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- + ---XyZ--- +(6 rows) + +--Testcase 99: +EXPLAIN VERBOSE +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: repeat(str1, 3), repeat(str2, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((repeat(str2, 3) LIKE '%X%')) +(4 rows) + +--Testcase 100: +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + repeat | repeat +-----------------------------+----------------------------- + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ + ---XYZ------XYZ------XYZ--- | XYZ XYZ XYZ +(6 rows) + +--Testcase 101: +EXPLAIN VERBOSE +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + QUERY PLAN +------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: replace(str1, 'XYZ'::text, 'ABC'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((replace(str1, 'XYZ', 'ABC') LIKE '%A%')) +(4 rows) + +--Testcase 102: +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + replace +----------- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- + ---ABC--- +(6 rows) + +--Testcase 103: +EXPLAIN VERBOSE +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: reverse(str1), reverse(str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((reverse(str1) LIKE '%ZYX%')) +(4 rows) + +--Testcase 104: +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + reverse | reverse +-----------+----------- + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX + ---ZYX--- | ZYX +(6 rows) + +--Testcase 105: +EXPLAIN VERBOSE +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: "right"(str1, 4), "right"(str2, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((right(str1, 4) LIKE 'Z%')) +(4 rows) + +--Testcase 106: +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + right | right +-------+------- + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z + Z--- | Z +(6 rows) + +--Testcase 107: +EXPLAIN VERBOSE +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + QUERY PLAN +------------------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=64) + Output: rpad(str1, 16, str2), rpad(str1, 4, str2) + Foreign Table Size: 6 b + Remote SQL: SELECT str1, str2 FROM public.s1 WHERE ((rpad(str1, 16, str2) LIKE '---XYZ---%')) +(4 rows) + +--Testcase 108: +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + rpad | rpad +------------------+------ + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X + ---XYZ--- XYZ | ---X +(6 rows) + +--Testcase 109: +EXPLAIN VERBOSE +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str2) + Filter: (rtrim(s1.str2) ~~ '%XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 110: +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + rtrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 111: +EXPLAIN VERBOSE +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: rtrim(str2, ' '::text) + Filter: (rtrim(s1.str2, ' '::text) ~~ '%XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 112: +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + rtrim +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 113: +EXPLAIN VERBOSE +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: substr(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((substr(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 114: +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + substr +--------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 115: +EXPLAIN VERBOSE +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: substr(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 WHERE ((substr(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 116: +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + substr +-------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 117: +EXPLAIN VERBOSE +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str1, 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((substring(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 118: +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + substring +----------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 119: +EXPLAIN VERBOSE +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: "substring"(str2, 3, 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 WHERE ((substring(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 120: +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + substring +----------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 121: +EXPLAIN VERBOSE +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: SUBSTRING(str1 FROM 3) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 WHERE ((substring(str1, 3) LIKE '-XYZ---')) +(4 rows) + +--Testcase 122: +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + substring +----------- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- + -XYZ--- +(6 rows) + +--Testcase 123: +EXPLAIN VERBOSE +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + QUERY PLAN +-------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: SUBSTRING(str2 FROM 3 FOR 4) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 WHERE ((substring(str2, 3, 4) LIKE ' XYZ')) +(4 rows) + +--Testcase 124: +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + substring +----------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 125: +EXPLAIN VERBOSE +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(BOTH FROM str2) + Filter: (TRIM(BOTH FROM s1.str2) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str2 FROM public.s1 +(5 rows) + +--Testcase 126: +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 127: +EXPLAIN VERBOSE +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(BOTH '-'::text FROM str1) + Filter: (TRIM(BOTH '-'::text FROM s1.str1) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 128: +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 129: +EXPLAIN VERBOSE +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(LEADING '-'::text FROM str1) + Filter: (TRIM(LEADING '-'::text FROM s1.str1) ~~ 'XYZ---'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 130: +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + ltrim +-------- + XYZ--- + XYZ--- + XYZ--- + XYZ--- + XYZ--- + XYZ--- +(6 rows) + +--Testcase 131: +EXPLAIN VERBOSE +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(BOTH '-'::text FROM str1) + Filter: (TRIM(BOTH '-'::text FROM s1.str1) ~~ 'XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 132: +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + btrim +------- + XYZ + XYZ + XYZ + XYZ + XYZ + XYZ +(6 rows) + +--Testcase 133: +EXPLAIN VERBOSE +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: TRIM(TRAILING '-'::text FROM str1) + Filter: (TRIM(TRAILING '-'::text FROM s1.str1) ~~ '---XYZ'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT str1 FROM public.s1 +(5 rows) + +--Testcase 134: +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + rtrim +-------- + ---XYZ + ---XYZ + ---XYZ + ---XYZ + ---XYZ + ---XYZ +(6 rows) + +--Testcase 135: +EXPLAIN VERBOSE +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=32) + Output: upper(tag1) + Foreign Table Size: 6 b + Remote SQL: SELECT tag1 FROM public.s1 WHERE ((upper(tag1) LIKE 'A')) +(4 rows) + +--Testcase 136: +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + upper +------- + A + A + A +(3 rows) + +-- explicit cast function: +--Testcase 137: +EXPLAIN VERBOSE +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=40) + Output: cos(((value1)::numeric)::double precision), (value1)::numeric + Filter: (cos(((s1.value1)::numeric)::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 138: +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 139: +EXPLAIN VERBOSE +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.09 rows=6 width=24) + Output: cos(((value1)::numeric(10,0))::double precision), (value1)::numeric(10,0) + Filter: (cos(((s1.value1)::numeric(10,0))::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 140: +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 1 | 0 + 1 | 0 + 1 | 0 + 0.5403023058681398 | 1 +(4 rows) + +--Testcase 141: +EXPLAIN VERBOSE +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.06 rows=6 width=40) + Output: cos(((value1)::numeric)::double precision), (value1)::numeric + Filter: (cos(((s1.value1)::numeric)::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 142: +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 143: +EXPLAIN VERBOSE +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + QUERY PLAN +----------------------------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.09 rows=6 width=24) + Output: cos(((value1)::numeric(10,1))::double precision), (value1)::numeric(10,1) + Filter: (cos(((s1.value1)::numeric(10,1))::double precision) > '0'::double precision) + Foreign Table Size: 6 b + Remote SQL: SELECT value1 FROM public.s1 +(5 rows) + +--Testcase 144: +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + cos | value1 +--------------------+-------- + 0.9950041652780258 | 0.1 + 0.9800665778412416 | 0.2 + 0.955336489125606 | 0.3 + 0.4535961214255773 | 1.1 +(4 rows) + +--Testcase 145: +EXPLAIN VERBOSE +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=8) + Output: (value2)::character(1) + Filter: ((s1.value2)::character(1) ~~ '1'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 146: +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + value2 +-------- + 1 + 1 + 1 +(3 rows) + +--Testcase 147: +EXPLAIN VERBOSE +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=32) + Output: (value2)::character varying + Filter: (((s1.value2)::character varying)::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 148: +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 149: +EXPLAIN VERBOSE +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=28) + Output: (value2)::character(6) + Filter: ((s1.value2)::character(6) ~~ '100 '::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 150: +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 151: +EXPLAIN VERBOSE +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.05 rows=6 width=28) + Output: (value2)::character varying(6) + Filter: (((s1.value2)::character varying(6))::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 152: +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 153: +EXPLAIN VERBOSE +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + QUERY PLAN +---------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.03 rows=6 width=32) + Output: (value2)::text + Filter: ((s1.value2)::text ~~ '100'::text) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 154: +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + value2 +-------- + 100 + 100 + 100 +(3 rows) + +--Testcase 155: +EXPLAIN VERBOSE +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan on public.s1 (cost=25.00..31.02 rows=6 width=2) + Output: (value2)::smallint + Filter: ((s1.value2)::smallint > 20) + Foreign Table Size: 6 b + Remote SQL: SELECT value2 FROM public.s1 +(5 rows) + +--Testcase 156: +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + value2 +-------- + 100 + 100 + 100 + 200 + 200 + 200 +(6 rows) + +--Testcase 157: +EXPLAIN VERBOSE +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + QUERY PLAN +------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c1)::integer + Filter: ((tbl04.c1)::integer > 20) + Foreign Table Size: 9 b + Remote SQL: SELECT c1 FROM public.tbl04 +(5 rows) + +--Testcase 158: +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + c1 +------- + 31 + 2566 + 55 + 45021 + 122 + 75 + 6867 +(7 rows) + +--Testcase 159: +EXPLAIN VERBOSE +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=8) + Output: (c2)::double precision + Filter: ((tbl04.c2)::double precision > '20'::double precision) + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM public.tbl04 +(5 rows) + +--Testcase 160: +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + c2 +--------- + 128912 + 6565 + 1829812 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 161: +EXPLAIN VERBOSE +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c2)::real + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM public.tbl04 WHERE ((CAST(c2 AS real) > 20)) +(4 rows) + +--Testcase 162: +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + c2 +-------------- + 128912 + 6565 + 1.829812e+06 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 163: +EXPLAIN VERBOSE +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c2)::real + Foreign Table Size: 9 b + Remote SQL: SELECT c2 FROM public.tbl04 WHERE ((CAST(c2 AS real) > 20)) +(4 rows) + +--Testcase 164: +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + c2 +-------------- + 128912 + 6565 + 1.829812e+06 + 523 + 22342 + 2121 + 23241 + 316 + 8916 +(9 rows) + +--Testcase 165: +EXPLAIN VERBOSE +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=4) + Output: (c5)::date + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM public.tbl04 WHERE ((CAST(c5 AS date) > '2001-01-01')) +(4 rows) + +--Testcase 166: +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + c5 +------------ + 11-01-2010 + 10-01-2010 + 10-01-2010 +(3 rows) + +--Testcase 167: +EXPLAIN VERBOSE +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + QUERY PLAN +----------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=8) + Output: (c5)::time without time zone + Foreign Table Size: 9 b + Remote SQL: SELECT c5 FROM public.tbl04 WHERE ((CAST(c5 AS time) > '00:00:00')) +(4 rows) + +--Testcase 168: +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + c5 +---------- + 10:10:00 + 10:10:00 +(2 rows) + +--Testcase 169: +DROP FOREIGN TABLE s1; +--Testcase 170: +DROP FOREIGN TABLE tbl04; +--Testcase 171: +DROP USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME; +--Testcase 172: +DROP SERVER :DB_SERVERNAME CASCADE; +--Testcase 173: +DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/expected/14.0/postgresql/insert.out b/expected/14.0/postgresql/insert.out index 7473207..4bee55c 100644 --- a/expected/14.0/postgresql/insert.out +++ b/expected/14.0/postgresql/insert.out @@ -23,7 +23,7 @@ insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT); QUERY PLAN ------------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, NULL::integer, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -37,10 +37,10 @@ Error while executing the query --Testcase 7: EXPLAIN VERBOSE insert into inserttest (col2, col3) values (3, DEFAULT); - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 3, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -50,10 +50,10 @@ insert into inserttest (col2, col3) values (3, DEFAULT); --Testcase 9: EXPLAIN VERBOSE insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT); - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 5, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -63,10 +63,10 @@ insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT); --Testcase 11: EXPLAIN VERBOSE insert into inserttest values (DEFAULT, 5, 'test'); - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 5, 'test'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -76,10 +76,10 @@ insert into inserttest values (DEFAULT, 5, 'test'); --Testcase 13: EXPLAIN VERBOSE insert into inserttest values (DEFAULT, 7); - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: NULL::integer, 7, 'testing'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -89,12 +89,12 @@ insert into inserttest values (DEFAULT, 7); --Testcase 15: EXPLAIN VERBOSE select * from inserttest; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..29.00 rows=4 width=44) Output: col1, col2, col3, id Foreign Table Size: 4 b - Remote SQL: SELECT "col1","col2","col3","id" FROM "public"."inserttest" + Remote SQL: SELECT col1, col2, col3, id FROM public.inserttest (4 rows) select * from inserttest; @@ -156,12 +156,12 @@ LINE 1: insert into inserttest (col1) values (DEFAULT, DEFAULT); --Testcase 24: EXPLAIN VERBOSE select * from inserttest; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..29.00 rows=4 width=44) Output: col1, col2, col3, id Foreign Table Size: 4 b - Remote SQL: SELECT "col1","col2","col3","id" FROM "public"."inserttest" + Remote SQL: SELECT col1, col2, col3, id FROM public.inserttest (4 rows) --Testcase 25: @@ -184,7 +184,7 @@ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT), QUERY PLAN -------------------------------------------------------------------------------------------------------------------- Insert on public.inserttest (cost=0.02..0.07 rows=0 width=0) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) InitPlan 1 (returns $0) -> Result (cost=0.00..0.01 rows=1 width=4) Output: 2 @@ -201,12 +201,12 @@ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT), --Testcase 28: EXPLAIN VERBOSE select * from inserttest; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..32.00 rows=7 width=44) Output: col1, col2, col3, id Foreign Table Size: 7 b - Remote SQL: SELECT "col1","col2","col3","id" FROM "public"."inserttest" + Remote SQL: SELECT col1, col2, col3, id FROM public.inserttest (4 rows) --Testcase 29: @@ -231,7 +231,7 @@ insert into inserttest values(30, 50, repeat('x', 10000)); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Insert on public.inserttest (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."inserttest"("col1", "col2", "col3", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.inserttest(col1, col2, col3, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 30, 50, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'::text, nextval('inserttest_id_seq'::regclass) (4 rows) @@ -241,12 +241,12 @@ insert into inserttest values(30, 50, repeat('x', 10000)); --Testcase 32: EXPLAIN VERBOSE select col1, col2, char_length(col3) from inserttest; - QUERY PLAN ---------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.inserttest (cost=25.00..33.02 rows=8 width=12) Output: col1, col2, char_length(col3) Foreign Table Size: 8 b - Remote SQL: SELECT "col1","col2","col3","id" FROM "public"."inserttest" + Remote SQL: SELECT col1, col2, col3 FROM public.inserttest (4 rows) --Testcase 33: diff --git a/expected/14.0/postgresql/new_test.out b/expected/14.0/postgresql/new_test.out index 61b6413..00e7f91 100644 --- a/expected/14.0/postgresql/new_test.out +++ b/expected/14.0/postgresql/new_test.out @@ -21,10 +21,10 @@ CREATE FOREIGN TABLE tbl01 (id bigint OPTIONS (key 'true'), c1 int) --Testcase 5: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (166565, 1); - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Insert on public.tbl01 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl01"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '166565'::bigint, 1 (4 rows) @@ -34,10 +34,10 @@ INSERT INTO tbl01 VALUES (166565, 1); --Testcase 7: EXPLAIN VERBOSE INSERT INTO tbl01 (c1) VALUES (3); - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Insert on public.tbl01 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl01"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: NULL::bigint, 3 (4 rows) @@ -51,10 +51,10 @@ Error while executing the query --Testcase 9: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (null, 4); - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Insert on public.tbl01 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl01"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: NULL::bigint, 4 (4 rows) @@ -68,10 +68,10 @@ Error while executing the query --Testcase 11: EXPLAIN VERBOSE INSERT INTO tbl01 VALUES (166565, 7); - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Insert on public.tbl01 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl01"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl01(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: '166565'::bigint, 7 (4 rows) @@ -91,7 +91,7 @@ INSERT INTO tbl02 VALUES (repeat('a', 255), 1, 12112.12, true); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Insert on public.tbl02 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl02"("id", "c1", "c2", "c3") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=1037) Output: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'::character(255), 1, '12112.12'::double precision, true (4 rows) @@ -101,10 +101,10 @@ INSERT INTO tbl02 VALUES (repeat('a', 255), 1, 12112.12, true); --Testcase 16: EXPLAIN VERBOSE INSERT INTO tbl02 VALUES (NULL, 2, -12.23, false); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.tbl02 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl02"("id", "c1", "c2", "c3") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=1037) Output: NULL::character(255), 2, '-12.23'::double precision, false (4 rows) @@ -118,10 +118,10 @@ Error while executing the query --Testcase 18: EXPLAIN VERBOSE INSERT INTO tbl02(c1) VALUES (3); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Insert on public.tbl02 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl02"("id", "c1", "c2", "c3") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.tbl02(id, c1, c2, c3) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=45) Output: NULL::bpchar, 3, NULL::double precision, NULL::boolean (4 rows) @@ -137,6 +137,7 @@ Error while executing the query ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp01'); --Testcase 20: ALTER FOREIGN TABLE tbl02 ALTER COLUMN c2 SET NOT NULL; +--Testcase 77: \dS+ tbl02 Foreign table "public.tbl02" Column | Type | Collation | Nullable | Default | FDW options | Storage | Stats target | Description @@ -150,7 +151,7 @@ FDW options: (schema 'public', "table" 'tbl02_tmp01') --Testcase 21: INSERT INTO tbl02(id, c2) VALUES ('b', NULL); -- fail -psql:sql/14.0/new_test.sql:62: ERROR: Executing ODBC query +psql:sql/14.0/new_test.sql:63: ERROR: Executing ODBC query ERROR: null value in column "c2" of relation "tbl02_tmp01" violates not-null constraint DETAIL: Failing row contains (b ..., null, null, null).; Error while executing the query @@ -165,6 +166,7 @@ SELECT * FROM tbl02; -- no result ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp02'); --Testcase 23: ALTER FOREIGN TABLE tbl02 ALTER c1 OPTIONS (key 'true'); -- now, id and c1 are key +--Testcase 78: \dS+ tbl02 Foreign table "public.tbl02" Column | Type | Collation | Nullable | Default | FDW options | Storage | Stats target | Description @@ -178,8 +180,9 @@ FDW options: (schema 'public', "table" 'tbl02_tmp02') --Testcase 73 INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- ok +--Testcase 79: INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- fail -psql:sql/14.0/new_test.sql:75: ERROR: Executing ODBC query +psql:sql/14.0/new_test.sql:78: ERROR: Executing ODBC query ERROR: duplicate key value violates unique constraint "tbl02_tmp02_pkey" DETAIL: Key (id, c1)=(a , 12112) already exists.; @@ -189,12 +192,12 @@ INSERT INTO tbl02(id, c1) VALUES ('a', 13113.13); -- ok --Testcase 24: EXPLAIN VERBOSE SELECT * FROM tbl02; - QUERY PLAN ----------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------- Foreign Scan on public.tbl02 (cost=25.00..27.00 rows=2 width=1037) Output: id, c1, c2, c3 Foreign Table Size: 2 b - Remote SQL: SELECT "id","c1","c2","c3" FROM "public"."tbl02_tmp02" + Remote SQL: SELECT id, c1, c2, c3 FROM public.tbl02_tmp02 (4 rows) --Testcase 25: @@ -214,7 +217,7 @@ INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 0); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.tbl03 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl03"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl03(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'Sat Jan 01 00:00:00 2000'::timestamp without time zone, 0 (4 rows) @@ -227,14 +230,14 @@ INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 1); QUERY PLAN ---------------------------------------------------------------------------- Insert on public.tbl03 (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."tbl03"("id", "c1") VALUES (?, ?) + Remote SQL: INSERT INTO public.tbl03(id, c1) VALUES (?, ?) -> Result (cost=0.00..0.01 rows=1 width=12) Output: 'Sat Jan 01 00:00:00 2000'::timestamp without time zone, 1 (4 rows) --Testcase 36: INSERT INTO tbl03 VALUES ('2000-01-01 00:00:00', 1); --fail -psql:sql/14.0/new_test.sql:95: ERROR: Executing ODBC query +psql:sql/14.0/new_test.sql:98: ERROR: Executing ODBC query ERROR: duplicate key value violates unique constraint "tbl03_pkey" DETAIL: Key (id)=(2000-01-01 00:00:00) already exists.; Error while executing the query @@ -245,14 +248,13 @@ CREATE FOREIGN TABLE tbl04 (id INT OPTIONS (key 'true'), c1 float8, c2 bigint, --Testcase 38: EXPLAIN VERBOSE SELECT * FROM tbl04 WHERE abs(c1) > 3233; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) Output: id, c1, c2, c3, c4, c5 - Filter: (abs(tbl04.c1) > '3233'::double precision) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((abs(c1) > 3233)) +(4 rows) --Testcase 39: SELECT * FROM tbl04 WHERE abs(c1) > 3233; @@ -265,14 +267,13 @@ SELECT * FROM tbl04 WHERE abs(c1) > 3233; --Testcase 40: EXPLAIN VERBOSE SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=20) Output: id, c1, c2 - Filter: ((tbl04.c1 >= '0'::double precision) AND (tbl04.c2 > 0) AND (sqrt((tbl04.c2)::double precision) > sqrt(tbl04.c1))) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c1 >= 0)) AND ((c2 > 0)) AND ((sqrt(c2) > sqrt(c1))) +(4 rows) --Testcase 41: SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; @@ -289,14 +290,13 @@ SELECT id, c1, c2 FROM tbl04 WHERE sqrt(c2) > sqrt(c1) AND c1 >= 0 AND c2 > 0; --Testcase 42: EXPLAIN VERBOSE SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: c1, c2 - Filter: ((tbl04.c3 || tbl04.c3) <> 'things thing'::text) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT c1, c2 FROM public.tbl04 WHERE (((c3 || c3) <> 'things thing')) +(4 rows) --Testcase 43: SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; @@ -316,14 +316,13 @@ SELECT c1, c2 FROM tbl04 WHERE c3 || c3 != 'things thing'; --Testcase 44: EXPLAIN VERBOSE SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.02 rows=9 width=44) Output: c1, id, (c3 || c3) - Filter: ((abs(tbl04.c2))::double precision <> abs(tbl04.c1)) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT id, c1, c3 FROM public.tbl04 WHERE ((abs(c2) <> abs(c1))) +(4 rows) --Testcase 45: SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); @@ -343,14 +342,13 @@ SELECT c1, id, c3 || c3 FROM tbl04 WHERE abs(c2) <> abs(c1); --Testcase 46: EXPLAIN VERBOSE SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.05 rows=9 width=44) Output: (id + id), c2, (c3 || 'afas'::text) - Filter: (floor((tbl04.c2)::double precision) > '0'::double precision) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT id, c2, c3 FROM public.tbl04 WHERE ((floor(c2) > 0)) +(4 rows) --Testcase 47: SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; @@ -370,14 +368,13 @@ SELECT id + id, c2, c3 || 'afas' FROM tbl04 WHERE floor(c2) > 0; --Testcase 48: EXPLAIN VERBOSE SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=49) Output: c2, c3, c4, c5 - Filter: (tbl04.c5 > 'Sat Jan 01 00:00:00 2000'::timestamp without time zone) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT c2, c3, c4, c5 FROM public.tbl04 WHERE ((c5 > '2000-01-01 00:00:00')) +(4 rows) --Testcase 49: SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; @@ -391,14 +388,13 @@ SELECT c2, c3, c4, c5 FROM tbl04 WHERE c5 > '2000-01-01'; --Testcase 50: EXPLAIN VERBOSE SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=17) Output: c5, c4, c2 - Filter: (tbl04.c5 = ANY ('{"Sat Jan 01 00:00:00 2000","Mon Nov 01 00:00:00 2010"}'::timestamp without time zone[])) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(5 rows) + Remote SQL: SELECT c2, c4, c5 FROM public.tbl04 WHERE (c5 IN ('2000-01-01 00:00:00', '2010-11-01 00:00:00')) +(4 rows) --Testcase 51: SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); @@ -410,6 +406,264 @@ SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); Mon Nov 01 00:00:00 2010 | f | 22342 (4 rows) +--Testcase 245: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id IN (1, 2, 3)) +(4 rows) + +--Testcase 246: +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(3 rows) + +--Testcase 247: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + QUERY PLAN +------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id NOT IN (1, 2, 3)) +(4 rows) + +--Testcase 248: +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(6 rows) + +--Testcase 249: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); + QUERY PLAN +--------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id IN (1, 3) OR (id = c2))) +(4 rows) + +--Testcase 250: +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(2 rows) + +--Testcase 251: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + QUERY PLAN +--------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id NOT IN (1, 3)) AND ((id <> c2)) +(4 rows) + +--Testcase 252: +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(7 rows) + +--Testcase 253: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id NOT IN (c2, 2, 3)) +(4 rows) + +--Testcase 254: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+--------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(7 rows) + +--Testcase 255: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id = c2) AND (id = 2) AND (id = 3)) +(4 rows) + +--Testcase 256: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----+----+----+----+---- +(0 rows) + +--Testcase 257: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id <> c2) OR (id <> 2) OR (id <> 3)) +(4 rows) + +--Testcase 258: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(9 rows) + +--Testcase 259: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); + QUERY PLAN +---------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id IN (c2, 2, 3)) +(4 rows) + +--Testcase 260: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+---------+----+-------------------------- + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(2 rows) + +--Testcase 261: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); + QUERY PLAN +------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id NOT IN (1, 2, 3)) +(4 rows) + +--Testcase 262: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+-------+------------+----+-------------------------- + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(6 rows) + +--Testcase 263: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id = 1) AND (id = 2) AND (id = 3)) +(4 rows) + +--Testcase 264: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----+----+----+----+---- +(0 rows) + +--Testcase 265: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE ((id <> 1) OR (id <> 2) OR (id <> 3)) +(4 rows) + +--Testcase 266: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+------------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 + 4 | 55.23 | 523 | !)@(#)!_#! | f | Thu Nov 01 00:00:00 1990 + 5 | -1.12 | 22342 | (!)JAWLFJ | f | Mon Nov 01 00:00:00 2010 + 6 | 45021.21 | 2121 | example | f | Fri Oct 01 00:00:00 1999 + 7 | 121.9741 | 23241 | thing | f | Fri Oct 01 00:00:00 2010 + 8 | 75 | 316 | example | f | Fri Oct 01 10:10:00 1999 + 9 | 6867.34 | 8916 | thing | f | Fri Oct 01 10:10:00 2010 +(9 rows) + +--Testcase 267: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=61) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1, c2, c3, c4, c5 FROM public.tbl04 WHERE (id IN (1, 2, 3)) +(4 rows) + +--Testcase 268: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + id | c1 | c2 | c3 | c4 | c5 +----+----------+---------+-----------+----+-------------------------- + 1 | 31.12 | 128912 | anystring | t | Sat Jan 01 00:00:00 2000 + 2 | 2565.56 | 6565 | example | f | Sat Jan 01 00:00:00 2000 + 3 | -121.122 | 1829812 | thing | t | Sat Jan 01 00:00:00 2000 +(3 rows) + --Testcase 52: EXPLAIN VERBOSE SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); @@ -419,16 +673,15 @@ SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true Output: tbl04.c3, tbl04.c5, tbl04.c1 Filter: (SubPlan 1) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c3, c5 FROM public.tbl04 SubPlan 1 -> Materialize (cost=25.00..34.05 rows=9 width=4) Output: tbl04_1.id -> Foreign Scan on public.tbl04 tbl04_1 (cost=25.00..34.00 rows=9 width=4) Output: tbl04_1.id - Filter: tbl04_1.c4 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(13 rows) + Remote SQL: SELECT id FROM public.tbl04 WHERE (c4) +(12 rows) --Testcase 53: SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); @@ -452,14 +705,13 @@ SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 ! Output: tbl04.c1, tbl04.c5, tbl04.c3, tbl04.c2 Filter: (((hashed SubPlan 1) AND (tbl04.c1 > '0'::double precision)) OR (tbl04.c2 < 0)) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2, c3, c5 FROM public.tbl04 SubPlan 1 -> Foreign Scan on public.tbl04 tbl04_1 (cost=25.00..34.00 rows=9 width=8) Output: tbl04_1.c1 - Filter: tbl04_1.c4 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(11 rows) + Remote SQL: SELECT c1 FROM public.tbl04 WHERE (c4) +(10 rows) --Testcase 55: SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 != false) AND c1 > 0 OR c2 < 0; @@ -472,14 +724,14 @@ SELECT c1, c5, c3, c2 FROM tbl04 WHERE c1 = ANY (SELECT c1 FROM tbl04 WHERE c4 ! --Testcase 56: EXPLAIN VERBOSE SELECT variance(c1), variance(c2) FROM tbl04; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.05..34.06 rows=1 width=40) Output: variance(c1), variance(c2) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2 FROM public.tbl04 (6 rows) --Testcase 57: @@ -492,16 +744,15 @@ SELECT variance(c1), variance(c2) FROM tbl04; --Testcase 58: EXPLAIN VERBOSE SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Aggregate (cost=34.02..34.03 rows=1 width=8) Output: variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=8) Output: id, c1, c2, c3, c4, c5 - Filter: (tbl04.c3 <> 'aef'::text) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(7 rows) + Remote SQL: SELECT c1 FROM public.tbl04 WHERE ((c3 <> 'aef')) +(6 rows) --Testcase 59: SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; @@ -513,14 +764,14 @@ SELECT variance(c1) FROM tbl04 WHERE c3 <> 'aef'; --Testcase 60: EXPLAIN VERBOSE SELECT max(id), min(c1), variance(c2) FROM tbl04; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.07..34.08 rows=1 width=44) Output: max(id), min(c1), variance(c2) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=20) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 (6 rows) --Testcase 61: @@ -533,14 +784,14 @@ SELECT max(id), min(c1), variance(c2) FROM tbl04; --Testcase 62: EXPLAIN VERBOSE SELECT variance(c2), variance(c1) FROM tbl04; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.05..34.06 rows=1 width=40) Output: variance(c2), variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2 FROM public.tbl04 (6 rows) --Testcase 63: @@ -553,16 +804,15 @@ SELECT variance(c2), variance(c1) FROM tbl04; --Testcase 64: EXPLAIN VERBOSE SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Aggregate (cost=34.05..34.06 rows=1 width=16) Output: sum(c1), variance(c1) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=8) Output: id, c1, c2, c3, c4, c5 - Filter: (tbl04.id <= 10) Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" -(7 rows) + Remote SQL: SELECT c1 FROM public.tbl04 WHERE ((id <= 10)) +(6 rows) --Testcase 65: SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; @@ -575,15 +825,15 @@ SELECT sum(c1), variance(c1) FROM tbl04 WHERE id <= 10; --Testcase 66: EXPLAIN VERBOSE SELECT count(c1), sum(c2), variance(c2) FROM tbl04 HAVING (count(c1) > 0); - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.07..34.09 rows=1 width=72) Output: count(c1), sum(c2), variance(c2) Filter: (count(tbl04.c1) > 0) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2 FROM public.tbl04 (7 rows) --Testcase 67: @@ -596,15 +846,15 @@ SELECT count(c1), sum(c2), variance(c2) FROM tbl04 HAVING (count(c1) > 0); --Testcase 68: EXPLAIN VERBOSE SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 AND variance(c2) > 55.54; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Aggregate (cost=34.10..34.12 rows=1 width=64) Output: ((count(c1))::numeric + sum(c2)), (variance(c2) / 2.12) Filter: ((count(tbl04.c4) <> 0) AND (variance(tbl04.c2) > 55.54)) -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=17) Output: id, c1, c2, c3, c4, c5 Foreign Table Size: 9 b - Remote SQL: SELECT "id","c1","c2","c3","c4","c5" FROM "public"."tbl04" + Remote SQL: SELECT c1, c2, c4 FROM public.tbl04 (7 rows) --Testcase 69: @@ -614,9 +864,1897 @@ SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 2022757 | 171661843805.39832285 (1 row) +--Testcase 241: +EXPLAIN VERBOSE +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); + QUERY PLAN +----------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (count(c1)), (sum(c2)) + Filter: ((count(tbl04.c1)) > 0) + Foreign Table Size: 9 b + Remote SQL: SELECT count(c1), sum(c2) FROM public.tbl04 +(5 rows) + +--Testcase 242: +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); + count | sum +-------+--------- + 9 | 2022748 +(1 row) + +--Testcase 243: +EXPLAIN VERBOSE +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=32) + Output: (((count(c1))::numeric + sum(c2))) + Filter: (((count(tbl04.c4)) <> 0) AND ((avg(tbl04.c2)) > 55.54)) + Foreign Table Size: 9 b + Remote SQL: SELECT (count(c1) + sum(c2)), count(c4), avg(c2) FROM public.tbl04 +(5 rows) + +--Testcase 244: +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + ?column? +---------- + 2022757 +(1 row) + +--aggregation function push-down: +-- avg +--Testcase 80: +EXPLAIN VERBOSE +SELECT avg(c1), avg(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (avg(c1)), ((avg(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT avg(c1), (avg(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 81: +SELECT avg(c1), avg(c2) + 1 FROM tbl04; + avg | ?column? +-------------------+--------------------- + 6068.354677777777 | 224750.777777777778 +(1 row) + +-- avg(DISTINCT) +--Testcase 82: +EXPLAIN VERBOSE +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (avg(DISTINCT c1)), (avg(DISTINCT c2)) + Foreign Table Size: 9 b + Remote SQL: SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM public.tbl04 +(4 rows) + +--Testcase 83: +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + avg | avg +-------------------+--------------------- + 6068.354677777777 | 224749.777777777778 +(1 row) + +-- bit_and +--Testcase 84: +EXPLAIN VERBOSE +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=12) + Output: (bit_and(id)), ((bit_and(c2) + 1)) + Foreign Table Size: 9 b + Remote SQL: SELECT bit_and(id), (bit_and(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 85: +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; + bit_and | ?column? +---------+---------- + 0 | 1 +(1 row) + +-- bit_and(DISTINCT) +--Testcase 86: +EXPLAIN VERBOSE +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.05 rows=1 width=12) + Output: bit_and(DISTINCT id), bit_and(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c2 FROM public.tbl04 +(6 rows) + +--Testcase 87: +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + bit_and | bit_and +---------+--------- + 0 | 0 +(1 row) + +-- bit_or +--Testcase 88: +EXPLAIN VERBOSE +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=12) + Output: (bit_or(id)), ((bit_or(c2) + 1)) + Foreign Table Size: 9 b + Remote SQL: SELECT bit_or(id), (bit_or(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 89: +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; + bit_or | ?column? +--------+---------- + 15 | 1835008 +(1 row) + +-- bit_or(DISTINCT) +--Testcase 90: +EXPLAIN VERBOSE +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.05 rows=1 width=12) + Output: bit_or(DISTINCT id), bit_or(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c2 FROM public.tbl04 +(6 rows) + +--Testcase 91: +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + bit_or | bit_or +--------+--------- + 15 | 1835007 +(1 row) + +-- count +--Testcase 92: +EXPLAIN VERBOSE +SELECT count(c1), count(c2), count(c3) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan (cost=1.00..1.00 rows=1 width=24) + Output: (count(c1)), (count(c2)), (count(c3)) + Foreign Table Size: 9 b + Remote SQL: SELECT count(c1), count(c2), count(c3) FROM public.tbl04 +(4 rows) + +--Testcase 93: +SELECT count(c1), count(c2), count(c3) FROM tbl04; + count | count | count +-------+-------+------- + 9 | 9 | 9 +(1 row) + +-- count(DISTINCT) +--Testcase 94: +EXPLAIN VERBOSE +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=24) + Output: (count(DISTINCT c1)), (count(DISTINCT c2)), (count(DISTINCT c3)) + Foreign Table Size: 9 b + Remote SQL: SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM public.tbl04 +(4 rows) + +--Testcase 95: +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + count | count | count +-------+-------+------- + 9 | 9 | 5 +(1 row) + +-- max/min +--Testcase 241: +EXPLAIN VERBOSE +SELECT max(c1), min(c1) FROM tbl04; + QUERY PLAN +--------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=16) + Output: (max(c1)), (min(c1)) + Foreign Table Size: 9 b + Remote SQL: SELECT max(c1), min(c1) FROM public.tbl04 +(4 rows) + +--Testcase 242: +SELECT max(c1), min(c1) FROM tbl04; + max | min +----------+---------- + 45021.21 | -121.122 +(1 row) + +-- max/min (DISTINCT) +--Testcase 243: +EXPLAIN VERBOSE +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=16) + Output: (max(DISTINCT c1)), (min(DISTINCT c1)) + Foreign Table Size: 9 b + Remote SQL: SELECT max(DISTINCT c1), min(DISTINCT c1) FROM public.tbl04 +(4 rows) + +--Testcase 244: +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + max | min +----------+---------- + 45021.21 | -121.122 +(1 row) + +-- stddev +--Testcase 96: +EXPLAIN VERBOSE +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev(c1), (stddev(c2) + '1'::numeric) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 97: +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; + stddev | ?column? +-------------------+----------------- + 14787.10013608647 | 603261.39888878 +(1 row) + +-- stddev(DISTINCT) +--Testcase 98: +EXPLAIN VERBOSE +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev(DISTINCT c1), stddev(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 99: +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + stddev | stddev +-------------------+----------------- + 14787.10013608647 | 603260.39888878 +(1 row) + +-- stddev_pop +--Testcase 100: +EXPLAIN VERBOSE +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (stddev_pop(c1)), ((stddev_pop(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT stddev_pop(c1), (stddev_pop(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 101: +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; + stddev_pop | ?column? +--------------------+----------------- + 13941.411707081685 | 568760.35850074 +(1 row) + +-- stddev_pop(DISTINCT) +--Testcase 102: +EXPLAIN VERBOSE +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 103: +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + stddev_pop | stddev_pop +--------------------+----------------- + 13941.411707081685 | 568759.35850074 +(1 row) + +-- stddev_samp +--Testcase 104: +EXPLAIN VERBOSE +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (stddev_samp(c1)), ((stddev_samp(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT stddev_samp(c1), (stddev_samp(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 105: +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; + stddev_samp | ?column? +-------------------+----------------- + 14787.10013608647 | 603261.39888878 +(1 row) + +-- stddev_samp(DISTINCT) +--Testcase 106: +EXPLAIN VERBOSE +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 107: +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + stddev_samp | stddev_samp +-------------------+----------------- + 14787.10013608647 | 603260.39888878 +(1 row) + +-- sum +--Testcase 108: +EXPLAIN VERBOSE +SELECT sum(c1), sum(c2) + 1 FROM tbl04; + QUERY PLAN +--------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (sum(c1)), ((sum(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT sum(c1), (sum(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 109: +SELECT sum(c1), sum(c2) + 1 FROM tbl04; + sum | ?column? +------------+---------- + 54615.1921 | 2022749 +(1 row) + +-- sum(DISTINCT) +--Testcase 110: +EXPLAIN VERBOSE +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (sum(DISTINCT c1)), (sum(DISTINCT c2)) + Foreign Table Size: 9 b + Remote SQL: SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM public.tbl04 +(4 rows) + +--Testcase 111: +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + sum | sum +------------+--------- + 54615.1921 | 2022748 +(1 row) + +-- var_pop +--Testcase 112: +EXPLAIN VERBOSE +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (var_pop(c1)), ((var_pop(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT var_pop(c1), (var_pop(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 113: +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; + var_pop | ?column? +--------------------+----------------------- + 194362960.38635424 | 323487207883.17283951 +(1 row) + +-- var_pop(DISTINCT) +--Testcase 114: +EXPLAIN VERBOSE +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: var_pop(DISTINCT c1), var_pop(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 115: +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + var_pop | var_pop +--------------------+----------------------- + 194362960.38635424 | 323487207882.17283951 +(1 row) + +-- var_samp +--Testcase 116: +EXPLAIN VERBOSE +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan (cost=1.00..1.00 rows=1 width=40) + Output: (var_samp(c1)), ((var_samp(c2) + '1'::numeric)) + Foreign Table Size: 9 b + Remote SQL: SELECT var_samp(c1), (var_samp(c2) + 1) FROM public.tbl04 +(4 rows) + +--Testcase 117: +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; + var_samp | ?column? +-------------------+----------------------- + 218658330.4346485 | 363923108868.44444444 +(1 row) + +-- var_samp(DISTINCT) +--Testcase 118: +EXPLAIN VERBOSE +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: var_samp(DISTINCT c1), var_samp(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 119: +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + var_samp | var_samp +-------------------+----------------------- + 218658330.4346485 | 363923108867.44444444 +(1 row) + +-- variance(DISTINCT) +--Testcase 120: +EXPLAIN VERBOSE +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=40) + Output: variance(DISTINCT c1), variance(DISTINCT c2) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=16) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT c1, c2 FROM public.tbl04 +(6 rows) + +--Testcase 121: +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + variance | variance +-------------------+----------------------- + 218658330.4346485 | 363923108867.44444444 +(1 row) + +-- non-push down case: +--Testcase 122: +EXPLAIN VERBOSE +SELECT corr(id, c1) FROM tbl04; + QUERY PLAN +------------------------------------------------------------------------- + Aggregate (cost=34.05..34.06 rows=1 width=8) + Output: corr((id)::double precision, c1) + -> Foreign Scan on public.tbl04 (cost=25.00..34.00 rows=9 width=12) + Output: id, c1, c2, c3, c4, c5 + Foreign Table Size: 9 b + Remote SQL: SELECT id, c1 FROM public.tbl04 +(6 rows) + +--Testcase 123: +SELECT corr(id, c1) FROM tbl04; + corr +--------------------- + 0.20164072965667135 +(1 row) + +-- =================================================================== +-- WHERE push-down +-- =================================================================== +-- add some null record +--Testcase 124: +INSERT INTO tbl04 VALUES (11, -1.12, NULL, '(!)JAWLFJ', false, '2010-11-01 00:00:00'); +--Testcase 125: +INSERT INTO tbl04 VALUES (12, 45021.21, 2121, 'example', NULL, '1999-10-01 00:00:00'); +--Testcase 126: +INSERT INTO tbl04 VALUES (13, 121.9741, 23241, 'thing', NULL, '2010-10-01 00:00:00'); +--Testcase 127: +INSERT INTO tbl04 VALUES (14, 75, 316, 'example', NULL, '1999-10-01 10:10:00'); +--Testcase 128: +INSERT INTO tbl04 VALUES (15, 6867.34, 8916, NULL, false, '2010-10-01 10:10:00'); +-- Logical operator +--Testcase 129: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((c1 >= 0) OR ((c2 > 0) AND (NOT c4)))) +(4 rows) + +--Testcase 130: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + id | c1 | c2 +----+----------+-------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 131: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((c1 >= 0) OR c4)) +(4 rows) + +--Testcase 132: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 133: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + QUERY PLAN +------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (c4) AND ((c1 >= 0)) +(4 rows) + +--Testcase 134: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + id | c1 | c2 +----+-------+-------- + 1 | 31.12 | 128912 +(1 row) + +--Testcase 135: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((NOT c4)) +(4 rows) + +--Testcase 136: +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 15 | 6867.34 | 8916 +(9 rows) + +-- Comparison operator +--Testcase 137: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id > 1)) +(4 rows) + +--Testcase 138: +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + id | c1 | c2 +----+----------+--------- + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 139: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id >= 1)) +(4 rows) + +--Testcase 140: +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 141: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id < 2)) +(4 rows) + +--Testcase 142: +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + id | c1 | c2 +----+-------+-------- + 1 | 31.12 | 128912 +(1 row) + +--Testcase 143: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id <= 2)) +(4 rows) + +--Testcase 144: +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + id | c1 | c2 +----+---------+-------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 +(2 rows) + +--Testcase 145: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id = 2)) +(4 rows) + +--Testcase 146: +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + id | c1 | c2 +----+---------+------ + 2 | 2565.56 | 6565 +(1 row) + +--Testcase 147: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id <> 2)) +(4 rows) + +--Testcase 148: +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 149: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + QUERY PLAN +--------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id <> 2)) +(4 rows) + +--Testcase 150: +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 151: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + QUERY PLAN +---------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((id < 1) OR (id > 5))) +(4 rows) + +--Testcase 152: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + id | c1 | c2 +----+----------+------- + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 153: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + QUERY PLAN +--------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((id <= c2)) AND ((id >= c1)) +(4 rows) + +--Testcase 154: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + id | c1 | c2 +----+----------+--------- + 3 | -121.122 | 1829812 + 5 | -1.12 | 22342 +(2 rows) + +--Testcase 155: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + QUERY PLAN +--------------------------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((id < 1) OR (id > 5))) AND (((id < 5) OR (id > 1))) +(4 rows) + +--Testcase 156: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + id | c1 | c2 +----+----------+------- + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 157: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((((id >= c1) AND (id <= c2)) OR ((id >= c2) AND (id <= c1)))) +(4 rows) + +--Testcase 158: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + id | c1 | c2 +----+----------+--------- + 3 | -121.122 | 1829812 + 5 | -1.12 | 22342 +(2 rows) + +--Testcase 159: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: (tbl04.c1 IS DISTINCT FROM '2'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 +(5 rows) + +--Testcase 160: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 161: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: (tbl04.c1 IS DISTINCT FROM (tbl04.id)::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 +(5 rows) + +--Testcase 162: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(14 rows) + +--Testcase 163: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c3 IS NULL)) +(4 rows) + +--Testcase 164: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + id | c1 | c2 +----+---------+------ + 15 | 6867.34 | 8916 +(1 row) + +--Testcase 165: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + QUERY PLAN +---------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c3 IS NOT NULL)) +(4 rows) + +--Testcase 166: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 +(13 rows) + +--Testcase 167: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c4 IS TRUE)) +(4 rows) + +--Testcase 168: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 +(2 rows) + +--Testcase 169: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + QUERY PLAN +------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c4 IS FALSE)) +(4 rows) + +--Testcase 170: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 15 | 6867.34 | 8916 +(9 rows) + +--Testcase 171: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + QUERY PLAN +---------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c4 IS NOT TRUE)) +(4 rows) + +--Testcase 172: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 11 | -1.12 | + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(12 rows) + +--Testcase 173: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + QUERY PLAN +----------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((c4 IS NOT FALSE)) +(4 rows) + +--Testcase 174: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 3 | -121.122 | 1829812 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 +(5 rows) + +--Testcase 175: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=13) + Output: id, c1, c4 + Filter: (tbl04.c4 IS UNKNOWN) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c4 FROM public.tbl04 +(5 rows) + +--Testcase 176: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + id | c1 | c4 +----+----------+---- + 12 | 45021.21 | + 13 | 121.9741 | + 14 | 75 | +(3 rows) + +--Testcase 177: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=13) + Output: id, c1, c4 + Filter: (tbl04.c4 IS NOT UNKNOWN) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c4 FROM public.tbl04 +(5 rows) + +--Testcase 178: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down + id | c1 | c4 +----+----------+---- + 1 | 31.12 | t + 2 | 2565.56 | f + 3 | -121.122 | t + 4 | 55.23 | f + 5 | -1.12 | f + 6 | 45021.21 | f + 7 | 121.9741 | f + 8 | 75 | f + 9 | 6867.34 | f + 11 | -1.12 | f + 15 | 6867.34 | f +(11 rows) + +-- Mathematical operator +--Testcase 179: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id * 100 + 100 > c2; + QUERY PLAN +------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE ((((id * 100) + 100) > c2)) +(4 rows) + +--Testcase 180: +SELECT id, c1, c2 FROM tbl04 WHERE c1 * 100 + 100 > c2; + id | c1 | c2 +----+----------+------ + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(8 rows) + +--Testcase 181: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((c2 - c1) < 0)) +(4 rows) + +--Testcase 182: +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + id | c1 | c2 +----+----------+------ + 6 | 45021.21 | 2121 + 12 | 45021.21 | 2121 +(2 rows) + +--Testcase 183: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Filter: ((tbl04.c2 / 100) > 0) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 +(5 rows) + +--Testcase 184: +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + id | c1 | c2 +----+----------+--------- + 1 | 31.12 | 128912 + 2 | 2565.56 | 6565 + 3 | -121.122 | 1829812 + 4 | 55.23 | 523 + 5 | -1.12 | 22342 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 8 | 75 | 316 + 9 | 6867.34 | 8916 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 + 14 | 75 | 316 + 15 | 6867.34 | 8916 +(13 rows) + +--Testcase 185: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + QUERY PLAN +-------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=20) + Output: id, c1, c2 + Foreign Table Size: 14 b + Remote SQL: SELECT id, c1, c2 FROM public.tbl04 WHERE (((c2 % 2) = 1)) +(4 rows) + +--Testcase 186: +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + id | c1 | c2 +----+----------+------- + 2 | 2565.56 | 6565 + 4 | 55.23 | 523 + 6 | 45021.21 | 2121 + 7 | 121.9741 | 23241 + 12 | 45021.21 | 2121 + 13 | 121.9741 | 23241 +(6 rows) + +--Testcase 187: +EXPLAIN VERBOSE +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + QUERY PLAN +-------------------------------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, ((id)::double precision ^ '2'::double precision) + Filter: (((tbl04.id)::double precision ^ '2'::double precision) > '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 188: +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + id | ?column? +----+---------- + 3 | 9 + 4 | 16 + 5 | 25 + 6 | 36 + 7 | 49 + 8 | 64 + 9 | 81 + 11 | 121 + 12 | 144 + 13 | 169 + 14 | 196 + 15 | 225 +(12 rows) + +--Testcase 189: +EXPLAIN VERBOSE +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + QUERY PLAN +----------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, (|/ (id)::double precision) + Filter: ((|/ (tbl04.id)::double precision) < '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 190: +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + id | ?column? +----+-------------------- + 1 | 1 + 2 | 1.4142135623730951 + 3 | 1.7320508075688772 + 4 | 2 + 5 | 2.23606797749979 + 6 | 2.449489742783178 + 7 | 2.6457513110645907 + 8 | 2.8284271247461903 + 9 | 3 + 11 | 3.3166247903554 + 12 | 3.4641016151377544 + 13 | 3.605551275463989 + 14 | 3.7416573867739413 + 15 | 3.872983346207417 +(14 rows) + +--Testcase 191: +EXPLAIN VERBOSE +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.07 rows=14 width=12) + Output: id, (||/ (id)::double precision) + Filter: ((||/ (tbl04.id)::double precision) < '4'::double precision) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 192: +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + id | ?column? +----+-------------------- + 1 | 1 + 2 | 1.2599210498948734 + 3 | 1.4422495703074083 + 4 | 1.5874010519681996 + 5 | 1.7099759466766968 + 6 | 1.8171205928321394 + 7 | 1.9129311827723894 + 8 | 2 + 9 | 2.080083823051904 + 11 | 2.2239800905693157 + 12 | 2.2894284851066633 + 13 | 2.3513346877207577 + 14 | 2.4101422641752306 + 15 | 2.46621207433047 +(14 rows) + +--Testcase 193: +EXPLAIN VERBOSE +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=12) + Output: id, (@ c2) + Filter: ((@ tbl04.c2) < 1000) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c2 FROM public.tbl04 +(5 rows) + +--Testcase 194: +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + id | ?column? +----+---------- + 4 | 523 + 8 | 316 + 14 | 316 +(3 rows) + +--Testcase 195: +EXPLAIN VERBOSE +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id & 123) + Filter: ((tbl04.id & 123) < 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 196: +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + id | ?column? +----+---------- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 0 + 5 | 1 + 6 | 2 + 7 | 3 +(7 rows) + +--Testcase 197: +EXPLAIN VERBOSE +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=12) + Output: id, ('123'::bigint | c2) + Filter: (('123'::bigint | tbl04.c2) > 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c2 FROM public.tbl04 +(5 rows) + +--Testcase 198: +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + id | ?column? +----+---------- + 1 | 129019 + 2 | 6655 + 3 | 1829887 + 4 | 635 + 5 | 22399 + 6 | 2171 + 7 | 23291 + 8 | 383 + 9 | 8959 + 12 | 2171 + 13 | 23291 + 14 | 383 + 15 | 8959 +(13 rows) + +--Testcase 199: +EXPLAIN VERBOSE +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id # 324) + Filter: ((tbl04.id # 324) > 4) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 200: +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + id | ?column? +----+---------- + 1 | 325 + 2 | 326 + 3 | 327 + 4 | 320 + 5 | 321 + 6 | 322 + 7 | 323 + 8 | 332 + 9 | 333 + 11 | 335 + 12 | 328 + 13 | 329 + 14 | 330 + 15 | 331 +(14 rows) + +--Testcase 201: +EXPLAIN VERBOSE +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (~ id) + Filter: ((~ tbl04.id) < '-2'::integer) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 202: +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + id | ?column? +----+---------- + 2 | -3 + 3 | -4 + 4 | -5 + 5 | -6 + 6 | -7 + 7 | -8 + 8 | -9 + 9 | -10 + 11 | -12 + 12 | -13 + 13 | -14 + 14 | -15 + 15 | -16 +(13 rows) + +--Testcase 203: +EXPLAIN VERBOSE +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id << 2) + Filter: ((tbl04.id << 2) < 10) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 204: +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + id | ?column? +----+---------- + 1 | 4 + 2 | 8 +(2 rows) + +--Testcase 205: +EXPLAIN VERBOSE +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.03 rows=14 width=8) + Output: id, (id >> 2) + Filter: ((tbl04.id >> 2) = 0) + Foreign Table Size: 14 b + Remote SQL: SELECT id FROM public.tbl04 +(5 rows) + +--Testcase 206: +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + id | ?column? +----+---------- + 1 | 0 + 2 | 0 + 3 | 0 +(3 rows) + +-- String operator +--Testcase 207: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: ((tbl04.c3) IS NFC NORMALIZED) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 208: +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + c3 +------------ + anystring + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(13 rows) + +--Testcase 209: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (NOT ((tbl04.c3) IS NFKC NORMALIZED)) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 210: +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + c3 +---- +(0 rows) + +-- Pattern matching operator +--Testcase 211: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 WHERE ((c3 LIKE '%hi%')) +(4 rows) + +--Testcase 212: +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + c3 +------- + thing + thing + thing + thing +(4 rows) + +--Testcase 213: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + QUERY PLAN +------------------------------------------------------------------------ + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 WHERE ((c3 NOT LIKE '%hi%')) +(4 rows) + +--Testcase 214: +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + c3 +------------ + anystring + example + !)@(#)!_#! + (!)JAWLFJ + example + example + (!)JAWLFJ + example + example +(9 rows) + +--Testcase 215: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~~* '%Hi%'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 216: +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + c3 +------- + thing + thing + thing + thing +(4 rows) + +--Testcase 217: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~~* '%Hi%'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 218: +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + c3 +------------ + anystring + example + !)@(#)!_#! + (!)JAWLFJ + example + example + (!)JAWLFJ + example + example +(9 rows) + +--Testcase 219: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~ '^(?:.*(?:y|w).*)$'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 220: +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 221: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~ '^(?:.*(?:y|w).*)$'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 222: +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +--Testcase 223: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~ 'any.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 224: +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 225: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 ~* 'ANY.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 226: +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + c3 +----------- + anystring +(1 row) + +--Testcase 227: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~ 'any.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 228: +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +--Testcase 229: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + QUERY PLAN +-------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=32) + Output: c3 + Filter: (tbl04.c3 !~* 'ANY.*'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT c3 FROM public.tbl04 +(5 rows) + +--Testcase 230: +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + c3 +------------ + example + thing + !)@(#)!_#! + (!)JAWLFJ + example + thing + example + thing + (!)JAWLFJ + example + thing + example +(12 rows) + +-- test for specific type +--Testcase 231: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE inet; +--Testcase 232: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 + 1 > inet '192.168.1.100'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 + '1'::bigint) > '192.168.1.100'::inet) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM public.tbl04 +(5 rows) + +--Testcase 233: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE json; +--Testcase 234: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 ->> 'tag'::text) = 'test data'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM public.tbl04 +(5 rows) + +--Testcase 235: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE jsonb; +--Testcase 236: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: ((tbl04.c3 ->> 'tag'::text) = 'test data'::text) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM public.tbl04 +(5 rows) + +--Testcase 237: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE point; +--Testcase 238: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 >> point '(1, 3)'; -- does not push down + QUERY PLAN +------------------------------------------------------------------- + Foreign Scan on public.tbl04 (cost=25.00..39.00 rows=14 width=4) + Output: id + Filter: (tbl04.c3 >> '(1,3)'::point) + Foreign Table Size: 14 b + Remote SQL: SELECT id, c3 FROM public.tbl04 +(5 rows) + +-- reset c3 column type +--Testcase 239: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE text; +-- Reset data for tbl04; +--Testcase 240: +DELETE FROM tbl04 WHERE id > 10; --Testcase 70: DROP SERVER :DB_SERVERNAME CASCADE; -psql:sql/14.0/new_test.sql:184: NOTICE: drop cascades to 5 other objects +psql:sql/14.0/new_test.sql:778: NOTICE: drop cascades to 5 other objects DETAIL: drop cascades to user mapping for public on server postgres_server drop cascades to foreign table tbl01 drop cascades to foreign table tbl02 diff --git a/expected/14.0/postgresql/ported_postgres_fdw.out b/expected/14.0/postgresql/ported_postgres_fdw.out index 0ffa130..1ea7d9f 100644 --- a/expected/14.0/postgresql/ported_postgres_fdw.out +++ b/expected/14.0/postgresql/ported_postgres_fdw.out @@ -269,8 +269,8 @@ SELECT * FROM ft1 ORDER BY c3, c1 OFFSET 100 LIMIT 10; -- single table with alias - also test that tableoid sort is not pushed to remote side --Testcase 35: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tableoid OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8, tableoid -> Sort @@ -278,7 +278,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tabl Sort Key: t1.c3, t1.c1, t1.tableoid -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, tableoid - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 36: @@ -300,8 +300,8 @@ SELECT * FROM ft1 t1 ORDER BY t1.c3, t1.c1, t1.tableoid OFFSET 100 LIMIT 10; -- whole-row reference --Testcase 37: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: t1.*, c3, c1 -> Sort @@ -309,7 +309,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT t1 FROM ft1 t1 ORDER BY t1.c3, t1.c1 OFFSET Sort Key: t1.c3, t1.c1 -> Foreign Scan on public.ft1 t1 Output: t1.*, c3, c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 38: @@ -338,12 +338,12 @@ SELECT * FROM ft1 WHERE false; -- with WHERE clause --Testcase 40: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1'; - QUERY PLAN --------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c7 >= '1'::bpchar) AND (t1.c1 = 101) AND ((t1.c6)::text = '1'::text)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Filter: ((t1.c6)::text = '1'::text) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c7 >= '1')) AND (("C_1" = 101)) (4 rows) --Testcase 41: @@ -356,15 +356,14 @@ SELECT * FROM ft1 t1 WHERE t1.c1 = 101 AND t1.c6 = '1' AND t1.c7 >= '1'; -- with FOR UPDATE/SHARE --Testcase 42: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- LockRows Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* - Filter: (t1.c1 = 101) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 101)) +(5 rows) --Testcase 43: SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; @@ -375,15 +374,14 @@ SELECT * FROM ft1 t1 WHERE c1 = 101 FOR UPDATE; --Testcase 44: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- LockRows Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8, t1.* - Filter: (t1.c1 = 102) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 102)) +(5 rows) --Testcase 45: SELECT * FROM ft1 t1 WHERE c1 = 102 FOR SHARE; @@ -459,8 +457,8 @@ SET enable_nestloop TO false; --Testcase 53: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2."C_1" FROM ft2 t1 JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------- Limit Output: t1.c1, t2."C_1" -> Merge Join @@ -471,13 +469,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t2."C_1" Sort Key: t2."C_1" -> Foreign Scan on "S 1"."T1" t2 Output: t2."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (17 rows) --Testcase 54: @@ -501,8 +499,8 @@ SELECT t1.c1, t2."C_1" FROM ft2 t1 JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFS --Testcase 55: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2."C_1" FROM ft2 t1 LEFT JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------- Limit Output: t1.c1, t2."C_1" -> Merge Left Join @@ -513,13 +511,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t2."C_1" Sort Key: t2."C_1" -> Foreign Scan on "S 1"."T1" t2 Output: t2."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (17 rows) --Testcase 56: @@ -543,8 +541,8 @@ SELECT t1.c1, t2."C_1" FROM ft2 t1 LEFT JOIN "S 1"."T1" t2 ON (t1.c1 = t2."C_1") --Testcase 57: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1" FROM "S 1"."T1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Limit Output: t1."C_1" -> Merge Left Join @@ -555,7 +553,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t3.c1 -> Merge Join @@ -566,13 +564,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (28 rows) --Testcase 58: @@ -597,8 +595,8 @@ SELECT t1."C_1" FROM "S 1"."T1" t1 left join ft1 t2 join ft2 t3 on (t2.c1 = t3.c --Testcase 59: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 left join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Limit Output: t1."C_1", t2.c1, t3.c1 -> Merge Left Join @@ -609,7 +607,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t3.c1, t2.c1 -> Merge Left Join @@ -620,13 +618,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t2.c1 Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (28 rows) --Testcase 60: @@ -649,8 +647,8 @@ SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 left join ft1 t2 full join ft2 --Testcase 61: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1", t2.c1, t3.c1 FROM "S 1"."T1" t1 full join ft1 t2 full join ft2 t3 on (t2.c1 = t3.c1) on (t3.c1 = t1."C_1") OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------- Limit Output: t1."C_1", t2.c1, t3.c1 -> Merge Full Join @@ -661,7 +659,7 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1" - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t2.c1, t3.c1 Sort Key: t3.c1 @@ -673,13 +671,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: t2.c1 -> Foreign Scan on public.ft1 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (29 rows) --Testcase 62: @@ -716,14 +714,14 @@ DELETE FROM ft_empty; -- ANALYZE ft_empty; --Testcase 68: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft_empty ORDER BY c1; - QUERY PLAN ------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------- Sort Output: c1, c2 Sort Key: ft_empty.c1 -> Foreign Scan on public.ft_empty Output: c1, c2 - Remote SQL: SELECT "c1","c2" FROM "public"."loct_empty" + Remote SQL: SELECT c1, c2 FROM public.loct_empty (6 rows) -- =================================================================== @@ -731,113 +729,105 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft_empty ORDER BY c1; -- =================================================================== --Testcase 69: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 1; -- Var, OpExpr(b), Const - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 70: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 = 100 AND t1.c2 = 0; -- BoolExpr - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c1 = 100) AND (t1.c2 = 0)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 100)) AND ((c2 = 0)) +(3 rows) --Testcase 71: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NULL; -- NullTest - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 IS NULL) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" IS NULL)) +(3 rows) --Testcase 72: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 IS NOT NULL; -- NullTest - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 IS NOT NULL) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" IS NOT NULL)) +(3 rows) --Testcase 73: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE round(abs(c1), 0) = 1; -- FuncExpr - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (round((abs(t1.c1))::numeric, 0) = '1'::numeric) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((round(abs("C_1"), 0) = 1)) +(3 rows) --Testcase 74: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = -c1; -- OpExpr(l) - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = (- t1.c1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = (- "C_1"))) +(3 rows) --Testcase 75: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c1 IS NOT NULL) IS DISTINCT FROM (c1 IS NOT NULL); -- DistinctExpr - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c1 IS NOT NULL) IS DISTINCT FROM (t1.c1 IS NOT NULL)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 76: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = ANY(ARRAY[c2, 1, c1 + 0]); -- ScalarArrayOpExpr - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = ANY (ARRAY[t1.c2, 1, (t1.c1 + 0)])) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ("C_1" IN (c2, 1, ("C_1" + 0))) +(3 rows) --Testcase 77: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = (ARRAY[c1,c2,3])[1]; -- SubscriptingRef - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = (ARRAY[t1.c1, t1.c2, 3])[1]) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 78: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c6 = E'foo''s\\bar'; -- check special chars - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c6)::text = 'foo''s\bar'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 79: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c8 = 'foo'; -- can't be sent to remote - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c8 = 'foo'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) +(3 rows) -- parameterized remote path for foreign table --Testcase 80: @@ -850,14 +840,13 @@ EXPLAIN (VERBOSE, COSTS OFF) Hash Cond: (a.c2 = b.c1) -> Foreign Scan on "S 1"."T1" a Output: a."C_1", a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8 - Filter: (a."C_1" = 47) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 47)) -> Hash Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 -> Foreign Scan on public.ft2 b Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(12 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" +(11 rows) --Testcase 81: SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2; @@ -871,8 +860,8 @@ SELECT * FROM ft2 a, ft2 b WHERE a.c1 = 47 AND b.c1 = a.c2; EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 a, ft2 b WHERE a.c2 = 6 AND b.c1 = a.c1 AND a.c8 = 'foo' AND b.c7 = upper(a.c7); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------- Merge Join Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8 Merge Cond: ((a.c1 = b.c1) AND ((upper((a.c7)::text)) = ((b.c7)::text))) @@ -881,15 +870,14 @@ EXPLAIN (VERBOSE, COSTS OFF) Sort Key: a.c1, (upper((a.c7)::text)) -> Foreign Scan on public.ft2 a Output: a.c1, a.c2, a.c3, a.c4, a.c5, a.c6, a.c7, a.c8, upper((a.c7)::text) - Filter: ((a.c2 = 6) AND (a.c8 = 'foo'::text)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c2 = 6)) AND ((c8 = 'foo')) -> Sort Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8, ((b.c7)::text) Sort Key: b.c1, ((b.c7)::text) -> Foreign Scan on public.ft2 b Output: b.c1, b.c2, b.c3, b.c4, b.c5, b.c6, b.c7, b.c8, b.c7 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(16 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" +(15 rows) --Testcase 83: SELECT * FROM ft2 a, ft2 b @@ -1024,27 +1012,27 @@ SELECT * FROM ft2 WHERE c1 = ANY (ARRAY(SELECT c1 FROM ft1 WHERE c1 < 5)); --Testcase 86: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 ORDER BY ft2.c1, random(); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Sort Output: c1, c2, c3, c4, c5, c6, c7, c8, (random()) Sort Key: ft2.c1, (random()) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8, random() - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (6 rows) --Testcase 87: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft2 ORDER BY ft2.c1, ft2.c3 collate "C"; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Sort Output: c1, c2, c3, c4, c5, c6, c7, c8, ((c3)::text) Sort Key: ft2.c1, ft2.c3 COLLATE "C" -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8, c3 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (6 rows) -- user-defined operator/function @@ -1065,15 +1053,12 @@ CREATE OPERATOR === ( --Testcase 90: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: count(c3) - -> Foreign Scan on public.ft1 t1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = abs(t1.c2)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------- + Foreign Scan + Output: (count(c3)) + Remote SQL: SELECT count(c3) FROM public."T1" WHERE (("C_1" = abs(c2))) +(3 rows) --Testcase 91: SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); @@ -1085,15 +1070,12 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = abs(t1.c2); --Testcase 92: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: count(c3) - -> Foreign Scan on public.ft1 t1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + QUERY PLAN +---------------------------------------------------------------------- + Foreign Scan + Output: (count(c3)) + Remote SQL: SELECT count(c3) FROM public."T1" WHERE (("C_1" = c2)) +(3 rows) --Testcase 93: SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; @@ -1106,14 +1088,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = t1.c2; --Testcase 94: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = postgres_fdw_abs(t1.c2)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 95: @@ -1126,14 +1108,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); --Testcase 96: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 97: @@ -1147,8 +1129,8 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 98: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -1157,7 +1139,7 @@ EXPLAIN (VERBOSE, COSTS OFF) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (9 rows) --Testcase 99: @@ -1178,14 +1160,14 @@ ALTER EXTENSION :DB_EXTENSIONNAME ADD OPERATOR === (int, int); --Testcase 102: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = postgres_fdw_abs(t1.c2)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 103: @@ -1198,14 +1180,14 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 = postgres_fdw_abs(t1.c2); --Testcase 104: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 105: @@ -1219,8 +1201,8 @@ SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 106: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -1229,7 +1211,7 @@ EXPLAIN (VERBOSE, COSTS OFF) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (9 rows) --Testcase 107: @@ -1250,8 +1232,8 @@ SELECT * FROM ft1 t1 WHERE t1.c1 === t1.c2 order by t1.c2 limit 1; --Testcase 108: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -1262,12 +1244,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (16 rows) --Testcase 109: @@ -1290,8 +1272,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 110: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t3 ON (t3.c1 = t1.c1) ORDER BY t1.c3, t1.c1 OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3, t1.c3 -> Sort @@ -1302,7 +1284,7 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t Hash Cond: (t2.c1 = t1.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: t1.c1, t1.c3, t3.c3, t3.c1 -> Hash Join @@ -1310,12 +1292,12 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t Hash Cond: (t1.c1 = t3.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (24 rows) --Testcase 111: @@ -1338,8 +1320,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) JOIN ft4 t --Testcase 112: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -1350,12 +1332,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (16 rows) --Testcase 113: @@ -1378,8 +1360,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. --Testcase 114: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1390,17 +1372,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 115: @@ -1425,22 +1407,20 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 116: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10; - QUERY PLAN --------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Hash Left Join Output: t1.c1, t1.c2, ft5.c1, ft5.c2 Hash Cond: (t1.c1 = ft5.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: (t1.c1 < 10) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2 FROM public."T3" WHERE ((c1 < 10)) -> Hash Output: ft5.c1, ft5.c2 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2 - Filter: (ft5.c1 < 10) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(13 rows) + Remote SQL: SELECT c1, c2 FROM public."T4" WHERE ((c1 < 10)) +(11 rows) --Testcase 117: SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE t1.c1 < 10; @@ -1458,23 +1438,21 @@ SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) WHERE (t2.c1 < 10 OR t2.c1 IS NULL) AND t1.c1 < 10; - QUERY PLAN --------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Hash Left Join Output: t1.c1, t1.c2, ft5.c1, ft5.c2 Hash Cond: (t1.c1 = ft5.c1) Filter: ((ft5.c1 < 10) OR (ft5.c1 IS NULL)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: (t1.c1 < 10) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2 FROM public."T3" WHERE ((c1 < 10)) -> Hash Output: ft5.c1, ft5.c2 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2 - Filter: (ft5.c1 < 10) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(14 rows) + Remote SQL: SELECT c1, c2 FROM public."T4" WHERE ((c1 < 10)) +(12 rows) --Testcase 119: SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE c1 < 10) t2 ON (t1.c1 = t2.c1) @@ -1491,8 +1469,8 @@ SELECT t1.c1, t1.c2, t2.c1, t2.c2 FROM ft4 t1 LEFT JOIN (SELECT * FROM ft5 WHERE --Testcase 120: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2.c1, t1.c1 OFFSET 10 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -1503,12 +1481,12 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2 Hash Cond: (t2.c1 = t1.c1) -> Foreign Scan on public.ft4 t2 Output: t2.c1, t2.c2, t2.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t1.c1 -> Foreign Scan on public.ft5 t1 Output: t1.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (16 rows) --Testcase 121: @@ -1531,8 +1509,8 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 RIGHT JOIN ft4 t2 ON (t1.c1 = t2.c1) ORDER BY t2 --Testcase 122: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1543,17 +1521,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGH Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t3 Output: t3.c1, t3.c2, t3.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (21 rows) --Testcase 123: @@ -1576,8 +1554,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGH --Testcase 124: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 45 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -1588,12 +1566,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (16 rows) --Testcase 125: @@ -1617,8 +1595,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1. --Testcase 126: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort Output: ft4.c1, ft5.c1 Sort Key: ft4.c1, ft5.c1 @@ -1627,15 +1605,13 @@ SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(16 rows) + Remote SQL: SELECT c1 FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(14 rows) --Testcase 127: SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1; @@ -1654,23 +1630,21 @@ SELECT t1.c1, t2.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL --Testcase 128: EXPLAIN (VERBOSE, COSTS OFF) SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Limit Output: 1 -> Merge Full Join Output: 1 -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT NULL FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Materialize Output: ft5.c1, ft5.c2, ft5.c3 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2, ft5.c3 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(14 rows) + Remote SQL: SELECT NULL FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(12 rows) --Testcase 129: SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t2 ON (TRUE) OFFSET 10 LIMIT 10; @@ -1693,8 +1667,8 @@ SELECT 1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELE --Testcase 130: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Sort Output: ft4.c1, t2.c1, t3.c1 Sort Key: ft4.c1, t2.c1, t3.c1 @@ -1706,20 +1680,18 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 Hash Cond: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t2 Output: t2.c1, t2.c2, t2.c3 - Filter: ((t2.c1 >= 50) AND (t2.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: t3.c1 -> Foreign Scan on public.ft5 t3 Output: t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" -(24 rows) + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(22 rows) --Testcase 131: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM ft4 t2 LEFT JOIN ft5 t3 ON (t2.c1 = t3.c1) WHERE (t2.c1 between 50 and 60)) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; @@ -1737,8 +1709,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 --Testcase 132: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------ Sort Output: ft4.c1, ft4_1.c1, ft5.c1 Sort Key: ft4.c1, ft4_1.c1, ft5.c1 @@ -1751,21 +1723,18 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 Filter: ((ft4_1.c1 IS NULL) OR (ft4_1.c1 IS NOT NULL)) -> Foreign Scan on public.ft4 ft4_1 Output: ft4_1.c1, ft4_1.c2, ft4_1.c3 - Filter: ((ft4_1.c1 >= 50) AND (ft4_1.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" -(26 rows) + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(23 rows) --Testcase 133: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 FULL JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (t1.c1 = ss.a) ORDER BY t1.c1, ss.a, ss.b; @@ -1785,8 +1754,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t1 --Testcase 134: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1; - QUERY PLAN --------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- LockRows Output: "T3".c1, ft4.c1, ft5.c1, "T3".*, ft4.*, ft5.* -> Sort @@ -1796,8 +1765,7 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER Output: "T3".c1, ft4.c1, ft5.c1, "T3".*, ft4.*, ft5.* -> Foreign Scan on "S 1"."T3" Output: "T3".c1, "T3".* - Filter: ("T3".c1 = 50) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" WHERE ((c1 = 50)) -> Materialize Output: ft4.c1, ft4.*, ft5.c1, ft5.* -> Hash Full Join @@ -1806,15 +1774,13 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER Filter: ((ft4.c1 IS NULL) OR (ft4.c1 IS NOT NULL)) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.* - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1, ft5.* -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.* - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(27 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(24 rows) --Testcase 135: SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER JOIN (SELECT t2.c1, t3.c1 FROM (SELECT c1 FROM ft4 WHERE c1 between 50 and 60) t2 FULL JOIN (SELECT c1 FROM ft5 WHERE c1 between 50 and 60) t3 ON (t2.c1 = t3.c1) WHERE t2.c1 IS NULL OR t2.c1 IS NOT NULL) ss(a, b) ON (TRUE) ORDER BY t1.c1, ss.a, ss.b FOR UPDATE OF t1; @@ -1834,8 +1800,8 @@ SELECT t1.c1, ss.a, ss.b FROM (SELECT c1 FROM "S 1"."T3" WHERE c1 = 50) t1 INNER --Testcase 136: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1, t3.c1 -> Sort @@ -1849,19 +1815,18 @@ SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 a Hash Cond: (t1.c1 = (t2.c1 + 1)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Filter: ((t1.c1 >= 50) AND (t1.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" -> Hash Output: t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" -(25 rows) + Remote SQL: SELECT c1 FROM public."T3" +(24 rows) --Testcase 137: SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 and t1.c1 between 50 and 60) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) ORDER BY t1.c1, t2.c1, t3.c1 LIMIT 10; @@ -1883,8 +1848,8 @@ SELECT t1.c1, t2.c1, t3.c1 FROM ft4 t1 INNER JOIN ft5 t2 ON (t1.c1 = t2.c1 + 1 a --Testcase 138: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -1895,17 +1860,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 139: @@ -1928,8 +1893,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 140: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -1940,17 +1905,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft4 t3 Output: t3.c1, t3.c2, t3.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (21 rows) --Testcase 141: @@ -1973,8 +1938,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT --Testcase 142: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -1985,17 +1950,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 143: @@ -2018,8 +1983,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 144: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2030,17 +1995,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 145: @@ -2063,8 +2028,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 146: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Full Join @@ -2075,17 +2040,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 147: @@ -2108,8 +2073,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) FULL --Testcase 148: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Nested Loop Left Join @@ -2120,17 +2085,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT Join Filter: (t2.c1 = t3.c1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Materialize Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" -> Materialize Output: t1.c1 -> Foreign Scan on public.ft2 t1 Output: t1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (21 rows) --Testcase 149: @@ -2153,8 +2118,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 RIGHT JOIN ft2 t2 ON (t1.c1 = t2.c1) LEFT --Testcase 150: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT JOIN ft4 t3 ON (t2.c1 = t3.c1) OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t3.c3 -> Hash Right Join @@ -2165,17 +2130,17 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT Join Filter: (t1.c1 = t2.c1) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: t3.c3, t3.c1 -> Foreign Scan on public.ft4 t3 Output: t3.c3, t3.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c3 FROM public."T3" (21 rows) --Testcase 151: @@ -2198,8 +2163,8 @@ SELECT t1.c1, t2.c2, t3.c3 FROM ft2 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) RIGHT --Testcase 152: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 = t2.c1 OR t1.c1 IS NULL) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2211,12 +2176,12 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 Filter: ((t1.c1 = t2.c1) OR (t1.c1 IS NULL)) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (17 rows) --Testcase 153: @@ -2239,8 +2204,8 @@ SELECT t1.c1, t2.c1 FROM ft4 t1 FULL JOIN ft5 t2 ON (t1.c1 = t2.c1) WHERE (t1.c1 --Testcase 154: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t1.c3 -> Hash Full Join @@ -2249,12 +2214,12 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE Filter: (postgres_fdw_abs(t1.c1) > 0) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (14 rows) -- Option 'extensions' is not supported @@ -2263,8 +2228,8 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE --Testcase 155: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE postgres_fdw_abs(t1.c1) > 0 OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c2, t1.c3 -> Hash Full Join @@ -2273,12 +2238,12 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE Filter: (postgres_fdw_abs(t1.c1) > 0) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (14 rows) -- ALTER SERVER :DB_SERVERNAME OPTIONS (ADD extensions :DB_EXTENSIONNAME); @@ -2287,8 +2252,8 @@ SELECT t1.c1, t2.c2, t1.c3 FROM ft1 t1 FULL JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE --Testcase 156: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE OF t1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2301,12 +2266,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (18 rows) --Testcase 157: @@ -2328,8 +2293,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 158: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR UPDATE; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2342,12 +2307,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (18 rows) --Testcase 159: @@ -2370,8 +2335,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 160: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE OF t1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2384,12 +2349,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (18 rows) --Testcase 161: @@ -2411,8 +2376,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 162: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10 FOR SHARE; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3, t1.*, t2.* -> LockRows @@ -2425,12 +2390,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.c1, t2.* -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (18 rows) --Testcase 163: @@ -2453,8 +2418,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t --Testcase 164: EXPLAIN (VERBOSE, COSTS OFF) WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) SELECT c1_1, c2_1 FROM t ORDER BY c1_3, c1_1 OFFSET 100 LIMIT 10; - QUERY PLAN ------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Limit Output: t.c1_1, t.c2_1, t.c1_3 CTE t @@ -2463,12 +2428,12 @@ WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Sort Output: t.c1_1, t.c2_1, t.c1_3 Sort Key: t.c1_3, t.c1_1 @@ -2496,8 +2461,8 @@ WITH t (c1_1, c1_3, c2_1) AS MATERIALIZED (SELECT t1.c1, t1.c3, t2.c1 FROM ft1 t --Testcase 166: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Limit Output: t1.ctid, t1.*, t2.*, t1.c1, t1.c3 -> Sort @@ -2508,20 +2473,20 @@ SELECT t1.ctid, t1, t2, t1.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) ORDER B Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.ctid, t1.*, t1.c1, t1.c3 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: t2.*, t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.*, t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (16 rows) -- SEMI JOIN, not pushed down --Testcase 167: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) ORDER BY t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1 -> Sort @@ -2533,7 +2498,7 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c1 -> HashAggregate @@ -2541,7 +2506,7 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) Group Key: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (20 rows) --Testcase 168: @@ -2564,8 +2529,8 @@ SELECT t1.c1 FROM ft1 t1 WHERE EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c1) --Testcase 169: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2.c2) ORDER BY t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1 -> Sort @@ -2576,12 +2541,12 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2 Hash Cond: (t1.c1 = t2.c2) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c2 -> Foreign Scan on public.ft2 t2 Output: t2.c2 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (16 rows) --Testcase 170: @@ -2604,8 +2569,8 @@ SELECT t1.c1 FROM ft1 t1 WHERE NOT EXISTS (SELECT 1 FROM ft2 t2 WHERE t1.c1 = t2 --Testcase 171: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2615,12 +2580,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 1 Output: t1.c1, t2.c1 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Materialize Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (15 rows) --Testcase 172: @@ -2643,8 +2608,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 CROSS JOIN ft2 t2 ORDER BY t1.c1, t2.c1 OFFSET 1 --Testcase 173: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2655,12 +2620,12 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft5 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" -> Hash Output: t2.c1 -> Foreign Scan on public.ft6 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (16 rows) --Testcase 174: @@ -2674,8 +2639,8 @@ SELECT t1.c1, t2.c1 FROM ft5 t1 JOIN ft6 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t --Testcase 175: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1.c1, t2.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Limit Output: t1.c1, t2.c1 -> Sort @@ -2686,12 +2651,12 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1. Hash Cond: (t1.c8 = t2.c8) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c8 FROM public."T1" -> Hash Output: t2.c1, t2.c8 -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c8 FROM public."T1" (16 rows) --Testcase 176: @@ -2714,8 +2679,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c8 = t2.c8) ORDER BY t1. --Testcase 177: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -2726,14 +2691,13 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c8 = 'foo'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" WHERE ((c8 = 'foo')) -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(17 rows) + Remote SQL: SELECT "C_1" FROM public."T1" +(16 rows) --Testcase 178: SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = 'foo' ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; @@ -2758,8 +2722,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 LEFT JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 --Testcase 179: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2.c8 ORDER BY t1.c3, t1.c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: t1.c1, t2.c1, t1.c3 -> Sort @@ -2773,13 +2737,13 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2. Sort Key: t1.c1, t1.c8 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c3, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3, c8 FROM public."T1" -> Sort Output: t2.c1, t2.c8 Sort Key: t2.c1, t2.c8 -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c8 FROM public."T1" (20 rows) --Testcase 180: @@ -2802,8 +2766,8 @@ SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) WHERE t1.c8 = t2. --Testcase 181: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1) UNION SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 ON (t1.c1 = t2.c1)) AS t (t1c1, t2c1) GROUP BY t1c1 ORDER BY t1c1 OFFSET 100 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Limit Output: t1.c1, (avg((t1.c1 + t2.c1))) -> Sort @@ -2821,23 +2785,23 @@ SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Join Output: t1_1.c1, t2_1.c1 Hash Cond: (t1_1.c1 = t2_1.c1) -> Foreign Scan on public.ft1 t1_1 Output: t1_1.c1, t1_1.c2, t1_1.c3, t1_1.c4, t1_1.c5, t1_1.c6, t1_1.c7, t1_1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2_1.c1 -> Foreign Scan on public.ft2 t2_1 Output: t2_1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (34 rows) --Testcase 182: @@ -2860,8 +2824,8 @@ SELECT t1c1, avg(t1c1 + t2c1) FROM (SELECT t1.c1, t2.c1 FROM ft1 t1 JOIN ft2 t2 --Testcase 183: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM ft1 t2, ft2 t3 WHERE t2.c1 = t3.c1 AND t2.c2 = t1.c2) q ORDER BY t1."C_1" OFFSET 10 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------- Limit Output: t1."C_1" -> Sort @@ -2871,7 +2835,7 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f Output: t1."C_1" -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1", t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Unique Output: t2.c1, t3.c1 -> Merge Join @@ -2883,13 +2847,13 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f -> Foreign Scan on public.ft1 t2 Output: t2.c1 Filter: (t2.c2 = t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Sort Output: t3.c1 Sort Key: t3.c1 -> Foreign Scan on public.ft2 t3 Output: t3.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (28 rows) --Testcase 184: @@ -2914,22 +2878,20 @@ SELECT t1."C_1" FROM "S 1"."T1" t1, LATERAL (SELECT DISTINCT t2.c1, t3.c1 FROM f --Testcase 185: EXPLAIN (VERBOSE, COSTS OFF) SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Nested Loop Left Join Output: (13), ft2.c1 Join Filter: (13 = ft2.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: ((ft2.c1 >= 10) AND (ft2.c1 <= 15)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" >= 10)) AND (("C_1" <= 15)) -> Materialize Output: (13) -> Foreign Scan on public.ft1 Output: 13 - Filter: (ft1.c1 = 13) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(13 rows) + Remote SQL: SELECT NULL FROM public."T1" WHERE (("C_1" = 13)) +(11 rows) --Testcase 186: SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 ON (q.a = ft2.c1) WHERE ft2.c1 BETWEEN 10 AND 15; @@ -2947,8 +2909,8 @@ SELECT q.a, ft2.c1 FROM (SELECT 13 FROM ft1 WHERE c1 = 13) q(a) RIGHT JOIN ft2 O --Testcase 187: EXPLAIN (VERBOSE, COSTS OFF) SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------ Hash Right Join Output: ft4.c1, (13), ft1.c1, ft2.c1 Hash Cond: (ft1.c1 = ft4.c1) @@ -2956,21 +2918,18 @@ SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT Output: ft1.c1, ft2.c1, 13 -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Filter: (ft1.c1 = 12) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" = 12)) -> Materialize Output: ft2.c1 -> Foreign Scan on public.ft2 Output: ft2.c1 - Filter: (ft2.c1 = 12) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" = 12)) -> Hash Output: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1 - Filter: ((ft4.c1 >= 10) AND (ft4.c1 <= 15)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" -(21 rows) + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 10)) AND ((c1 <= 15)) +(18 rows) --Testcase 188: SELECT ft4.c1, q.* FROM ft4 LEFT JOIN (SELECT 13, ft1.c1, ft2.c1 FROM ft1 RIGHT JOIN ft2 ON (ft1.c1 = ft2.c1) WHERE ft1.c1 = 12) q(a, b, c) ON (ft4.c1 = q.b) WHERE ft4.c1 BETWEEN 10 AND 15 ORDER BY ft4.c1; @@ -2987,8 +2946,8 @@ UPDATE ft5 SET c3 = null where c1 % 9 = 0; --Testcase 190: EXPLAIN (VERBOSE, COSTS OFF) SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Sort Output: ft5.*, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 Sort Key: ft5.c1 @@ -2997,14 +2956,13 @@ SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 10) AND (ft4.c1 <= 30)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2 FROM public."T3" WHERE ((c1 >= 10)) AND ((c1 <= 30)) -> Hash Output: ft5.*, ft5.c1, ft5.c2, ft5.c3 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1, ft5.c2, ft5.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(15 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(14 rows) --Testcase 191: SELECT ft5, ft5.c1, ft5.c2, ft5.c3, ft4.c1, ft4.c2 FROM ft5 left join ft4 on ft5.c1 = ft4.c1 WHERE ft4.c1 BETWEEN 10 and 30 ORDER BY ft5.c1, ft4.c1; @@ -3060,28 +3018,26 @@ SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = f Sort Key: ft4.c1 -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3, ft4.* - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Sort Output: ft5.c1, ft5.c2, ft5.c3, ft5.* Sort Key: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1, ft5.c2, ft5.c3, ft5.* - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2, c3 FROM public."T4" -> Sort Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8, ft1.* Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8, ft1.* - Filter: (ft1.c1 < 100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" < 100)) -> Sort Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.* Sort Key: ft2.c1 -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8, ft2.* - Filter: (ft2.c1 < 100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(48 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" < 100)) +(46 rows) --Testcase 197: SELECT * FROM ft1, ft2, ft4, ft5, local_tbl WHERE ft1.c1 = ft2.c1 AND ft1.c2 = ft4.c1 @@ -3122,8 +3078,8 @@ ALTER VIEW v5 OWNER TO regress_view_owner; --Testcase 206: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, different view owners - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Limit Output: ft4.c1, ft5.c2, ft5.c1 -> Sort @@ -3134,12 +3090,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: ft5.c2, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c2, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2 FROM public."T4" (16 rows) --Testcase 207: @@ -3163,8 +3119,8 @@ ALTER VIEW v4 OWNER TO regress_view_owner; --Testcase 209: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Limit Output: ft4.c1, ft5.c2, ft5.c1 -> Sort @@ -3175,12 +3131,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: ft5.c2, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c2, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2 FROM public."T4" (16 rows) --Testcase 210: @@ -3202,8 +3158,8 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN v5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1 --Testcase 211: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can't be pushed down, view owner not current user - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Limit Output: ft4.c1, t2.c2, t2.c1 -> Sort @@ -3214,12 +3170,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c Hash Cond: (ft4.c1 = t2.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2 FROM public."T4" (16 rows) --Testcase 212: @@ -3243,8 +3199,8 @@ ALTER VIEW v4 OWNER TO CURRENT_USER; --Testcase 214: EXPLAIN (VERBOSE, COSTS OFF) SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; -- can be pushed down - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------- Limit Output: ft4.c1, t2.c2, t2.c1 -> Sort @@ -3255,12 +3211,12 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c Hash Cond: (ft4.c1 = t2.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c2, t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c2, t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1, c2 FROM public."T4" (16 rows) --Testcase 215: @@ -3305,9 +3261,8 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 5) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(12 rows) + Remote SQL: SELECT "C_1", c2, c6 FROM public."T1" WHERE ((c2 < 5)) +(11 rows) --Testcase 220: select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2; @@ -3337,9 +3292,8 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 5) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2, c6 FROM public."T1" WHERE ((c2 < 5)) +(13 rows) --Testcase 222: select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (random() <= 1)::int as sum2 from ft1 where c2 < 5 group by c2 order by 1, 2 limit 1; @@ -3352,36 +3306,34 @@ select count(c6), sum(c1), avg(c1), min(c2), max(c1), stddev(c2), sum(c1) * (ran --Testcase 223: explain (verbose, costs off) select sum(c1 * (random() <= 1)::int) as sum, avg(c1) from ft1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Aggregate Output: sum((c1 * ((random() <= '1'::double precision))::integer)), avg(c1) -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (5 rows) -- Aggregate over join query --Testcase 224: explain (verbose, costs off) select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Aggregate Output: count(*), sum(t1.c1), avg(t2.c1) -> Nested Loop Output: t1.c1, t2.c1 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c2 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 = 6)) -> Materialize Output: t2.c1, t2.c2 -> Foreign Scan on public.ft1 t2 Output: t2.c1, t2.c2 - Filter: (t2.c2 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 = 6)) +(12 rows) --Testcase 225: select count(*), sum(t1.c1), avg(t2.c1) from ft1 t1 inner join ft1 t2 on (t1.c2 = t2.c2) where t1.c2 = 6; @@ -3404,20 +3356,20 @@ select sum(t1.c1), count(t2.c1) from ft1 t1 inner join ft2 t2 on (t1.c1 = t2.c1) Join Filter: (((((t1.c1 * t2.c1) / (t1.c1 * t2.c1)))::double precision * random()) <= '1'::double precision) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (14 rows) -- GROUP BY clause having expressions --Testcase 227: explain (verbose, costs off) select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------ Sort Output: ((c2 / 2)), ((sum(c2) * ((c2 / 2)))) Sort Key: ((ft1.c2 / 2)) @@ -3426,7 +3378,7 @@ select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; Group Key: (ft1.c2 / 2) -> Foreign Scan on public.ft1 Output: (c2 / 2), c2 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (9 rows) --Testcase 228: @@ -3444,8 +3396,8 @@ select c2/2, sum(c2) * (c2/2) from ft1 group by c2/2 order by c2/2; --Testcase 229: explain (verbose, costs off) select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, sqrt(c1) order by 1, 2) x; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Aggregate Output: count(ft1.c2), sum(ft1.c2) -> Sort @@ -3456,7 +3408,7 @@ select count(x.a), sum(x.a) from (select c2 a, sum(c1) b from ft1 group by c2, s Group Key: ft1.c2, sqrt((ft1.c1)::double precision) -> Foreign Scan on public.ft1 Output: ft1.c2, sqrt((ft1.c1)::double precision), ft1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (11 rows) --Testcase 230: @@ -3480,7 +3432,7 @@ select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) --Testcase 232: @@ -3503,8 +3455,8 @@ select c2 * (random() <= 1)::int as sum1, sum(c1) * c2 as sum2 from ft1 group by --Testcase 233: explain (verbose, costs off) select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::int order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: ((c2 * ((random() <= '1'::double precision))::integer)) Sort Key: ((ft2.c2 * ((random() <= '1'::double precision))::integer)) @@ -3513,15 +3465,15 @@ select c2 * (random() <= 1)::int as c2 from ft2 group by c2 * (random() <= 1)::i Group Key: (ft2.c2 * ((random() <= '1'::double precision))::integer) -> Foreign Scan on public.ft2 Output: (c2 * ((random() <= '1'::double precision))::integer) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (9 rows) -- GROUP BY clause in various forms, cardinal, alias and constant expression --Testcase 234: explain (verbose, costs off) select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------ Sort Output: (count(c2)), c2, 5, 7.0, 9 Sort Key: ft1.c2 @@ -3530,7 +3482,7 @@ select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2 Group Key: ft1.c2, 5, 9 -> Foreign Scan on public.ft1 Output: c2, 5, 9 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (9 rows) --Testcase 235: @@ -3554,8 +3506,8 @@ select count(c2) w, c2 x, 5 y, 7.0 z from ft1 group by 2, y, 9.0::int order by 2 --Testcase 236: explain (verbose, costs off) select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: c2, c2, (sum(c1)) Sort Key: (sum(ft1.c1)) @@ -3564,9 +3516,8 @@ select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); Group Key: ft1.c2, ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c2, c1 - Filter: (ft1.c2 > 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 > 6)) +(9 rows) --Testcase 237: select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); @@ -3581,8 +3532,8 @@ select c2, c2 from ft1 where c2 > 6 group by 1, 2 order by sum(c1); --Testcase 238: explain (verbose, costs off) select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 order by c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Sort Output: c2, (sum(c1)) Sort Key: ft2.c2 @@ -3592,7 +3543,7 @@ select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800 Filter: ((avg(ft2.c1) < '500'::numeric) AND (sum(ft2.c1) < 49800)) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (10 rows) --Testcase 239: @@ -3617,7 +3568,7 @@ select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having Filter: ((avg(ft1.c1) < '500'::numeric) AND ((((avg(ft1.c1) / avg(ft1.c1)))::double precision * random()) <= '1'::double precision)) -> Foreign Scan on public.ft1 Output: ft1.c5, sqrt((ft1.c2)::double precision), ft1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c5 FROM public."T1" (9 rows) --Testcase 241: @@ -3642,7 +3593,7 @@ select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 Filter: (avg((ft1.c1 * ((random() <= '1'::double precision))::integer)) > '100'::numeric) -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (10 rows) -- Remote aggregate in combination with a local Param (for the output @@ -3650,16 +3601,14 @@ select sum(c1) from ft1 group by c2 having avg(c1 * (random() <= 1)::int) > 100 --Testcase 243: explain (verbose, costs off) select exists(select 1 from pg_enum), sum(c1) from ft1; - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: $0, sum(ft1.c1) + QUERY PLAN +-------------------------------------------------- + Foreign Scan + Output: $0, (sum(ft1.c1)) + Remote SQL: SELECT sum("C_1") FROM public."T1" InitPlan 1 (returns $0) -> Seq Scan on pg_catalog.pg_enum - -> Foreign Scan on public.ft1 - Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) +(5 rows) --Testcase 244: select exists(select 1 from pg_enum), sum(c1) from ft1; @@ -3671,8 +3620,8 @@ select exists(select 1 from pg_enum), sum(c1) from ft1; --Testcase 245: explain (verbose, costs off) select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------- GroupAggregate Output: ($0), sum(ft1.c1) Group Key: $0 @@ -3680,7 +3629,7 @@ select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; -> Seq Scan on pg_catalog.pg_enum -> Foreign Scan on public.ft1 Output: $0, ft1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (8 rows) --Testcase 246: @@ -3695,8 +3644,8 @@ select exists(select 1 from pg_enum), sum(c1) from ft1 group by 1; --Testcase 247: explain (verbose, costs off) select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------- Sort Output: (array_agg(c1 ORDER BY c1)), c2 Sort Key: (array_agg(ft1.c1 ORDER BY ft1.c1)) @@ -3708,9 +3657,8 @@ select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Filter: (ft1.c1 < 100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(13 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 100)) +(12 rows) --Testcase 248: select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; @@ -3732,15 +3680,14 @@ select array_agg(c1 order by c1) from ft1 where c1 < 100 group by c2 order by 1; --Testcase 249: explain (verbose, costs off) select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate Output: array_agg(c5 ORDER BY c1 DESC) -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 50) AND (ft2.c2 = 6)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c5 FROM public."T1" WHERE (("C_1" < 50)) AND ((c2 = 6)) +(5 rows) --Testcase 250: select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; @@ -3753,8 +3700,8 @@ select array_agg(c5 order by c1 desc) from ft2 where c2 = 6 and c1 < 50; --Testcase 251: explain (verbose, costs off) select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1; - QUERY PLAN --------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Sort Output: (array_agg(DISTINCT (t1.c1 % 5))), ((t2.c1 % 3)) Sort Key: (array_agg(DISTINCT (t1.c1 % 5))) @@ -3770,12 +3717,12 @@ select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2 Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (21 rows) --Testcase 252: @@ -3790,8 +3737,8 @@ select array_agg(distinct (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2 --Testcase 253: explain (verbose, costs off) select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) where t1.c1 < 20 or (t1.c1 is null and t2.c1 < 5) group by (t2.c1)%3 order by 1; - QUERY PLAN --------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Sort Output: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))), ((t2.c1 % 3)) Sort Key: (array_agg(DISTINCT (t1.c1 % 5) ORDER BY (t1.c1 % 5))) @@ -3807,12 +3754,12 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5) from ft4 t1 full join ft Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (21 rows) --Testcase 254: @@ -3843,12 +3790,12 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 Filter: ((t1.c1 < 20) OR ((t1.c1 IS NULL) AND (t2.c1 < 5))) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (21 rows) --Testcase 256: @@ -3863,8 +3810,8 @@ select array_agg(distinct (t1.c1)%5 order by (t1.c1)%5 desc nulls last) from ft4 --Testcase 257: explain (verbose, costs off) select sum(c1) filter (where c1 < 100 and c2 > 5) from ft1 group by c2 order by 1 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Sort Output: (sum(c1) FILTER (WHERE ((c1 < 100) AND (c2 > 5)))), c2 Sort Key: (sum(ft1.c1) FILTER (WHERE ((ft1.c1 < 100) AND (ft1.c2 > 5)))) @@ -3873,7 +3820,7 @@ select sum(c1) filter (where c1 < 100 and c2 > 5) from ft1 group by c2 order by Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) --Testcase 258: @@ -3903,9 +3850,8 @@ select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 f Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 = 6)) +(6 rows) --Testcase 260: select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 from ft1 where c2 = 6 group by c2; @@ -3918,8 +3864,8 @@ select sum(c1%3), sum(distinct c1%3 order by c1%3) filter (where c1%3 < 2), c2 f --Testcase 261: explain (verbose, costs off) select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------ Unique Output: ((SubPlan 1)) -> Sort @@ -3929,14 +3875,12 @@ select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft Output: (SubPlan 1) -> Foreign Scan on public.ft2 t2 Output: t2.c1, t2.c2, t2.c3, t2.c4, t2.c5, t2.c6, t2.c7, t2.c8 - Filter: ((t2.c2 % 6) = 0) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (((c2 % 6) = 0)) SubPlan 1 -> Foreign Scan on public.ft1 t1 Output: count(*) FILTER (WHERE ((t2.c2 = 6) AND (t2.c1 < 10))) - Filter: (t1.c1 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(16 rows) + Remote SQL: SELECT NULL FROM public."T1" WHERE (("C_1" = 6)) +(14 rows) --Testcase 262: select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; @@ -3949,8 +3893,8 @@ select distinct (select count(*) filter (where t2.c2 = 6 and t2.c1 < 10) from ft --Testcase 263: explain (verbose, costs off) select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- Unique Output: ((SubPlan 1)) -> Sort @@ -3958,16 +3902,14 @@ select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) fro Sort Key: ((SubPlan 1)) -> Foreign Scan on public.ft2 t2 Output: (SubPlan 1) - Filter: ((t2.c2 % 6) = 0) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (((c2 % 6) = 0)) SubPlan 1 -> Aggregate Output: count(t1.c1) FILTER (WHERE ((t2.c2 = 6) AND (t2.c1 < 10))) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(16 rows) + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" = 6)) +(14 rows) --Testcase 264: select distinct (select count(t1.c1) filter (where t2.c2 = 6 and t2.c1 < 10) from ft1 t1 where t1.c1 = 6) from ft2 t2 where t2.c2 % 6 = 0 order by 1; @@ -3991,25 +3933,24 @@ select sum(c1) filter (where (c1 / c1) * random() <= 1) from ft1 group by c2 ord Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) --Testcase 266: explain (verbose, costs off) select sum(c2) filter (where c2 in (select c2 from ft1 where c2 < 5)) from ft1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Aggregate Output: sum(ft1.c2) FILTER (WHERE (hashed SubPlan 1)) -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" SubPlan 1 -> Foreign Scan on public.ft1 ft1_1 Output: ft1_1.c2 - Filter: (ft1_1.c2 < 5) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT c2 FROM public."T1" WHERE ((c2 < 5)) +(9 rows) -- Ordered-sets within aggregate --Testcase 267: @@ -4026,9 +3967,8 @@ select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10 Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c6, c1 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2, c6 FROM public."T1" WHERE ((c2 < 10)) +(10 rows) --Testcase 268: select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10::numeric) within group (order by c1) from ft1 where c2 < 10 group by c2 having percentile_cont(c2/10::numeric) within group (order by c1) < 500 order by c2; @@ -4045,8 +3985,8 @@ select c2, rank('10'::varchar) within group (order by c6), percentile_cont(c2/10 --Testcase 269: explain (verbose, costs off) select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 having c1 = 6 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- GroupAggregate Output: c1, rank(c1, c2) WITHIN GROUP (ORDER BY c1, c2), c2 Group Key: ft1.c1, ft1.c2 @@ -4055,9 +3995,8 @@ select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2 - Filter: (ft1.c1 = 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" = 6)) +(9 rows) --Testcase 270: select c1, rank(c1, c2) within group (order by c1, c2) from ft1 group by c1, c2 having c1 = 6 order by 1; @@ -4082,8 +4021,8 @@ set enable_hashagg to false; --Testcase 274: explain (verbose, costs off) select c2, least_agg(c1) from ft1 group by c2 order by c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4092,7 +4031,7 @@ select c2, least_agg(c1) from ft1 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) -- Add function and aggregate into extension @@ -4105,8 +4044,8 @@ alter extension :DB_EXTENSIONNAME add aggregate least_agg(variadic items anyarra --Testcase 277: explain (verbose, costs off) select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4115,9 +4054,8 @@ select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Filter: (ft1.c2 < 100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 100)) +(9 rows) --Testcase 278: select c2, least_agg(c1) from ft1 where c2 < 100 group by c2 order by c2; @@ -4145,8 +4083,8 @@ alter extension :DB_EXTENSIONNAME drop aggregate least_agg(variadic items anyarr --Testcase 281: explain (verbose, costs off) select c2, least_agg(c1) from ft1 group by c2 order by c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------- GroupAggregate Output: c2, least_agg(VARIADIC ARRAY[c1]) Group Key: ft1.c2 @@ -4155,7 +4093,7 @@ select c2, least_agg(c1) from ft1 group by c2 order by c2; Sort Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c2, c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (9 rows) -- Cleanup @@ -4204,16 +4142,15 @@ create operator class my_op_class for type int using btree family my_op_family a --Testcase 291: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 100)) AND ((c2 = 6)) +(6 rows) -- Update local stats on ft2 ANALYZE ft2; @@ -4236,16 +4173,15 @@ alter extension :DB_EXTENSIONNAME add operator public.>^(int, int); --Testcase 298: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 100)) AND ((c2 = 6)) +(6 rows) --Testcase 299: select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; @@ -4272,16 +4208,15 @@ alter extension :DB_EXTENSIONNAME drop operator public.>^(int, int); --Testcase 306: explain (verbose, costs off) select array_agg(c1 order by c1 using operator(public.<^)) from ft2 where c2 = 6 and c1 < 100 group by c2; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------- GroupAggregate Output: array_agg(c1 ORDER BY c1 USING <^ NULLS LAST), c2 Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((ft2.c1 < 100) AND (ft2.c2 = 6)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(7 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 100)) AND ((c2 = 6)) +(6 rows) -- Cleanup --Testcase 307: @@ -4301,8 +4236,8 @@ drop operator public.<^(int, int); --Testcase 313: explain (verbose, costs off) select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2); - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate Output: count(t1.c3) -> Nested Loop Left Join @@ -4310,12 +4245,12 @@ select count(t1.c3) from ft2 t1 left join ft2 t2 on (t1.c1 = random() * t2.c2); Join Filter: ((t1.c1)::double precision = (random() * (t2.c2)::double precision)) -> Foreign Scan on public.ft2 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c3 FROM public."T1" -> Materialize Output: t2.c2 -> Foreign Scan on public.ft2 t2 Output: t2.c2 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" (13 rows) -- Subquery in FROM clause having aggregate @@ -4336,7 +4271,7 @@ select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x w Hash Cond: (ft1.c2 = x.a) -> Foreign Scan on public.ft1 Output: ft1.c1, ft1.c2, ft1.c3, ft1.c4, ft1.c5, ft1.c6, ft1.c7, ft1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c2 FROM public."T1" -> Hash Output: x.b, x.a -> Subquery Scan on x @@ -4346,7 +4281,7 @@ select count(*), x.b from ft1, (select c2 a, sum(c1) b from ft1 group by c2) x w Group Key: ft1_1.c2 -> Foreign Scan on public.ft1 ft1_1 Output: ft1_1.c1, ft1_1.c2, ft1_1.c3, ft1_1.c4, ft1_1.c5, ft1_1.c6, ft1_1.c7, ft1_1.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" (23 rows) --Testcase 315: @@ -4383,12 +4318,12 @@ select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) gr Hash Cond: (t1.c1 = t2.c1) -> Foreign Scan on public.ft4 t1 Output: t1.c1, t1.c2, t1.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Hash Output: t2.c1 -> Foreign Scan on public.ft5 t2 Output: t2.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" + Remote SQL: SELECT c1 FROM public."T4" (18 rows) --Testcase 317: @@ -4405,8 +4340,8 @@ select avg(t1.c1), sum(t2.c1) from ft4 t1 full join ft5 t2 on (t1.c1 = t2.c1) gr --Testcase 318: explain (verbose, costs off) select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1); - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------ Aggregate Output: count(*), sum(ft4.c1), avg(ft5.c1) -> Hash Full Join @@ -4414,15 +4349,13 @@ select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 betwee Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Filter: ((ft4.c1 >= 50) AND (ft4.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" WHERE ((c1 >= 50)) AND ((c1 <= 60)) -> Hash Output: ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.c1 - Filter: ((ft5.c1 >= 50) AND (ft5.c1 <= 60)) - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(15 rows) + Remote SQL: SELECT c1 FROM public."T4" WHERE ((c1 >= 50)) AND ((c1 <= 60)) +(13 rows) --Testcase 319: select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 between 50 and 60) t1 full join (select c1 from ft5 where c1 between 50 and 60) t2 on (t1.c1 = t2.c1); @@ -4436,17 +4369,15 @@ select count(*), sum(t1.c1), avg(t2.c1) from (select c1 from ft4 where c1 betwee --Testcase 320: explain (verbose, costs off) select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------- Sort - Output: ((sum(c2) * ((random() <= '1'::double precision))::integer)) - Sort Key: ((sum(ft1.c2) * ((random() <= '1'::double precision))::integer)) - -> Aggregate - Output: (sum(c2) * ((random() <= '1'::double precision))::integer) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(8 rows) + Output: (((sum(c2)) * ((random() <= '1'::double precision))::integer)) + Sort Key: (((sum(ft1.c2)) * ((random() <= '1'::double precision))::integer)) + -> Foreign Scan + Output: ((sum(c2)) * ((random() <= '1'::double precision))::integer) + Remote SQL: SELECT sum(c2) FROM public."T1" +(6 rows) --Testcase 321: select sum(c2) * (random() <= 1)::int as sum from ft1 order by 1; @@ -4461,8 +4392,8 @@ set enable_hashagg to false; --Testcase 323: explain (verbose, costs off) select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum from ft2 t2 group by t2.c1) qry where t1.c2 * 2 = qry.sum and t1.c2 < 3 and t1."C_1" < 100 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------- Sort Output: t1.c2, qry.sum Sort Key: t1.c2 @@ -4470,8 +4401,7 @@ select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum fro Output: t1.c2, qry.sum -> Foreign Scan on "S 1"."T1" t1 Output: t1."C_1", t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: ((t1.c2 < 3) AND (t1."C_1" < 100)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 3)) AND (("C_1" < 100)) -> Subquery Scan on qry Output: qry.sum, t2.c1 Filter: ((t1.c2 * 2) = qry.sum) @@ -4483,8 +4413,8 @@ select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum fro Sort Key: t2.c1 -> Foreign Scan on public.ft2 t2 Output: t2.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(21 rows) + Remote SQL: SELECT "C_1" FROM public."T1" +(20 rows) --Testcase 324: select c2, sum from "S 1"."T1" t1, lateral (select sum(t2.c1 + t1."C_1") sum from ft2 t2 group by t2.c1) qry where t1.c2 * 2 = qry.sum and t1.c2 < 3 and t1."C_1" < 100 order by 1; @@ -4521,19 +4451,16 @@ ORDER BY ref_0."C_1"; Output: ref_0.c2, ref_0."C_1", ref_1.c3, (ref_0.c2) -> Foreign Scan on "S 1"."T1" ref_0 Output: ref_0."C_1", ref_0.c2, ref_0.c3, ref_0.c4, ref_0.c5, ref_0.c6, ref_0.c7, ref_0.c8 - Filter: (ref_0."C_1" < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" < 10)) -> Foreign Scan on public.ft1 ref_1 Output: ref_1.c3, ref_0.c2 - Filter: (ref_1.c3 = '00001'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c3 FROM public."T1" WHERE ((c3 = '00001')) -> Materialize Output: ref_3.c3 -> Foreign Scan on public.ft2 ref_3 Output: ref_3.c3 - Filter: (ref_3.c3 = '00001'::text) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(21 rows) + Remote SQL: SELECT c3 FROM public."T1" WHERE ((c3 = '00001')) +(18 rows) --Testcase 327: SELECT ref_0.c2, subq_1.* @@ -4564,8 +4491,8 @@ ORDER BY ref_0."C_1"; --Testcase 328: explain (verbose, costs off) select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2.c1) from ft1 right join ft2 on (ft1.c1 = ft2.c1)) q(a, b, c) on (ft4.c1 <= q.b); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Aggregate Output: sum(q.a), count(q.b) -> Nested Loop Left Join @@ -4574,7 +4501,7 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. Join Filter: ((ft4.c1)::numeric <= q.b) -> Foreign Scan on public.ft4 Output: ft4.c1, ft4.c2, ft4.c3 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1 FROM public."T3" -> Materialize Output: q.a, q.b -> Subquery Scan on q @@ -4586,12 +4513,12 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. Hash Cond: (ft2.c1 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" -> Hash Output: ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1" FROM public."T1" (26 rows) --Testcase 329: @@ -4606,8 +4533,8 @@ select sum(q.a), count(q.b) from ft4 left join (select 13, avg(ft1.c1), sum(ft2. --Testcase 330: explain (verbose, costs off) select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: c2, (sum(c1)) Sort Key: ft1.c2 @@ -4617,9 +4544,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls la Group Key: () -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 3)) +(10 rows) --Testcase 331: select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls last; @@ -4634,8 +4560,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by rollup(c2) order by 1 nulls la --Testcase 332: explain (verbose, costs off) select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: c2, (sum(c1)) Sort Key: ft1.c2 @@ -4645,9 +4571,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last Group Key: () -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 3)) +(10 rows) --Testcase 333: select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last; @@ -4662,8 +4587,8 @@ select c2, sum(c1) from ft1 where c2 < 3 group by cube(c2) order by 1 nulls last --Testcase 334: explain (verbose, costs off) select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Sort Output: c2, c6, (sum(c1)) Sort Key: ft1.c2, ft1.c6 @@ -4673,9 +4598,8 @@ select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) orde Hash Key: ft1.c6 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2, c6 FROM public."T1" WHERE ((c2 < 3)) +(10 rows) --Testcase 335: select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) order by 1 nulls last, 2 nulls last; @@ -4692,8 +4616,8 @@ select c2, c6, sum(c1) from ft1 where c2 < 3 group by grouping sets(c2, c6) orde --Testcase 336: explain (verbose, costs off) select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Sort Output: c2, (sum(c1)), (GROUPING(c2)) Sort Key: ft1.c2 @@ -4702,9 +4626,8 @@ select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nu Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(10 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 3)) +(9 rows) --Testcase 337: select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nulls last; @@ -4719,8 +4642,8 @@ select c2, sum(c1), grouping(c2) from ft1 where c2 < 3 group by c2 order by 1 nu --Testcase 338: explain (verbose, costs off) select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Unique Output: ((sum(c1) / 1000)), c2 -> Sort @@ -4731,9 +4654,8 @@ select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft2.c2 < 6) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(12 rows) + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE ((c2 < 6)) +(11 rows) --Testcase 339: select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; @@ -4747,8 +4669,8 @@ select distinct sum(c1)/1000 s from ft2 where c2 < 6 group by c2 order by 1; --Testcase 340: explain (verbose, costs off) select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Sort Output: c2, (sum(c2)), (count(c2) OVER (?)), ((c2 % 2)) Sort Key: ft2.c2 @@ -4762,9 +4684,8 @@ select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 gr Group Key: ft2.c2 -> Foreign Scan on public.ft2 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft2.c2 < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(15 rows) + Remote SQL: SELECT c2 FROM public."T1" WHERE ((c2 < 10)) +(14 rows) --Testcase 341: select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 group by c2 order by 1; @@ -4785,8 +4706,8 @@ select c2, sum(c2), count(c2) over (partition by c2%2) from ft2 where c2 < 10 gr --Testcase 342: explain (verbose, costs off) select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Sort Output: c2, (array_agg(c2) OVER (?)), ((c2 % 2)) Sort Key: ft1.c2 @@ -4800,9 +4721,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 wher Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(15 rows) + Remote SQL: SELECT c2 FROM public."T1" WHERE ((c2 < 10)) +(14 rows) --Testcase 343: select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 where c2 < 10 group by c2 order by 1; @@ -4823,8 +4743,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 desc) from ft1 wher --Testcase 344: explain (verbose, costs off) select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Sort Output: c2, (array_agg(c2) OVER (?)), ((c2 % 2)) Sort Key: ft1.c2 @@ -4838,9 +4758,8 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 range between curre Group Key: ft1.c2 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 10) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(15 rows) + Remote SQL: SELECT c2 FROM public."T1" WHERE ((c2 < 10)) +(14 rows) --Testcase 345: select c2, array_agg(c2) over (partition by c2%2 order by c2 range between current row and unbounded following) from ft1 where c2 < 10 group by c2 order by 1; @@ -4866,21 +4785,19 @@ select c2, array_agg(c2) over (partition by c2%2 order by c2 range between curre PREPARE st1(int, int) AS SELECT t1.c3, t2.c3 FROM ft1 t1, ft2 t2 WHERE t1.c1 = $1 AND t2.c1 = $2; --Testcase 347: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st1(1, 2); - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------- Nested Loop Output: t1.c3, t2.c3 -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT c3 FROM public."T1" WHERE (("C_1" = 1)) -> Materialize Output: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: (t2.c1 = 2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(12 rows) + Remote SQL: SELECT c3 FROM public."T1" WHERE (("C_1" = 2)) +(10 rows) --Testcase 348: EXECUTE st1(1, 1); @@ -4901,8 +4818,8 @@ EXECUTE st1(101, 101); PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c4) = '1970-01-17'::date) ORDER BY c1; --Testcase 351: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Sort Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 Sort Key: t1.c1 @@ -4912,8 +4829,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); Hash Cond: (t1.c3 = t2.c3) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 < 20) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" < 20)) -> Hash Output: t2.c3 -> HashAggregate @@ -4921,9 +4837,8 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st2(10, 20); Group Key: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: ((t2.c1 > 10) AND (date(t2.c4) = '01-17-1970'::date)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(20 rows) + Remote SQL: SELECT c3 FROM public."T1" WHERE (("C_1" > 10)) AND ((date(c4) = '1970-01-17')) +(18 rows) --Testcase 352: EXECUTE st2(10, 20); @@ -4944,8 +4859,8 @@ EXECUTE st2(101, 121); PREPARE st3(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c5) = '1970-01-17'::date) ORDER BY c1; --Testcase 355: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------- Sort Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 Sort Key: t1.c1 @@ -4955,8 +4870,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); Hash Cond: (t1.c3 = t2.c3) -> Foreign Scan on public.ft1 t1 Output: t1.c1, t1.c2, t1.c3, t1.c4, t1.c5, t1.c6, t1.c7, t1.c8 - Filter: (t1.c1 < 20) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" < 20)) -> Hash Output: t2.c3 -> HashAggregate @@ -4964,9 +4878,8 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st3(10, 20); Group Key: t2.c3 -> Foreign Scan on public.ft2 t2 Output: t2.c3 - Filter: ((t2.c1 > 10) AND (date(t2.c5) = '01-17-1970'::date)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(20 rows) + Remote SQL: SELECT c3 FROM public."T1" WHERE (("C_1" > 10)) AND ((date(c5) = '1970-01-17')) +(18 rows) --Testcase 356: EXECUTE st3(10, 20); @@ -4986,63 +4899,58 @@ EXECUTE st3(20, 30); PREPARE st4(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 = $1; --Testcase 359: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 360: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 361: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 362: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) --Testcase 363: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = 1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1)) +(3 rows) -- once we try it enough times, should switch to generic plan --Testcase 364: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 = $1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) -- value of $1 should not be sent to remote @@ -5050,62 +4958,57 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st4(1); PREPARE st5(text,int) AS SELECT * FROM ft1 t1 WHERE c8 = $1 and c1 = $2; --Testcase 366: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 367: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 368: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 369: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 370: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: ((t1.c8 = 'foo'::text) AND (t1.c1 = 1)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((c8 = 'foo')) AND (("C_1" = 1)) +(3 rows) --Testcase 371: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st5('foo', 1); - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: ((t1.c8 = $1) AND (t1.c1 = $2)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) --Testcase 372: @@ -5120,13 +5023,12 @@ EXECUTE st5('foo', 1); PREPARE st6 AS SELECT * FROM ft1 t1 WHERE t1.c1 = t1.c2; --Testcase 374: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = c2)) +(3 rows) --Testcase 375: PREPARE st7 AS INSERT INTO ft1 (c1,c2,c3) VALUES (1001,101,'foo'); @@ -5135,7 +5037,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft1 - Remote SQL: INSERT INTO "public"."T1"("C_1", "c2", "c3", "c4", "c5", "c6", "c7", "c8") VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO public."T1"("C_1", c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1001, 101, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::text (4 rows) @@ -5144,13 +5046,12 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; -- ALTER FOREIGN TABLE ft1 OPTIONS (SET table 'T 0'); --Testcase 377: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st6; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (t1.c1 = t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(4 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = c2)) +(3 rows) --Testcase 378: EXECUTE st6; @@ -5172,7 +5073,7 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft1 - Remote SQL: INSERT INTO "public"."T1"("C_1", "c2", "c3", "c4", "c5", "c6", "c7", "c8") VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO public."T1"("C_1", c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1001, 101, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft1 '::character(10), NULL::text (4 rows) @@ -5183,27 +5084,27 @@ EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st7; PREPARE st8 AS SELECT count(c3) FROM ft1 t1 WHERE t1.c1 === t1.c2; --Testcase 381: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) -- ALTER SERVER :DB_SERVERNAME OPTIONS (DROP extensions); --Testcase 382: EXPLAIN (VERBOSE, COSTS OFF) EXECUTE st8; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------- Aggregate Output: count(c3) -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.c1 === t1.c2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (6 rows) --Testcase 383: @@ -5227,14 +5128,14 @@ DEALLOCATE st8; --Testcase 384: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.tableoid = 'pg_class'::regclass LIMIT 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.tableoid = '1259'::oid) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (6 rows) --Testcase 385: @@ -5247,13 +5148,13 @@ SELECT * FROM ft1 t1 WHERE t1.tableoid = 'ft1'::regclass LIMIT 1; --Testcase 386: EXPLAIN (VERBOSE, COSTS OFF) SELECT tableoid::regclass, * FROM ft1 t1 LIMIT 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Limit Output: ((tableoid)::regclass), c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: (tableoid)::regclass, c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (5 rows) --Testcase 387: @@ -5266,12 +5167,12 @@ SELECT tableoid::regclass, * FROM ft1 t1 LIMIT 1; --Testcase 388: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE t1.ctid = '(0,2)'; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 Filter: (t1.ctid = '(0,2)'::tid) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (4 rows) -- Does not support system column ctid @@ -5284,13 +5185,13 @@ SELECT * FROM ft1 t1 WHERE t1.ctid = '(0,2)'; --Testcase 390: EXPLAIN (VERBOSE, COSTS OFF) SELECT ctid, * FROM ft1 t1 LIMIT 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Limit Output: ctid, c1, c2, c3, c4, c5, c6, c7, c8 -> Foreign Scan on public.ft1 t1 Output: ctid, c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (5 rows) --Testcase 391: @@ -5399,118 +5300,113 @@ create foreign table ft3 (f1 text collate "C", f2 text, f3 varchar(10)) -- can be sent to remote --Testcase 409: explain (verbose, costs off) select * from ft3 where f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f1 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo')) +(3 rows) --Testcase 410: explain (verbose, costs off) select * from ft3 where f1 COLLATE "C" = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f1 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo')) +(3 rows) --Testcase 411: explain (verbose, costs off) select * from ft3 where f2 = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.ft3 Output: f1, f2, f3 - Filter: (ft3.f2 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(4 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f2 = 'foo')) +(3 rows) --Testcase 412: explain (verbose, costs off) select * from ft3 where f3 = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f3)::text = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 413: explain (verbose, costs off) select * from ft3 f, ft3 l where f.f3 = l.f3 and l.f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Nested Loop Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3 Join Filter: ((f.f3)::text = (l.f3)::text) -> Foreign Scan on public.ft3 f Output: f.f1, f.f2, f.f3 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 -> Foreign Scan on public.ft3 l Output: l.f1, l.f2, l.f3 - Filter: (l.f1 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(10 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo')) +(9 rows) -- can't be sent to remote --Testcase 414: explain (verbose, costs off) select * from ft3 where f1 COLLATE "POSIX" = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f1)::text = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 415: explain (verbose, costs off) select * from ft3 where f1 = 'foo' COLLATE "C"; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: (ft3.f1 = 'foo'::text COLLATE "C") - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 416: explain (verbose, costs off) select * from ft3 where f2 COLLATE "C" = 'foo'; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: ((ft3.f2)::text = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 417: explain (verbose, costs off) select * from ft3 where f2 = 'foo' COLLATE "C"; - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------- Foreign Scan on public.ft3 Output: f1, f2, f3 Filter: (ft3.f2 = 'foo'::text COLLATE "C") - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 (4 rows) --Testcase 418: explain (verbose, costs off) select * from ft3 f, ft3 l where f.f3 = l.f3 COLLATE "POSIX" and l.f1 = 'foo'; - QUERY PLAN ------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------------ Nested Loop Output: f.f1, f.f2, f.f3, l.f1, l.f2, l.f3 Join Filter: ((f.f3)::text = (l.f3)::text) -> Foreign Scan on public.ft3 f Output: f.f1, f.f2, f.f3 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 -> Foreign Scan on public.ft3 l Output: l.f1, l.f2, l.f3 - Filter: (l.f1 = 'foo'::text) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct3" -(10 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct3 WHERE ((f1 = 'foo')) +(9 rows) -- =================================================================== -- test writable foreign table stuff @@ -5521,14 +5417,14 @@ INSERT INTO ft2 (c1,c2,c3) SELECT c1+1000,c2+100, c3 || c3 FROM ft2 LIMIT 20; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft2 - Remote SQL: INSERT INTO "public"."T1"("C_1", "c2", "c3", "c4", "c5", "c6", "c7", "c8") VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO public."T1"("C_1", c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Subquery Scan on "*SELECT*" Output: "*SELECT*"."?column?", "*SELECT*"."?column?_1", "*SELECT*"."?column?_2", NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::text -> Limit Output: ((ft2_1.c1 + 1000)), ((ft2_1.c2 + 100)), ((ft2_1.c3 || ft2_1.c3)) -> Foreign Scan on public.ft2 ft2_1 Output: (ft2_1.c1 + 1000), (ft2_1.c2 + 100), (ft2_1.c3 || ft2_1.c3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3 FROM public."T1" (9 rows) --Testcase 420: @@ -5550,30 +5446,28 @@ INSERT INTO ft2 (c1,c2,c3) VALUES (1104,204,'ddd'), (1105,205,'eee'); --Testcase 424: EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c2" = ?, "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ?, c3 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: (c2 + 300), (c3 || '_update3'::text), c1, ft2.* - Filter: ((ft2.c1 % 10) = 3) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((("C_1" % 10) = 3)) +(5 rows) --Testcase 425: UPDATE ft2 SET c2 = c2 + 300, c3 = c3 || '_update3' WHERE c1 % 10 = 3; --Testcase 426: EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c2" = ?, "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ?, c3 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: (c2 + 400), (c3 || '_update7'::text), c1, ft2.* - Filter: ((ft2.c1 % 10) = 7) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((("C_1" % 10) = 7)) +(5 rows) --Testcase 427: UPDATE ft2 SET c2 = c2 + 400, c3 = c3 || '_update7' WHERE c1 % 10 = 7; @@ -5689,23 +5583,22 @@ SELECT * FROM ft2 WHERE c1 % 10 = 7 ORDER BY c1; EXPLAIN (verbose, costs off) UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT FROM ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 9; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c2" = ?, "c3" = ?, "c7" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ?, c3 = ?, c7 = ? WHERE "C_1" = ? -> Hash Join Output: (ft2.c2 + 500), (ft2.c3 || '_update9'::text), 'ft2 '::character(10), ft2.c1, ft2.*, ft1.* Hash Cond: (ft2.c2 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c2, ft2.c3, ft2.c1, ft2.* - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" -> Hash Output: ft1.*, ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.*, ft1.c1 - Filter: ((ft1.c1 % 10) = 9) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((("C_1" % 10) = 9)) +(13 rows) --Testcase 430: UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT @@ -5713,15 +5606,14 @@ UPDATE ft2 SET c2 = ft2.c2 + 500, c3 = ft2.c3 || '_update9', c7 = DEFAULT --Testcase 431: EXPLAIN (verbose, costs off) DELETE FROM ft2 WHERE c1 % 10 = 5; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------ Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: c1 - Filter: ((ft2.c1 % 10) = 5) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1" FROM public."T1" WHERE ((("C_1" % 10) = 5)) +(5 rows) --Testcase 432: SELECT c1, c4 FROM ft2 WHERE c1 % 10 = 5; @@ -5837,23 +5729,22 @@ DELETE FROM ft2 WHERE c1 % 10 = 5; --Testcase 434: EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Hash Join Output: ft2.c1, ft1.* Hash Cond: (ft2.c2 = ft1.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" -> Hash Output: ft1.*, ft1.c1 -> Foreign Scan on public.ft1 Output: ft1.*, ft1.c1 - Filter: ((ft1.c1 % 10) = 2) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE ((("C_1" % 10) = 2)) +(13 rows) --Testcase 435: DELETE FROM ft2 USING ft1 WHERE ft1.c1 = ft2.c2 AND ft1.c1 % 10 = 2; @@ -6688,7 +6579,7 @@ INSERT INTO ft2 (c1,c2,c3) VALUES (1200,999,'foo'); QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Insert on public.ft2 - Remote SQL: INSERT INTO "public"."T1"("C_1", "c2", "c3", "c4", "c5", "c6", "c7", "c8") VALUES (?, ?, ?, ?, ?, ?, ?, ?) + Remote SQL: INSERT INTO public."T1"("C_1", c2, c3, c4, c5, c6, c7, c8) VALUES (?, ?, ?, ?, ?, ?, ?, ?) -> Result Output: 1200, 999, 'foo'::text, NULL::timestamp without time zone, NULL::timestamp without time zone, NULL::character varying, 'ft2 '::character(10), NULL::text (4 rows) @@ -6705,15 +6596,14 @@ SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; --Testcase 440: EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'bar' WHERE c1 = 1200; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------ Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c3 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: 'bar'::text, c1, ft2.* - Filter: (ft2.c1 = 1200) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" = 1200)) +(5 rows) --Testcase 441: UPDATE ft2 SET c3 = 'bar' WHERE c1 = 1200; @@ -6727,15 +6617,14 @@ SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; --Testcase 443: EXPLAIN (verbose, costs off) DELETE FROM ft2 WHERE c1 = 1200; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: c1 - Filter: (ft2.c1 = 1200) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + Remote SQL: SELECT "C_1" FROM public."T1" WHERE (("C_1" = 1200)) +(5 rows) --Testcase 444: SELECT tableoid::regclass FROM ft2 WHERE c1 = 1200; @@ -6755,17 +6644,16 @@ EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'foo' FROM ft4 INNER JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 1200 AND ft2.c2 = ft4.c1; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c3 = ? WHERE "C_1" = ? -> Hash Join Output: 'foo'::text, ft2.c1, ft2.*, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.*, ft2.c2 - Filter: (ft2.c1 > 1200) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" > 1200)) -> Hash Output: ft4.*, ft4.c1, ft5.*, ft5.c1 -> Hash Join @@ -6773,13 +6661,13 @@ UPDATE ft2 SET c3 = 'foo' Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(21 rows) --Testcase 448: UPDATE ft2 SET c3 = 'foo' @@ -6812,17 +6700,16 @@ EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft4 LEFT JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 1200 AND ft2.c1 % 10 = 0 AND ft2.c2 = ft4.c1; -- can be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Hash Join Output: ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: ((ft2.c1 > 1200) AND ((ft2.c1 % 10) = 0)) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" > 1200)) AND ((("C_1" % 10) = 0)) -> Hash Output: ft4.*, ft4.c1, ft5.* -> Hash Left Join @@ -6830,13 +6717,13 @@ DELETE FROM ft2 Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(21 rows) --Testcase 451: DELETE FROM ft2 @@ -6853,20 +6740,19 @@ UPDATE ft2 AS target SET (c2, c7) = ( FROM ft2 AS src WHERE target.c1 = src.c1 ) WHERE c1 > 1100; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------ Update on public.ft2 target - Remote SQL: UPDATE "public"."T1" SET "c2" = ?, "c7" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ?, c7 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 target Output: $1, $2, (SubPlan 1 (returns $1,$2)), target.c1, target.* - Filter: (target.c1 > 1100) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" > 1100)) SubPlan 1 (returns $1,$2) -> Foreign Scan on public.ft2 src Output: (src.c2 * 10), src.c7 Filter: (target.c1 = src.c1) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(11 rows) + Remote SQL: SELECT "C_1", c2, c7 FROM public."T1" +(10 rows) --Testcase 454: UPDATE ft2 AS target SET (c2, c7) = ( @@ -6886,23 +6772,22 @@ UPDATE ft2 AS target SET (c2) = ( EXPLAIN (VERBOSE, COSTS OFF) UPDATE ft2 d SET c2 = CASE WHEN random() >= 0 THEN d.c2 ELSE 0 END FROM ft2 AS t WHERE d.c1 = t.c1 AND d.c1 > 1000; - QUERY PLAN ----------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Update on public.ft2 d - Remote SQL: UPDATE "public"."T1" SET "c2" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c2 = ? WHERE "C_1" = ? -> Hash Join Output: CASE WHEN (random() >= '0'::double precision) THEN d.c2 ELSE 0 END, d.c1, d.*, t.* Hash Cond: (d.c1 = t.c1) -> Foreign Scan on public.ft2 d Output: d.c2, d.c1, d.* - Filter: (d.c1 > 1000) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" > 1000)) -> Hash Output: t.*, t.c1 -> Foreign Scan on public.ft2 t Output: t.*, t.c1 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(14 rows) + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" +(13 rows) --Testcase 457: UPDATE ft2 d SET c2 = CASE WHEN random() >= 0 THEN d.c2 ELSE 0 END @@ -6916,14 +6801,14 @@ INSERT INTO ft2 (c1,c2,c3) --Testcase 459: EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'bar' WHERE postgres_fdw_abs(c1) > 2000; -- can't be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c3 = ? WHERE "C_1" = ? -> Foreign Scan on public.ft2 Output: 'bar'::text, c1, ft2.* Filter: (postgres_fdw_abs(ft2.c1) > 2000) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (6 rows) --Testcase 460: @@ -6949,17 +6834,16 @@ EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 = 'baz' FROM ft4 INNER JOIN ft5 ON (ft4.c1 = ft5.c1) WHERE ft2.c1 > 2000 AND ft2.c2 === ft4.c1; -- can't be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------ Update on public.ft2 - Remote SQL: UPDATE "public"."T1" SET "c3" = ? WHERE "C_1" = ? + Remote SQL: UPDATE public."T1" SET c3 = ? WHERE "C_1" = ? -> Nested Loop Output: 'baz'::text, ft2.c1, ft2.*, ft4.*, ft5.* Join Filter: (ft2.c2 === ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.*, ft2.c2 - Filter: (ft2.c1 > 2000) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" WHERE (("C_1" > 2000)) -> Materialize Output: ft4.*, ft4.c1, ft5.* -> Hash Join @@ -6967,13 +6851,13 @@ UPDATE ft2 SET c3 = 'baz' Hash Cond: (ft4.c1 = ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Hash Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(21 rows) --Testcase 463: UPDATE ft2 SET c3 = 'baz' @@ -6992,17 +6876,16 @@ EXPLAIN (verbose, costs off) DELETE FROM ft2 USING ft4 INNER JOIN ft5 ON (ft4.c1 === ft5.c1) WHERE ft2.c1 > 2000 AND ft2.c2 = ft4.c1; -- can't be pushed down - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Delete on public.ft2 - Remote SQL: DELETE FROM "public"."T1" WHERE "C_1" = ? + Remote SQL: DELETE FROM public."T1" WHERE "C_1" = ? -> Hash Join Output: ft2.c1, ft4.*, ft5.* Hash Cond: (ft2.c2 = ft4.c1) -> Foreign Scan on public.ft2 Output: ft2.c1, ft2.c2, ft2.c3, ft2.c4, ft2.c5, ft2.c6, ft2.c7, ft2.c8 - Filter: (ft2.c1 > 2000) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2 FROM public."T1" WHERE (("C_1" > 2000)) -> Hash Output: ft4.*, ft4.c1, ft5.* -> Nested Loop @@ -7010,13 +6893,13 @@ DELETE FROM ft2 Join Filter: (ft4.c1 === ft5.c1) -> Foreign Scan on public.ft4 Output: ft4.*, ft4.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T3" + Remote SQL: SELECT c1, c2, c3 FROM public."T3" -> Materialize Output: ft5.*, ft5.c1 -> Foreign Scan on public.ft5 Output: ft5.*, ft5.c1 - Remote SQL: SELECT "c1","c2","c3" FROM "public"."T4" -(22 rows) + Remote SQL: SELECT c1, c2, c3 FROM public."T4" +(21 rows) --Testcase 466: DELETE FROM ft2 @@ -7446,8 +7329,8 @@ select c2, count(*) from "S 1"."T1" where c2 < 500 group by 1 order by 1; -- ORDER BY DESC NULLS LAST options --Testcase 495: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 OFFSET 795 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7455,7 +7338,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 O Sort Key: ft1.c6 DESC NULLS LAST, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 496: @@ -7477,8 +7360,8 @@ SELECT * FROM ft1 ORDER BY c6 DESC NULLS LAST, c1 OFFSET 795 LIMIT 10; -- ORDER BY DESC NULLS FIRST options --Testcase 497: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 OFFSET 15 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7486,7 +7369,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 Sort Key: ft1.c6 DESC, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 498: @@ -7508,8 +7391,8 @@ SELECT * FROM ft1 ORDER BY c6 DESC NULLS FIRST, c1 OFFSET 15 LIMIT 10; -- ORDER BY ASC NULLS FIRST options --Testcase 499: EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 OFFSET 15 LIMIT 10; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Limit Output: c1, c2, c3, c4, c5, c6, c7, c8 -> Sort @@ -7517,7 +7400,7 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 O Sort Key: ft1.c6 NULLS FIRST, ft1.c1 -> Foreign Scan on public.ft1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" + Remote SQL: SELECT "C_1", c2, c3, c4, c5, c6, c7, c8 FROM public."T1" (8 rows) --Testcase 500: @@ -7544,15 +7427,12 @@ SELECT * FROM ft1 ORDER BY c6 ASC NULLS FIRST, c1 OFFSET 15 LIMIT 10; ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2positive CHECK (c2 >= 0); --Testcase 502: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 < 0; - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: count(*) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 < 0) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + QUERY PLAN +----------------------------------------------------------------- + Foreign Scan + Output: (count(*)) + Remote SQL: SELECT count(*) FROM public."T1" WHERE ((c2 < 0)) +(3 rows) --Testcase 503: SELECT count(*) FROM ft1 WHERE c2 < 0; @@ -7592,15 +7472,12 @@ ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c2positive; ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c2negative CHECK (c2 < 0); --Testcase 510: EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 WHERE c2 >= 0; - QUERY PLAN ----------------------------------------------------------------------------------------- - Aggregate - Output: count(*) - -> Foreign Scan on public.ft1 - Output: c1, c2, c3, c4, c5, c6, c7, c8 - Filter: (ft1.c2 >= 0) - Remote SQL: SELECT "C_1","c2","c3","c4","c5","c6","c7","c8" FROM "public"."T1" -(6 rows) + QUERY PLAN +------------------------------------------------------------------ + Foreign Scan + Output: (count(*)) + Remote SQL: SELECT count(*) FROM public."T1" WHERE ((c2 >= 0)) +(3 rows) --Testcase 511: SELECT count(*) FROM ft1 WHERE c2 >= 0; @@ -7667,10 +7544,10 @@ Options: check_option=cascaded --Testcase 524: EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view VALUES (0, 5); - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------- Insert on public.foreign_tbl - Remote SQL: INSERT INTO "public"."base_tbl"("a", "b") VALUES (?, ?) + Remote SQL: INSERT INTO public.base_tbl(a, b) VALUES (?, ?) -> Result Output: 0, 5 (4 rows) @@ -7683,10 +7560,10 @@ DETAIL: Failing row contains (10, 5). --Testcase 525: EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO rw_view VALUES (0, 15); - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +--------------------------------------------------------------- Insert on public.foreign_tbl - Remote SQL: INSERT INTO "public"."base_tbl"("a", "b") VALUES (?, ?) + Remote SQL: INSERT INTO public.base_tbl(a, b) VALUES (?, ?) -> Result Output: 0, 15 (4 rows) @@ -7704,30 +7581,28 @@ SELECT * FROM foreign_tbl; --Testcase 528: EXPLAIN (VERBOSE, COSTS OFF) UPDATE rw_view SET b = b + 5; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------- Update on public.foreign_tbl - Remote SQL: UPDATE "public"."base_tbl" SET "a" = ?, "b" = ? WHERE "a" = ? + Remote SQL: UPDATE public.base_tbl SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.foreign_tbl Output: (foreign_tbl.b + 5), foreign_tbl.a, foreign_tbl.* - Filter: (foreign_tbl.a < foreign_tbl.b) - Remote SQL: SELECT "a","b" FROM "public"."base_tbl" -(6 rows) + Remote SQL: SELECT a, b FROM public.base_tbl WHERE ((a < b)) +(5 rows) --Testcase 529: UPDATE rw_view SET b = b + 5; -- should fail --Testcase 530: EXPLAIN (VERBOSE, COSTS OFF) UPDATE rw_view SET b = b + 15; - QUERY PLAN ------------------------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------------------------- Update on public.foreign_tbl - Remote SQL: UPDATE "public"."base_tbl" SET "a" = ?, "b" = ? WHERE "a" = ? + Remote SQL: UPDATE public.base_tbl SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.foreign_tbl Output: (foreign_tbl.b + 15), foreign_tbl.a, foreign_tbl.* - Filter: (foreign_tbl.a < foreign_tbl.b) - Remote SQL: SELECT "a","b" FROM "public"."base_tbl" -(6 rows) + Remote SQL: SELECT a, b FROM public.base_tbl WHERE ((a < b)) +(5 rows) --Testcase 531: UPDATE rw_view SET b = b + 15; -- ok @@ -7811,12 +7686,11 @@ UPDATE rw_view SET b = b + 5; ---------------------------------------------------------------------------------------------- Update on public.parent_tbl Foreign Update on public.foreign_tbl parent_tbl_1 - Remote SQL: UPDATE "public"."child_tbl" SET "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.child_tbl SET b = ? WHERE id = ? -> Foreign Scan on public.foreign_tbl parent_tbl_1 Output: (parent_tbl_1.b + 5), parent_tbl_1.tableoid, parent_tbl_1.id, parent_tbl_1.* - Filter: (parent_tbl_1.a < parent_tbl_1.b) - Remote SQL: SELECT "a","b","id" FROM "public"."child_tbl" -(7 rows) + Remote SQL: SELECT a, b, id FROM public.child_tbl WHERE ((a < b)) +(6 rows) --Testcase 545: UPDATE rw_view SET b = b + 5; -- should fail @@ -7827,12 +7701,11 @@ UPDATE rw_view SET b = b + 15; ----------------------------------------------------------------------------------------------- Update on public.parent_tbl Foreign Update on public.foreign_tbl parent_tbl_1 - Remote SQL: UPDATE "public"."child_tbl" SET "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.child_tbl SET b = ? WHERE id = ? -> Foreign Scan on public.foreign_tbl parent_tbl_1 Output: (parent_tbl_1.b + 15), parent_tbl_1.tableoid, parent_tbl_1.id, parent_tbl_1.* - Filter: (parent_tbl_1.a < parent_tbl_1.b) - Remote SQL: SELECT "a","b","id" FROM "public"."child_tbl" -(7 rows) + Remote SQL: SELECT a, b, id FROM public.child_tbl WHERE ((a < b)) +(6 rows) --Testcase 547: UPDATE rw_view SET b = b + 15; -- ok @@ -7907,10 +7780,10 @@ create foreign table grem1 ( --Testcase 562: explain (verbose, costs off) insert into grem1 (a) values (1), (2); - QUERY PLAN --------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------ Insert on public.grem1 - Remote SQL: INSERT INTO "public"."gloc1"("a", "b") VALUES (?, ?) + Remote SQL: INSERT INTO public.gloc1(a, b) VALUES (?, ?) -> Values Scan on "*VALUES*" Output: "*VALUES*".column1, NULL::integer (4 rows) @@ -7920,15 +7793,14 @@ insert into grem1 (a) values (1), (2); --Testcase 564: explain (verbose, costs off) update grem1 set a = 22 where a = 2; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------- Update on public.grem1 - Remote SQL: UPDATE "public"."gloc1" SET "a" = ?, "b" = ? WHERE "a" = ? + Remote SQL: UPDATE public.gloc1 SET a = ?, b = ? WHERE a = ? -> Foreign Scan on public.grem1 Output: 22, a, grem1.* - Filter: (grem1.a = 2) - Remote SQL: SELECT "a","b" FROM "public"."gloc1" -(6 rows) + Remote SQL: SELECT a, b FROM public.gloc1 WHERE ((a = 2)) +(5 rows) --Testcase 565: update grem1 set a = 22 where a = 2; @@ -8235,13 +8107,13 @@ SELECT f1, f2 from loc1; --Testcase 616: EXPLAIN (verbose, costs off) UPDATE rem1 set f1 = 10; -- all columns should be transmitted - QUERY PLAN ----------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f1" = ?, "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f1 = ?, f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: 10, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 617: @@ -8395,22 +8267,22 @@ DROP TRIGGER trig_local_before ON loc1; --Testcase 652: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 653: EXPLAIN (verbose, costs off) DELETE FROM rem1 WHERE false; -- currently can't be pushed down - QUERY PLAN ----------------------------------------------------------- + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Result Output: f1 One-Time Filter: false @@ -8424,25 +8296,25 @@ CREATE TRIGGER trig_stmt_before --Testcase 655: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 656: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 657: @@ -8454,25 +8326,25 @@ CREATE TRIGGER trig_stmt_after --Testcase 659: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 660: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 661: @@ -8485,25 +8357,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 663: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 664: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 665: @@ -8515,25 +8387,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 667: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 668: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 669: @@ -8546,25 +8418,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 671: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can't be pushed down - QUERY PLAN ----------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f1" = ?, "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f1 = ?, f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 672: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 673: @@ -8576,25 +8448,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 675: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 676: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1 - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1 FROM public.loc1 (5 rows) --Testcase 677: @@ -8607,25 +8479,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 679: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 680: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 681: @@ -8637,25 +8509,25 @@ FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo'); --Testcase 683: EXPLAIN (verbose, costs off) UPDATE rem1 set f2 = ''; -- can be pushed down - QUERY PLAN ------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------- Update on public.rem1 - Remote SQL: UPDATE "public"."loc1" SET "f2" = ? WHERE "f1" = ? + Remote SQL: UPDATE public.loc1 SET f2 = ? WHERE f1 = ? -> Foreign Scan on public.rem1 Output: ''::text, f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 684: EXPLAIN (verbose, costs off) DELETE FROM rem1; -- can't be pushed down - QUERY PLAN ------------------------------------------------------------ + QUERY PLAN +---------------------------------------------------- Delete on public.rem1 - Remote SQL: DELETE FROM "public"."loc1" WHERE "f1" = ? + Remote SQL: DELETE FROM public.loc1 WHERE f1 = ? -> Foreign Scan on public.rem1 Output: f1, rem1.* - Remote SQL: SELECT "f1","f2" FROM "public"."loc1" + Remote SQL: SELECT f1, f2 FROM public.loc1 (5 rows) --Testcase 685: @@ -8882,7 +8754,7 @@ select * from bar where f1 in (select f1 from foo) for update; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -8890,7 +8762,7 @@ select * from bar where f1 in (select f1 from foo) for update; Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 (19 rows) --Testcase 732: @@ -8918,7 +8790,7 @@ select * from bar where f1 in (select f1 from foo) for share; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -8926,7 +8798,7 @@ select * from bar where f1 in (select f1 from foo) for share; Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 (19 rows) --Testcase 734: @@ -8961,16 +8833,16 @@ select * from bar where f1 in (select f1 from foo2) for share; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 -> Hash Output: foo2.*, foo2.f1, foo2.tableoid -> Append -> Foreign Scan on public.foo2 foo2_1 Output: foo2_1.*, foo2_1.f1, foo2_1.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 -> Foreign Scan on public.foo2child foo2_2 Output: foo2_2.*, foo2_2.f1, foo2_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct4" + Remote SQL: SELECT f1, f2, f3 FROM public.loct4 (20 rows) --Testcase 737: @@ -9004,7 +8876,7 @@ select * from bar where f1 in (select f1 from foo2) for share; Output: bar_1.f1, bar_1.f2, bar_1.ctid, bar_1.*, bar_1.tableoid -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f1, bar_2.f2, bar_2.ctid, bar_2.*, bar_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 -> Hash Output: foo2.*, foo2.f1, foo2.ctid, foo2.tableoid -> HashAggregate @@ -9013,7 +8885,7 @@ select * from bar where f1 in (select f1 from foo2) for share; -> Append -> Foreign Scan on public.foo2 foo2_1 Output: foo2_1.*, foo2_1.f1, foo2_1.ctid, foo2_1.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 -> Seq Scan on public.foo2child foo2_2 Output: foo2_2.*, foo2_2.f1, foo2_2.ctid, foo2_2.tableoid (23 rows) @@ -9037,7 +8909,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Update on public.bar Update on public.bar bar_1 Foreign Update on public.bar2 bar_2 - Remote SQL: UPDATE "public"."loct2" SET "f2" = ? WHERE "f3" = ? + Remote SQL: UPDATE public.loct2 SET f2 = ? WHERE f3 = ? -> Hash Semi Join Output: (bar.f2 + 100), foo.ctid, bar.tableoid, bar.ctid, (NULL::integer), (NULL::record), foo.*, foo.tableoid Hash Cond: (bar.f1 = foo.f1) @@ -9046,7 +8918,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Output: bar_1.f2, bar_1.f1, bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f2, bar_2.f1, bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 -> Hash Output: foo.ctid, foo.f1, foo.*, foo.tableoid -> Append @@ -9054,7 +8926,7 @@ update bar set f2 = f2 + 100 where f1 in (select f1 from foo); Output: foo_1.ctid, foo_1.f1, foo_1.*, foo_1.tableoid -> Foreign Scan on public.foo2 foo_2 Output: foo_2.ctid, foo_2.f1, foo_2.*, foo_2.tableoid - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2, f3 FROM public.loct1 (21 rows) --Testcase 744: @@ -9083,7 +8955,7 @@ where bar.f1 = ss.f1; Update on public.bar Update on public.bar bar_1 Foreign Update on public.bar2 bar_2 - Remote SQL: UPDATE "public"."loct2" SET "f2" = ? WHERE "f3" = ? + Remote SQL: UPDATE public.loct2 SET f2 = ? WHERE f3 = ? -> Hash Join Output: (bar.f2 + 100), (ROW(foo.f1)), bar.tableoid, bar.ctid, (NULL::integer), (NULL::record) Hash Cond: (foo.f1 = bar.f1) @@ -9092,12 +8964,12 @@ where bar.f1 = ss.f1; Output: ROW(foo.f1), foo.f1 -> Foreign Scan on public.foo2 foo_1 Output: ROW(foo_1.f1), foo_1.f1 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 -> Seq Scan on public.foo foo_2 Output: ROW((foo_2.f1 + 3)), (foo_2.f1 + 3) -> Foreign Scan on public.foo2 foo_3 Output: ROW((foo_3.f1 + 3)), (foo_3.f1 + 3) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 -> Hash Output: bar.f2, bar.f1, bar.tableoid, bar.ctid, (NULL::integer), (NULL::record) -> Append @@ -9105,7 +8977,7 @@ where bar.f1 = ss.f1; Output: bar_1.f2, bar_1.f1, bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f2, bar_2.f1, bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 (26 rows) --Testcase 747: @@ -9150,8 +9022,8 @@ analyze foo; --Testcase 755: explain (verbose, costs off) select foo.f1, foo2.f1 from foo join foo2 on (foo.f1 = foo2.f1) order by foo.f2 offset 10 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: foo.f1, foo2.f1, foo.f2 -> Sort @@ -9169,13 +9041,13 @@ explain (verbose, costs off) Sort Key: foo_2.f1 -> Foreign Scan on public.foo2 foo_2 Output: foo_2.f1, foo_2.f2 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2 FROM public.loct1 -> Sort Output: foo2.f1 Sort Key: foo2.f1 -> Foreign Scan on public.foo2 Output: foo2.f1 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 (24 rows) --Testcase 756: @@ -9199,8 +9071,8 @@ select foo.f1, foo2.f1 from foo join foo2 on (foo.f1 = foo2.f1) order by foo.f2 --Testcase 757: explain (verbose, costs off) select foo.f1, foo2.f1 from foo left join foo2 on (foo.f1 = foo2.f1) order by foo.f2 offset 10 limit 10; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------- Limit Output: foo.f1, foo2.f1, foo.f2 -> Sort @@ -9218,13 +9090,13 @@ explain (verbose, costs off) Sort Key: foo_2.f1 -> Foreign Scan on public.foo2 foo_2 Output: foo_2.f1, foo_2.f2 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1, f2 FROM public.loct1 -> Sort Output: foo2.f1 Sort Key: foo2.f1 -> Foreign Scan on public.foo2 Output: foo2.f1 - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" + Remote SQL: SELECT f1 FROM public.loct1 (24 rows) --Testcase 758: @@ -9256,21 +9128,20 @@ RESET enable_nestloop; --Testcase 761: explain (verbose, costs off) delete from foo where f1 < 5; - QUERY PLAN ------------------------------------------------------------------------ + QUERY PLAN +------------------------------------------------------------------------ Delete on public.foo Delete on public.foo foo_1 Foreign Delete on public.foo2 foo_2 - Remote SQL: DELETE FROM "public"."loct1" WHERE "f3" = ? + Remote SQL: DELETE FROM public.loct1 WHERE f3 = ? -> Append -> Index Scan using i_foo_f1 on public.foo foo_1 Output: foo_1.tableoid, foo_1.ctid, NULL::integer Index Cond: (foo_1.f1 < 5) -> Foreign Scan on public.foo2 foo_2 Output: foo_2.tableoid, NULL::tid, foo_2.f3 - Filter: (foo_2.f1 < 5) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct1" -(12 rows) + Remote SQL: SELECT f3 FROM public.loct1 WHERE ((f1 < 5)) +(11 rows) --Testcase 762: delete from foo where f1 < 5; @@ -9282,7 +9153,7 @@ update bar set f2 = f2 + 100; Update on public.bar Update on public.bar bar_1 Foreign Update on public.bar2 bar_2 - Remote SQL: UPDATE "public"."loct2" SET "f2" = ? WHERE "f3" = ? + Remote SQL: UPDATE public.loct2 SET f2 = ? WHERE f3 = ? -> Result Output: (bar.f2 + 100), bar.tableoid, bar.ctid, (NULL::integer), (NULL::record) -> Append @@ -9290,7 +9161,7 @@ update bar set f2 = f2 + 100; Output: bar_1.f2, bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f2, bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 (12 rows) --Testcase 764: @@ -9312,7 +9183,7 @@ update bar set f2 = f2 + 100; Update on public.bar Update on public.bar bar_1 Foreign Update on public.bar2 bar_2 - Remote SQL: UPDATE "public"."loct2" SET "f1" = ?, "f2" = ?, "f3" = ? WHERE "f3" = ? + Remote SQL: UPDATE public.loct2 SET f1 = ?, f2 = ?, f3 = ? WHERE f3 = ? -> Result Output: (bar.f2 + 100), bar.tableoid, bar.ctid, (NULL::integer), (NULL::record) -> Append @@ -9320,7 +9191,7 @@ update bar set f2 = f2 + 100; Output: bar_1.f2, bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.bar2 bar_2 Output: bar_2.f2, bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 (12 rows) --Testcase 768: @@ -9340,21 +9211,20 @@ psql:sql/14.0/ported_postgres_fdw.sql:2740: NOTICE: OLD: (7,277,77),NEW: (7,377 --Testcase 769: explain (verbose, costs off) delete from bar where f2 < 400; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Delete on public.bar Delete on public.bar bar_1 Foreign Delete on public.bar2 bar_2 - Remote SQL: DELETE FROM "public"."loct2" WHERE "f3" = ? + Remote SQL: DELETE FROM public.loct2 WHERE f3 = ? -> Append -> Seq Scan on public.bar bar_1 Output: bar_1.tableoid, bar_1.ctid, NULL::integer, NULL::record Filter: (bar_1.f2 < 400) -> Foreign Scan on public.bar2 bar_2 Output: bar_2.tableoid, NULL::tid, bar_2.f3, bar_2.* - Filter: (bar_2.f2 < 400) - Remote SQL: SELECT "f1","f2","f3" FROM "public"."loct2" -(12 rows) + Remote SQL: SELECT f1, f2, f3 FROM public.loct2 WHERE ((f2 < 400)) +(11 rows) --Testcase 770: delete from bar where f2 < 400; @@ -9406,7 +9276,7 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; Update on public.parent Update on public.parent parent_1 Foreign Update on public.remt1 parent_2 - Remote SQL: UPDATE "public"."loct1_2" SET "b" = ? WHERE "a" = ? + Remote SQL: UPDATE public.loct1_2 SET b = ? WHERE a = ? -> Nested Loop Output: (parent.b || remt2.b), remt2.*, parent.tableoid, parent.ctid, (NULL::integer), (NULL::record) Join Filter: (parent.a = remt2.a) @@ -9415,12 +9285,12 @@ update parent set b = parent.b || remt2.b from remt2 where parent.a = remt2.a; Output: parent_1.b, parent_1.a, parent_1.tableoid, parent_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.remt1 parent_2 Output: parent_2.b, parent_2.a, parent_2.tableoid, NULL::tid, parent_2.a, parent_2.* - Remote SQL: SELECT "a","b" FROM "public"."loct1_2" + Remote SQL: SELECT a, b FROM public.loct1_2 -> Materialize Output: remt2.b, remt2.*, remt2.a -> Foreign Scan on public.remt2 Output: remt2.b, remt2.*, remt2.a - Remote SQL: SELECT "a","b" FROM "public"."loct2_2" + Remote SQL: SELECT a, b FROM public.loct2_2 (18 rows) --Testcase 784: @@ -9433,7 +9303,7 @@ delete from parent using remt2 where parent.a = remt2.a; Delete on public.parent Delete on public.parent parent_1 Foreign Delete on public.remt1 parent_2 - Remote SQL: DELETE FROM "public"."loct1_2" WHERE "a" = ? + Remote SQL: DELETE FROM public.loct1_2 WHERE a = ? -> Nested Loop Output: remt2.*, parent.tableoid, parent.ctid, (NULL::integer) Join Filter: (parent.a = remt2.a) @@ -9442,12 +9312,12 @@ delete from parent using remt2 where parent.a = remt2.a; Output: parent_1.a, parent_1.tableoid, parent_1.ctid, NULL::integer -> Foreign Scan on public.remt1 parent_2 Output: parent_2.a, parent_2.tableoid, NULL::tid, parent_2.a - Remote SQL: SELECT "a","b" FROM "public"."loct1_2" + Remote SQL: SELECT a FROM public.loct1_2 -> Materialize Output: remt2.*, remt2.a -> Foreign Scan on public.remt2 Output: remt2.*, remt2.a - Remote SQL: SELECT "a","b" FROM "public"."loct2_2" + Remote SQL: SELECT a, b FROM public.loct2_2 (18 rows) --Testcase 786: @@ -9658,21 +9528,20 @@ insert into utrtest values (2, 'qux'); --Testcase 844: explain (verbose, costs off) update utrtest set a = 1 where a = 1 or a = 2; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Append -> Foreign Scan on public.remp utrtest_1 Output: 1, utrtest_1.tableoid, utrtest_1.id, utrtest_1.*, NULL::tid - Filter: ((utrtest_1.a = 1) OR (utrtest_1.a = 2)) - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT a, b, id FROM public.loct_2 WHERE (((a = 1) OR (a = 2))) -> Seq Scan on public.locp utrtest_2 Output: 1, utrtest_2.tableoid, NULL::integer, NULL::record, utrtest_2.ctid Filter: ((utrtest_2.a = 1) OR (utrtest_2.a = 2)) -(12 rows) +(11 rows) -- The new values are concatenated with ' triggered !' --Testcase 845: @@ -9719,12 +9588,12 @@ update utrtest set a = 1; ------------------------------------------------------------------------------------------ Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Append -> Foreign Scan on public.remp utrtest_1 Output: 1, utrtest_1.tableoid, utrtest_1.id, utrtest_1.*, NULL::tid - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT a, b, id FROM public.loct_2 -> Seq Scan on public.locp utrtest_2 Output: 1, utrtest_2.tableoid, NULL::integer, NULL::record, utrtest_2.ctid (10 rows) @@ -9747,7 +9616,7 @@ update utrtest set a = 1 from (values (1), (2)) s(x) where a = s.x; ---------------------------------------------------------------------------------------------------------- Update on public.utrtest Foreign Update on public.remp utrtest_1 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? Update on public.locp utrtest_2 -> Hash Join Output: 1, "*VALUES*".*, utrtest.tableoid, utrtest.id, utrtest.*, (NULL::tid) @@ -9755,7 +9624,7 @@ update utrtest set a = 1 from (values (1), (2)) s(x) where a = s.x; -> Append -> Foreign Scan on public.remp utrtest_1 Output: utrtest_1.a, utrtest_1.tableoid, utrtest_1.id, utrtest_1.*, NULL::tid - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT a, b, id FROM public.loct_2 -> Seq Scan on public.locp utrtest_2 Output: utrtest_2.a, utrtest_2.tableoid, NULL::integer, NULL::record, utrtest_2.ctid -> Hash @@ -9798,13 +9667,13 @@ update utrtest set a = 3; Update on public.utrtest Update on public.locp utrtest_1 Foreign Update on public.remp utrtest_2 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? -> Append -> Seq Scan on public.locp utrtest_1 Output: 3, utrtest_1.tableoid, utrtest_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.remp utrtest_2 Output: 3, utrtest_2.tableoid, NULL::tid, utrtest_2.id, utrtest_2.* - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT a, b, id FROM public.loct_2 (10 rows) --Testcase 871: @@ -9819,7 +9688,7 @@ update utrtest set a = 3 from (values (2), (3)) s(x) where a = s.x; Update on public.utrtest Update on public.locp utrtest_1 Foreign Update on public.remp utrtest_2 - Remote SQL: UPDATE "public"."loct_2" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.loct_2 SET a = ? WHERE id = ? -> Hash Join Output: 3, "*VALUES*".*, utrtest.tableoid, utrtest.ctid, (NULL::integer), (NULL::record) Hash Cond: (utrtest.a = "*VALUES*".column1) @@ -9828,7 +9697,7 @@ update utrtest set a = 3 from (values (2), (3)) s(x) where a = s.x; Output: utrtest_1.a, utrtest_1.tableoid, utrtest_1.ctid, NULL::integer, NULL::record -> Foreign Scan on public.remp utrtest_2 Output: utrtest_2.a, utrtest_2.tableoid, NULL::tid, utrtest_2.id, utrtest_2.* - Remote SQL: SELECT "a","b","id" FROM "public"."loct_2" + Remote SQL: SELECT a, b, id FROM public.loct_2 -> Hash Output: "*VALUES*".*, "*VALUES*".column1 -> Values Scan on "*VALUES*" diff --git a/expected/14.0/postgresql/select.out b/expected/14.0/postgresql/select.out index 19f9016..e1900e2 100644 --- a/expected/14.0/postgresql/select.out +++ b/expected/14.0/postgresql/select.out @@ -60,17 +60,16 @@ EXPLAIN VERBOSE SELECT * FROM onek WHERE onek.unique1 < 10 ORDER BY onek.unique1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 Sort Key: onek.unique1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 - Filter: (onek.unique1 < 10) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek WHERE ((unique1 < 10)) +(7 rows) --Testcase 8: SELECT * FROM onek @@ -98,17 +97,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using >; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek.unique1 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM public.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 10: SELECT onek.unique1, onek.stringu1 FROM onek @@ -146,17 +144,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 > 980 ORDER BY stringu1 using <; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek.stringu1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM public.onek WHERE ((unique1 > 980)) +(7 rows) SELECT onek.unique1, onek.stringu1 FROM onek WHERE onek.unique1 > 980 @@ -193,17 +190,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 > 980 ORDER BY string4 using <, unique1 using >; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.string4, onek.unique1 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, string4 FROM public.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 13: SELECT onek.unique1, onek.string4 FROM onek @@ -241,17 +237,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 > 980 ORDER BY string4 using >, unique1 using <; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.string4 DESC, onek.unique1 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, string4 FROM public.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 15: SELECT onek.unique1, onek.string4 FROM onek @@ -289,17 +284,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using >, string4 using <; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.unique1 DESC, onek.string4 -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, string4 FROM public.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 17: SELECT onek.unique1, onek.string4 FROM onek @@ -338,17 +332,16 @@ EXPLAIN VERBOSE SELECT onek.unique1, onek.string4 FROM onek WHERE onek.unique1 < 20 ORDER BY unique1 using <, string4 using >; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Sort (cost=1074.83..1077.33 rows=1000 width=68) Output: unique1, string4 Sort Key: onek.unique1, onek.string4 DESC -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, string4 - Filter: (onek.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, string4 FROM public.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 19: SELECT onek.unique1, onek.string4 FROM onek @@ -398,17 +391,16 @@ SET enable_sort TO off; --Testcase 23: EXPLAIN VERBOSE SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY onek2.unique1; -- add ORDER BY to stablize test result - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 Sort Key: onek2.unique1 -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=244) Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 - Filter: (onek2.unique1 < 10) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek WHERE ((unique1 < 10)) +(7 rows) --Testcase 24: SELECT onek2.* FROM onek2 WHERE onek2.unique1 < 10 ORDER BY onek2.unique1; -- add ORDER BY to stablize test result @@ -434,17 +426,16 @@ EXPLAIN VERBOSE SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 < 20 ORDER BY unique1 using >; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek2.unique1 DESC -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek2.unique1 < 20) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM public.onek WHERE ((unique1 < 20)) +(7 rows) --Testcase 26: SELECT onek2.unique1, onek2.stringu1 FROM onek2 @@ -481,17 +472,16 @@ SELECT onek2.unique1, onek2.stringu1 FROM onek2 EXPLAIN VERBOSE SELECT onek2.unique1, onek2.stringu1 FROM onek2 WHERE onek2.unique1 > 980 ORDER BY onek2.unique1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------- Sort (cost=10000001074.83..10000001077.33 rows=1000 width=68) Output: unique1, stringu1 Sort Key: onek2.unique1 -> Foreign Scan on public.onek2 (cost=25.00..1025.00 rows=1000 width=68) Output: unique1, stringu1 - Filter: (onek2.unique1 > 980) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" -(8 rows) + Remote SQL: SELECT unique1, stringu1 FROM public.onek WHERE ((unique1 > 980)) +(7 rows) --Testcase 28: SELECT onek2.unique1, onek2.stringu1 FROM onek2 @@ -530,12 +520,12 @@ EXPLAIN VERBOSE SELECT two, stringu1, ten, string4 INTO TABLE tmp FROM onek; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------ Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=136) Output: two, stringu1, ten, string4 Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" + Remote SQL: SELECT two, ten, stringu1, string4 FROM public.onek (4 rows) --Testcase 33: @@ -557,7 +547,7 @@ select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j) -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4 Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek -> Hash (cost=0.03..0.03 rows=2 width=36) Output: "*VALUES*".column1, "*VALUES*".column2 -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=36) @@ -588,7 +578,7 @@ select * from onek, Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4, $1 Filter: (onek.unique1 = $3) Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek InitPlan 2 (returns $1) -> Limit (cost=0.12..0.12 rows=1 width=4) Output: "*VALUES*".column1 @@ -641,7 +631,7 @@ select * from onek -> Foreign Scan on public.onek (cost=25.00..1025.00 rows=1000 width=244) Output: onek.unique1, onek.unique2, onek.two, onek.four, onek.ten, onek.twenty, onek.hundred, onek.thousand, onek.twothousand, onek.fivethous, onek.tenthous, onek.odd, onek.even, onek.stringu1, onek.stringu2, onek.string4 Foreign Table Size: 1000 b - Remote SQL: SELECT "unique1","unique2","two","four","ten","twenty","hundred","thousand","twothousand","fivethous","tenthous","odd","even","stringu1","stringu2","string4" FROM "public"."onek" + Remote SQL: SELECT unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4 FROM public.onek -> Hash (cost=0.05..0.05 rows=4 width=8) Output: "*VALUES*".column1, "*VALUES*".column2 -> Values Scan on "*VALUES*" (cost=0.00..0.05 rows=4 width=8) @@ -684,7 +674,7 @@ SELECT q1, q2 FROM int8_tbl; -> Foreign Scan on public.int8_tbl (cost=25.00..30.00 rows=5 width=16) Output: int8_tbl.q1, int8_tbl.q2 Foreign Table Size: 5 b - Remote SQL: SELECT "q1","q2" FROM "public"."int8_tbl" + Remote SQL: SELECT q1, q2 FROM public.int8_tbl (16 rows) --Testcase 41: @@ -722,7 +712,7 @@ SELECT * FROM foo ORDER BY f1; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 44: @@ -749,7 +739,7 @@ SELECT * FROM foo ORDER BY f1 ASC; -- same thing -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 46: @@ -776,7 +766,7 @@ SELECT * FROM foo ORDER BY f1 NULLS FIRST; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 48: @@ -803,7 +793,7 @@ SELECT * FROM foo ORDER BY f1 DESC; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 50: @@ -830,7 +820,7 @@ SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; -> Foreign Scan on public.foo (cost=25.00..32.00 rows=7 width=8) Output: id, f1 Foreign Table Size: 7 b - Remote SQL: SELECT "id","f1" FROM "public"."foo" + Remote SQL: SELECT id, f1 FROM public.foo (7 rows) --Testcase 52: @@ -853,10 +843,10 @@ SELECT * FROM foo ORDER BY f1 DESC NULLS LAST; --Testcase 53: explain (costs off) select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +--------------------------------------- Foreign Scan on onek2 - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) + Filter: (stringu1 = 'ATAAAA'::name) (2 rows) --Testcase 54: @@ -870,20 +860,19 @@ select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; --Testcase 55: explain (costs off, analyze on, timing off, summary off) select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +----------------------------------------------- Foreign Scan on onek2 (actual rows=1 loops=1) - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) - Rows Removed by Filter: 999 -(3 rows) + Filter: (stringu1 = 'ATAAAA'::name) +(2 rows) --Testcase 56: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +--------------------------------------- Foreign Scan on onek2 - Filter: ((unique2 = 11) AND (stringu1 = 'ATAAAA'::name)) + Filter: (stringu1 = 'ATAAAA'::name) (2 rows) --Testcase 57: @@ -897,10 +886,10 @@ select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA'; --Testcase 58: explain (costs off) select * from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 59: @@ -913,10 +902,10 @@ select * from onek2 where unique2 = 11 and stringu1 < 'B'; --Testcase 60: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 61: @@ -930,11 +919,11 @@ select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; --Testcase 62: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; - QUERY PLAN -------------------------------------------------------------- + QUERY PLAN +---------------------------------------- LockRows -> Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (3 rows) --Testcase 63: @@ -948,10 +937,10 @@ select unique2 from onek2 where unique2 = 11 and stringu1 < 'B' for update; --Testcase 64: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'C'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'C'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'C'::name) (2 rows) --Testcase 65: @@ -967,10 +956,10 @@ SET enable_indexscan TO off; --Testcase 67: explain (costs off) select unique2 from onek2 where unique2 = 11 and stringu1 < 'B'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND (unique2 = 11)) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 68: @@ -987,10 +976,10 @@ RESET enable_indexscan; explain (costs off) select unique1, unique2 from onek2 where (unique2 = 11 or unique1 = 0) and stringu1 < 'B'; - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +---------------------------------- Foreign Scan on onek2 - Filter: ((stringu1 < 'B'::name) AND ((unique2 = 11) OR (unique1 = 0))) + Filter: (stringu1 < 'B'::name) (2 rows) --Testcase 71: diff --git a/expected/14.0/postgresql/timestamp.out b/expected/14.0/postgresql/timestamp.out index 3209441..3bc91c1 100644 --- a/expected/14.0/postgresql/timestamp.out +++ b/expected/14.0/postgresql/timestamp.out @@ -1301,7 +1301,6 @@ SELECT date_part('epoch', d1) FROM TIMESTAMP_TMP; psql:sql/14.0/timestamp.sql:487: ERROR: date/time field value out of range: "0000-00-00 00:00:00" --Testcase 145: DELETE FROM TIMESTAMP_TMP; -psql:sql/14.0/timestamp.sql:490: ERROR: date/time field value out of range: "0000-00-00 00:00:00" --Testcase 146: INSERT INTO TIMESTAMP_TMP(d1) VALUES ('294270-01-01 00:00:00'::timestamp); --Testcase 147: @@ -1310,12 +1309,15 @@ psql:sql/14.0/timestamp.sql:494: ERROR: date/time field value out of range: "00 -- another internal overflow test case --Testcase 148: DELETE FROM TIMESTAMP_TMP; -psql:sql/14.0/timestamp.sql:498: ERROR: date/time field value out of range: "0000-00-00 00:00:00" --Testcase 149: INSERT INTO TIMESTAMP_TMP(d1) VALUES ('5000-01-01 00:00:00'::timestamp); --Testcase 150: SELECT extract(epoch from d1) FROM TIMESTAMP_TMP; -psql:sql/14.0/timestamp.sql:502: ERROR: date/time field value out of range: "0000-00-00 00:00:00" + extract +-------------------- + 95617584000.000000 +(1 row) + -- TO_CHAR() --Testcase 151: SELECT to_char(d1, 'DAY Day day DY Dy dy MONTH Month month RM MON Mon mon') diff --git a/expected/14.0/postgresql/update.out b/expected/14.0/postgresql/update.out index 3cb2519..f4ce392 100644 --- a/expected/14.0/postgresql/update.out +++ b/expected/14.0/postgresql/update.out @@ -29,10 +29,10 @@ CREATE FOREIGN TABLE upsert_test ( --Testcase 6: EXPLAIN VERBOSE INSERT INTO update_test VALUES (5, 10, 'foo'); - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Insert on public.update_test (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."update_test"("a", "b", "c", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 5, 10, 'foo'::text, nextval('update_test_id_seq'::regclass) (4 rows) @@ -42,10 +42,10 @@ INSERT INTO update_test VALUES (5, 10, 'foo'); --Testcase 8: EXPLAIN VERBOSE INSERT INTO update_test(b, a) VALUES (15, 10); - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Insert on public.update_test (cost=0.00..0.01 rows=0 width=0) - Remote SQL: INSERT INTO "public"."update_test"("a", "b", "c", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Result (cost=0.00..0.01 rows=1 width=44) Output: 10, 15, NULL::text, nextval('update_test_id_seq'::regclass) (4 rows) @@ -60,7 +60,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 11: @@ -74,14 +74,14 @@ SELECT * FROM update_test; --Testcase 12: EXPLAIN VERBOSE UPDATE update_test SET a = DEFAULT, b = DEFAULT; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..27.00 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=80) Output: 10, NULL::integer, id, update_test.* Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (6 rows) --Testcase 13: @@ -94,7 +94,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 15: @@ -112,13 +112,12 @@ UPDATE update_test AS t SET b = 10 WHERE t.a = 10; QUERY PLAN --------------------------------------------------------------------------------- Update on public.update_test t (cost=25.00..27.00 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET b = ? WHERE id = ? -> Foreign Scan on public.update_test t (cost=25.00..27.00 rows=2 width=76) Output: 10, id, t.* - Filter: (t.a = 10) Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((a = 10)) +(6 rows) --Testcase 17: UPDATE update_test AS t SET b = 10 WHERE t.a = 10; @@ -130,7 +129,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 19: @@ -147,13 +146,12 @@ UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; QUERY PLAN --------------------------------------------------------------------------------- Update on public.update_test t (cost=25.00..27.00 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET b = ? WHERE id = ? -> Foreign Scan on public.update_test t (cost=25.00..27.00 rows=2 width=76) Output: (b + 10), id, t.* - Filter: (t.a = 10) Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((a = 10)) +(6 rows) --Testcase 21: UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10; @@ -165,7 +163,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 23: @@ -183,16 +181,15 @@ SELECT * FROM update_test; EXPLAIN VERBOSE UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) WHERE update_test.b = v.j; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..27.00 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=76) Output: 100, update_test.id, update_test.* - Filter: (update_test.b = 20) Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((b = 20)) +(6 rows) --Testcase 25: UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j) @@ -205,7 +202,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..27.00 rows=2 width=44) Output: a, b, c, id Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 27: @@ -241,11 +238,11 @@ INSERT INTO update_test(a, b, c) SELECT a,b+1,c FROM update_test; QUERY PLAN ------------------------------------------------------------------------------------------------------------------ Insert on public.update_test (cost=25.00..27.02 rows=0 width=0) - Remote SQL: INSERT INTO "public"."update_test"("a", "b", "c", "id") VALUES (?, ?, ?, ?) + Remote SQL: INSERT INTO public.update_test(a, b, c, id) VALUES (?, ?, ?, ?) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..27.02 rows=2 width=44) Output: update_test_1.a, (update_test_1.b + 1), update_test_1.c, nextval('update_test_id_seq'::regclass) Foreign Table Size: 2 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c FROM public.update_test (6 rows) --Testcase 31: @@ -258,7 +255,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 33: @@ -274,16 +271,15 @@ SELECT * FROM update_test; --Testcase 34: EXPLAIN VERBOSE UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Update on public.update_test (cost=25.00..29.01 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ?, "c" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ?, c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=112) Output: 10, (b + 11), 'bugle'::text, id, update_test.* - Filter: (update_test.c = 'foo'::text) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((c = 'foo')) +(6 rows) --Testcase 35: UPDATE update_test SET (c,b,a) = ('bugle', b+11, DEFAULT) WHERE c = 'foo'; @@ -298,7 +294,7 @@ SELECT * FROM update_test ORDER BY b; -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (7 rows) --Testcase 37: @@ -314,16 +310,15 @@ SELECT * FROM update_test ORDER BY b; --Testcase 38: EXPLAIN VERBOSE UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.02 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ?, "c" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ?, c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.02 rows=4 width=112) Output: (a + 1), (a + b), 'car'::text, id, update_test.* - Filter: (update_test.a = 10) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((a = 10)) +(6 rows) --Testcase 39: UPDATE update_test SET (c,b) = ('car', a+b), a = a + 1 WHERE a = 10; @@ -338,7 +333,7 @@ SELECT * FROM update_test ORDER BY b; -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (7 rows) --Testcase 41: @@ -365,22 +360,20 @@ EXPLAIN VERBOSE UPDATE update_test SET (b,a) = (select a,b from update_test where b = 41 and c = 'car') WHERE a = 100 AND b = 20; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.00..58.00 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.00 rows=4 width=8) Output: update_test_1.a, update_test_1.b - Filter: ((update_test_1.b = 41) AND (update_test_1.c = 'car'::text)) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b FROM public.update_test WHERE ((b = 41)) AND ((c = 'car')) -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=112) Output: $1, $0, NULL::record, update_test.id, update_test.* - Filter: ((update_test.a = 100) AND (update_test.b = 20)) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(13 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((a = 100)) AND ((b = 20)) +(11 rows) --Testcase 45: UPDATE update_test @@ -394,7 +387,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 47: @@ -416,17 +409,17 @@ UPDATE update_test o QUERY PLAN -------------------------------------------------------------------------------------------- Update on public.update_test o (cost=25.00..145.04 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test o (cost=25.00..145.04 rows=4 width=112) Output: $4, $3, (SubPlan 1 (returns $3,$4)), o.id, o.* Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test SubPlan 1 (returns $3,$4) -> Foreign Scan on public.update_test i (cost=25.00..29.01 rows=4 width=8) Output: (i.a + 1), i.b Filter: ((NOT (i.c IS DISTINCT FROM o.c)) AND (i.a = o.a) AND (i.b = o.b)) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c FROM public.update_test (12 rows) --Testcase 49: @@ -441,7 +434,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 51: @@ -461,16 +454,16 @@ UPDATE update_test SET (b,a) = (select a+1,b from update_test); QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.01..58.01 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.01 rows=4 width=8) Output: (update_test_1.a + 1), update_test_1.b Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b FROM public.update_test -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=112) Output: $1, $0, NULL::record, update_test.id, update_test.* Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (11 rows) --Testcase 53: @@ -484,19 +477,17 @@ UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000) QUERY PLAN ---------------------------------------------------------------------------------------------- Update on public.update_test (cost=54.01..58.01 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? InitPlan 1 (returns $0,$1) -> Foreign Scan on public.update_test update_test_1 (cost=25.00..29.01 rows=4 width=8) Output: (update_test_1.a + 1), update_test_1.b - Filter: (update_test_1.a = 1000) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b FROM public.update_test WHERE ((a = 1000)) -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=112) Output: $1, $0, NULL::record, update_test.id, update_test.* - Filter: (update_test.a = 11) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(13 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((a = 11)) +(11 rows) --Testcase 55: UPDATE update_test SET (b,a) = (select a+1,b from update_test where a = 1000) @@ -518,7 +509,7 @@ SELECT * FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=44) Output: a, b, c, id Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test (4 rows) --Testcase 57: @@ -539,13 +530,12 @@ UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j) QUERY PLAN --------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.00 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=80) Output: 21, 100, update_test.id, update_test.* - Filter: (update_test.a = 21) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((a = 21)) +(6 rows) --Testcase 59: UPDATE update_test SET (a,b) = ROW(v.*) FROM (VALUES(21, 100)) AS v(i, j) @@ -586,13 +576,12 @@ UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car'; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Update on public.update_test (cost=25.00..29.00 rows=0 width=0) - Remote SQL: UPDATE "public"."update_test" SET "c" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET c = ? WHERE id = ? -> Foreign Scan on public.update_test (cost=25.00..29.00 rows=4 width=104) Output: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'::text, id, update_test.* - Filter: (update_test.c = 'car'::text) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" -(7 rows) + Remote SQL: SELECT a, b, c, id FROM public.update_test WHERE ((c = 'car')) +(6 rows) --Testcase 65: UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car'; @@ -604,7 +593,7 @@ SELECT a, b, char_length(c) FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=12) Output: a, b, char_length(c) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c FROM public.update_test (4 rows) --Testcase 67: @@ -623,21 +612,21 @@ EXPLAIN (VERBOSE, COSTS OFF) UPDATE update_test t SET (a, b) = (SELECT b, a FROM update_test s WHERE s.a = t.a) WHERE CURRENT_USER = SESSION_USER; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------- Update on public.update_test t - Remote SQL: UPDATE "public"."update_test" SET "a" = ?, "b" = ? WHERE "id" = ? + Remote SQL: UPDATE public.update_test SET a = ?, b = ? WHERE id = ? -> Result Output: $1, $2, (SubPlan 1 (returns $1,$2)), t.id, t.* One-Time Filter: (CURRENT_USER = SESSION_USER) -> Foreign Scan on public.update_test t Output: t.a, t.id, t.* - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c, id FROM public.update_test SubPlan 1 (returns $1,$2) -> Foreign Scan on public.update_test s Output: s.b, s.a Filter: (s.a = t.a) - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b FROM public.update_test (13 rows) --Testcase 69: @@ -652,7 +641,7 @@ SELECT a, b, char_length(c) FROM update_test; Foreign Scan on public.update_test (cost=25.00..29.01 rows=4 width=12) Output: a, b, char_length(c) Foreign Table Size: 4 b - Remote SQL: SELECT "a","b","c","id" FROM "public"."update_test" + Remote SQL: SELECT a, b, c FROM public.update_test (4 rows) --Testcase 71: @@ -669,10 +658,10 @@ SELECT a, b, char_length(c) FROM update_test; --Testcase 72: EXPLAIN VERBOSE INSERT INTO upsert_test VALUES(1, 'Boo'), (3, 'Zoo'); - QUERY PLAN --------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Insert on public.upsert_test (cost=0.00..0.03 rows=0 width=0) - Remote SQL: INSERT INTO "public"."upsert_test"("a", "b") VALUES (?, ?) + Remote SQL: INSERT INTO public.upsert_test(a, b) VALUES (?, ?) -> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=2 width=36) Output: "*VALUES*".column1, "*VALUES*".column2 (4 rows) diff --git a/init/mysql_init.sh b/init/mysql_init.sh index 606db95..b6e4f69 100755 --- a/init/mysql_init.sh +++ b/init/mysql_init.sh @@ -22,6 +22,8 @@ export PGS_SRC_DIR="/home/test/workplace/postgresql-13.0" # SET GLOBAL time_zone = '-8:00'; # SET GLOBAL log_bin_trust_function_creators = 1; # SET GLOBAL local_infile=1; +# -- Use "||" operator as CONCAT operator +# SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT')); mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D $MYSQL_DB_NAME --local-infile=1 < $PGS_SRC_DIR/contrib/odbc_fdw/init/mysql_init_core.sql mysql -h $MYSQL_HOST -u $MYSQL_USER_NAME -P $MYSQL_PORT -D $MYSQL_DB_NAME --local-infile=1 < $PGS_SRC_DIR/contrib/odbc_fdw/init/mysql_init_post.sql diff --git a/init/mysql_init_extra.sql b/init/mysql_init_extra.sql index e14d661..00feed8 100644 --- a/init/mysql_init_extra.sql +++ b/init/mysql_init_extra.sql @@ -16,3 +16,12 @@ INSERT INTO tbl04 VALUES (6, 45021.21, 2121, 'example', false, '1999-10-01 00:00 INSERT INTO tbl04 VALUES (7, 121.9741, 23241, 'thing', false, '2010-10-01 00:00:00'); INSERT INTO tbl04 VALUES (8, 75, 316, 'example', false, '1999-10-01 10:10:00'); INSERT INTO tbl04 VALUES (9, 6867.34, 8916, 'thing', false, '2010-10-01 10:10:00'); + +DROP TABLE IF EXISTS s1; +CREATE TABLE s1(id int PRIMARY KEY, tag1 text, value1 float, value2 int, value3 float, value4 int, value5 decimal(10, 1), str1 text, str2 text); +INSERT INTO s1 VALUES (0, 'a', 0.1, 100, -0.1, -100, 0.1, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (1, 'a', 0.2, 100, -0.2, -100, 0.2, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (2, 'a', 0.3, 100, -0.3, -100, 0.3, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (3, 'b', 1.1, 200, -1.1, -200, 1.1, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (4, 'b', 2.2, 200, -2.2, -200, 1.2, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (5, 'b', 3.3, 200, -3.3, -200, 1.3, '---XYZ---', ' XYZ '); diff --git a/init/postgresql_init_extra.sql b/init/postgresql_init_extra.sql index 87cb8b7..b130e2b 100644 --- a/init/postgresql_init_extra.sql +++ b/init/postgresql_init_extra.sql @@ -19,4 +19,13 @@ INSERT INTO tbl04 VALUES (5, -1.12, 22342, '(!)JAWLFJ', false, '2010-11-01 00:00 INSERT INTO tbl04 VALUES (6, 45021.21, 2121, 'example', false, '1999-10-01 00:00:00'); INSERT INTO tbl04 VALUES (7, 121.9741, 23241, 'thing', false, '2010-10-01 00:00:00'); INSERT INTO tbl04 VALUES (8, 75, 316, 'example', false, '1999-10-01 10:10:00'); -INSERT INTO tbl04 VALUES (9, 6867.34, 8916, 'thing', false, '2010-10-01 10:10:00'); \ No newline at end of file +INSERT INTO tbl04 VALUES (9, 6867.34, 8916, 'thing', false, '2010-10-01 10:10:00'); + +DROP TABLE IF EXISTS s1; +CREATE TABLE s1(id int PRIMARY KEY, tag1 text, value1 float, value2 int, value3 float, value4 int, value5 numeric, str1 text, str2 text); +INSERT INTO s1 VALUES (0, 'a', 0.1, 100, -0.1, -100, 0.1, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (1, 'a', 0.2, 100, -0.2, -100, 0.2, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (2, 'a', 0.3, 100, -0.3, -100, 0.3, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (3, 'b', 1.1, 200, -1.1, -200, 1.1, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (4, 'b', 2.2, 200, -2.2, -200, 1.2, '---XYZ---', ' XYZ '); +INSERT INTO s1 VALUES (5, 'b', 3.3, 200, -3.3, -200, 1.3, '---XYZ---', ' XYZ '); diff --git a/odbc_fdw.c b/odbc_fdw.c index 9447c5f..39844cf 100644 --- a/odbc_fdw.c +++ b/odbc_fdw.c @@ -10,8 +10,8 @@ * Author: Zheng Yang * Updated to 9.2+ by Gunnar "Nick" Bluth * based on tds_fdw code from Geoff Montee - * Version 0.5.2.3-1 or higher - * updated by Toshiba Corporation + * Version 0.6 or higher + * by Takuya Koda * * IDENTIFICATION * odbc_fdw/odbc_fdw.c @@ -25,6 +25,8 @@ #include "postgres.h" #include +#include "odbc_fdw.h" + #include "funcapi.h" #include "access/reloptions.h" #include "catalog/pg_foreign_server.h" @@ -38,6 +40,7 @@ #include "utils/memutils.h" #include "utils/builtins.h" #include "utils/relcache.h" +#include "utils/syscache.h" #include "storage/lock.h" #include "miscadmin.h" #include "mb/pg_wchar.h" @@ -51,9 +54,11 @@ #include "nodes/pg_list.h" #include "optimizer/appendinfo.h" +#include "optimizer/optimizer.h" #include "optimizer/pathnode.h" #include "optimizer/restrictinfo.h" #include "optimizer/planmain.h" +#include "optimizer/tlist.h" #include "access/tupdesc.h" @@ -88,6 +93,11 @@ #include "utils/date.h" #include "utils/datetime.h" +#if (PG_VERSION_NUM < 140000) +/* source-code-compatibility hacks for pull_varnos() API change */ +#define make_restrictinfo(a,b,c,d,e,f,g,h,i) make_restrictinfo_new(a,b,c,d,e,f,g,h,i) +#endif + PG_MODULE_MAGIC; /* Macro to make conditional DEBUG more terse */ @@ -148,6 +158,21 @@ enum OdbcFdwModifyPrivateIndex OdbcFdwModifyPrivateTargetAttnums, }; +/* + * Indexes of FDW-private information stored in fdw_private lists. + * + * These items are indexed with the enum FdwScanPrivateIndex, so an item + * can be fetched with list_nth(). For example, to get the SELECT statement: + * sql = strVal(list_nth(fdw_private, FdwScanPrivateSelectSql)); + */ +enum FdwScanPrivateIndex +{ + /* SQL statement to execute remotely (as a String node) */ + FdwScanPrivateSelectSql, + /* Integer list of attribute numbers retrieved by the SELECT */ + FdwScanPrivateRetrievedAttrs +}; + typedef struct odbcFdwOptions { char *schema; /* Foreign schema name */ @@ -169,11 +194,9 @@ typedef struct odbcFdwScanState SQLHSTMT stmt; char *query; bool query_executed; - int num_of_result_cols; - int num_of_table_cols; + List *retrieved_attrs; /* list of target attribute numbers */ StringInfoData *table_columns; bool first_iteration; - List *col_position_mask; List *col_size_array; List *col_conversion_array; char *sql_count; @@ -344,6 +367,11 @@ static int odbcIsForeignRelUpdatable(Relation rel); static void odbcExplainForeignModify(ModifyTableState *mtstate, ResultRelInfo *rinfo, List *fdw_private, int subplan_index, ExplainState *es); static void odbcBeginForeignInsert(ModifyTableState *mtstate, ResultRelInfo *resultRelInfo); static void odbcEndForeignInsert(EState *estate, ResultRelInfo *resultRelInfo); +static void odbcGetForeignUpperPaths(PlannerInfo *root, + UpperRelationKind stage, + RelOptInfo *input_rel, + RelOptInfo *output_rel, + void *extra); /* * helper functions @@ -359,7 +387,7 @@ static void odbc_disconnection(SQLHENV *env, SQLHDBC *dbc); static void sql_data_type(SQLSMALLINT odbc_data_type, SQLULEN column_size, SQLSMALLINT decimal_digits, SQLSMALLINT nullable, StringInfo sql_type); static void odbcGetOptions(Oid server_oid, List *add_options, odbcFdwOptions *extracted_options); static void odbcGetTableOptions(Oid foreigntableid, odbcFdwOptions *extracted_options); -static void odbcGetTableSize(odbcFdwOptions* options, unsigned int *size); +static void odbcGetTableInfo(odbcFdwOptions* options, unsigned int *size, char **quote_char_out, char **name_qualifier_char_out); static void check_return(SQLRETURN ret, char *msg, SQLHANDLE handle, SQLSMALLINT type); static void odbcConnStr(StringInfoData *conn_str, odbcFdwOptions* options); static char* get_schema_name(odbcFdwOptions *options); @@ -371,10 +399,19 @@ static TupleTableSlot *execute_foreign_modify(EState *estate, ResultRelInfo *res static void bind_stmt_params(odbcFdwModifyState *fmstate, TupleTableSlot *slot); static void bind_stmt_param(odbcFdwModifyState *fmstate, Oid type, int attnum, Datum value); static void bindJunkColumnValue(odbcFdwModifyState *fmstate, TupleTableSlot *slot, TupleTableSlot *planSlot, Oid foreignTableId, int bindnum); -static int set_transmission_modes(void); -static void reset_transmission_modes(int nestlevel); static void release_odbc_resources(odbcFdwModifyState *fmstate); static SQLRETURN validate_retrieved_string(SQLHSTMT stmt, SQLUSMALLINT ColumnNumber, const char *string_value, bool *is_mapped, bool *is_empty_retrieved_string); +static void odbc_get_column_info(SQLHSTMT *stmt, ForeignScanState *node, odbcFdwScanState *festate); +static char* odbc_get_attr_value(odbcFdwScanState *festate, int attid, Oid pgtype, SQLLEN *result_size, ColumnConversion conversion); +static Datum odbc_convert_to_pg(Oid pgtyp, int pgtypmod, char* value, int size, ColumnConversion conversion); +static void odbc_make_tuple_from_result_row(SQLHSTMT * stmt, + TupleDesc tupleDescriptor, + List *retrieved_attrs, + Datum *row, + bool *is_null, + odbcFdwScanState * festate); +static void odbc_add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel, + RelOptInfo *grouped_rel, GroupPathExtraData *extra); #define REL_ALIAS_PREFIX "r" /* Handy macro to add relation name qualification */ @@ -383,8 +420,6 @@ static SQLRETURN validate_retrieved_string(SQLHSTMT stmt, SQLUSMALLINT ColumnNum static void deparseInsertSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *targetAttrs, bool doNothing, List *withCheckOptionList, char *name_qualifier_char, char *quote_char); static void deparseUpdateSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *attname, List *targetAttrs, List *withCheckOptionList, char *name_qualifier_char, char *quote_char); static void deparseDeleteSql(StringInfo buf, RangeTblEntry *rte, Index rtindex, Relation rel, List *name, char *name_qualifier_char, char *quote_char); -static void deparseColumnRef(StringInfo buf, int varno, int varattno, RangeTblEntry *rte, bool qualify_col, char *quote_char); -static void deparseRelation(StringInfo buf, Relation rel, char *name_qualifier_char, char *quote_char); /* * Check if string pointer is NULL or points to empty string @@ -440,7 +475,7 @@ odbc_fdw_handler(PG_FUNCTION_ARGS) fdwroutine->GetForeignJoinPaths = NULL; /* Support functions for upper relation push-down */ - fdwroutine->GetForeignUpperPaths = NULL; + fdwroutine->GetForeignUpperPaths = odbcGetForeignUpperPaths; PG_RETURN_POINTER(fdwroutine); } @@ -858,40 +893,6 @@ sql_data_type( }; } -static SQLULEN -minimum_buffer_size(SQLSMALLINT odbc_data_type) -{ - switch(odbc_data_type) - { - case SQL_DECIMAL : - case SQL_NUMERIC : - return 32; - case SQL_INTEGER : - return 12; - case SQL_REAL : - case SQL_FLOAT : - return 18; - case SQL_DOUBLE : - return 26; - case SQL_SMALLINT : - case SQL_TINYINT : - return 6; - case SQL_BIGINT : - return 21; - case SQL_TYPE_DATE : - case SQL_DATE : - return 10; - case SQL_TYPE_TIME : - case SQL_TIME : - return 8; - case SQL_TYPE_TIMESTAMP : - case SQL_TIMESTAMP : - return 20; - default : - return 0; - }; -} - /* * Fetch the options for a server and options list */ @@ -1042,10 +1043,13 @@ static void odbcConnStr(StringInfoData *conn_str, odbcFdwOptions* options) } /* - * get table size of a table + * odbcGetTableInfo: + * - table size + * - quote indentifier char + * - name qualifier char */ static void -odbcGetTableSize(odbcFdwOptions* options, unsigned int *size) +odbcGetTableInfo(odbcFdwOptions* options, unsigned int *size, char **quote_char_out, char **name_qualifier_char_out) { SQLHENV env; SQLHDBC dbc; @@ -1069,28 +1073,34 @@ odbcGetTableSize(odbcFdwOptions* options, unsigned int *size) /* Allocate a statement handle */ SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt); - if (is_blank_string(options->sql_count)) - { - /* Get quote char */ - getQuoteChar(dbc, "e_char); + /* Get quote char */ + getQuoteChar(dbc, "e_char); - /* Get name qualifier char */ - getNameQualifierChar(dbc, &name_qualifier_char); + /* Get name qualifier char */ + getNameQualifierChar(dbc, &name_qualifier_char); + + if (quote_char_out) + *quote_char_out = quote_char.data; + if (name_qualifier_char_out) + *name_qualifier_char_out = name_qualifier_char.data; + + if (is_blank_string(options->sql_count)) + { initStringInfo(&sql_str); if (is_blank_string(options->sql_query)) { if (is_blank_string(schema_name)) { - appendStringInfo(&sql_str, "SELECT COUNT(*) FROM %s%s%s", - quote_char.data, options->table, quote_char.data); + appendStringInfo(&sql_str, "SELECT COUNT(*) FROM %s", + odbc_quote_identifier(options->table, quote_char.data, false)); } else { - appendStringInfo(&sql_str, "SELECT COUNT(*) FROM %s%s%s%s%s%s%s", - quote_char.data, schema_name, quote_char.data, + appendStringInfo(&sql_str, "SELECT COUNT(*) FROM %s%s%s", + odbc_quote_identifier(schema_name, quote_char.data, false), name_qualifier_char.data, - quote_char.data, options->table, quote_char.data); + odbc_quote_identifier(options->table, quote_char.data, false)); } } else @@ -1196,7 +1206,7 @@ odbc_table_size(PG_FUNCTION_ARGS) tableOptions = lappend(tableOptions, elem); odbcGetOptions(serverOid, tableOptions, &options); - odbcGetTableSize(&options, &tableSize); + odbcGetTableInfo(&options, &tableSize, NULL, NULL); PG_RETURN_INT32(tableSize); } @@ -1221,7 +1231,7 @@ odbc_query_size(PG_FUNCTION_ARGS) queryOptions = lappend(queryOptions, elem); serverOid = oid_from_server_name(serverName); odbcGetOptions(serverOid, queryOptions, &options); - odbcGetTableSize(&options, &querySize); + odbcGetTableInfo(&options, &querySize, NULL, NULL); PG_RETURN_INT32(querySize); } @@ -1351,80 +1361,6 @@ Datum odbc_tables_list(PG_FUNCTION_ARGS) } } -/* - * get quals in the select if there is one - */ -static void -odbcGetQual(Node *node, TupleDesc tupdesc, List *col_mapping_list, char **key, char **value, bool *pushdown) -{ - ListCell *col_mapping; - *key = NULL; - *value = NULL; - *pushdown = false; - - elog_debug("%s", __func__); - - if (!node) - return; - - if (IsA(node, OpExpr)) - { - OpExpr *op = (OpExpr *) node; - Node *left, *right; - Index varattno; - - if (list_length(op->args) != 2) - return; - - left = list_nth(op->args, 0); - if (!IsA(left, Var)) - - return; - - varattno = ((Var *) left)->varattno; - - right = list_nth(op->args, 1); - - if (IsA(right, Const)) - { - StringInfoData buf; - initStringInfo(&buf); - /* And get the column and value... */ - *key = NameStr(TupleDescAttr(tupdesc, varattno - 1)->attname); - - if (((Const *) right)->consttype == PROCID_TEXTCONST) - *value = TextDatumGetCString(((Const *) right)->constvalue); - else - { - return; - } - - /* convert qual keys to mapped couchdb attribute name */ - foreach(col_mapping, col_mapping_list) - { - DefElem *def = (DefElem *) lfirst(col_mapping); - if (strcmp(def->defname, *key) == 0) - { - *key = defGetString(def); - break; - } - } - - /* - * We can push down this qual if: - * - The operatory is TEXTEQ - * - The qual is on the _id column (in addition, _rev column can be also valid) - */ - - if (op->opfuncid == PROCID_TEXTEQ) - *pushdown = true; - - return; - } - } - return; -} - /* * Check if the provided option is one of the valid options. * context is the Oid of the catalog holding the object the option is for. @@ -1450,13 +1386,55 @@ static void odbcGetForeignRelSize(PlannerInfo *root, RelOptInfo *baserel, Oid fo { unsigned int table_size = 0; odbcFdwOptions options; + OdbcFdwRelationInfo *fpinfo; + ListCell *lc; elog_debug("%s", __func__); + /* + * We use OdbcFdwRelationInfo to pass various information to subsequent + * functions. + */ + fpinfo = (OdbcFdwRelationInfo *) palloc0(sizeof(OdbcFdwRelationInfo)); + baserel->fdw_private = (void *) fpinfo; + + /* Base foreign tables need to be pushed down always. */ + fpinfo->pushdown_safe = true; + + /* Look up foreign-table catalog info. */ + fpinfo->table = GetForeignTable(foreigntableid); + fpinfo->server = GetForeignServer(fpinfo->table->serverid); + /* Fetch the foreign table options */ odbcGetTableOptions(foreigntableid, &options); - odbcGetTableSize(&options, &table_size); + odbcGetTableInfo(&options, &table_size, &fpinfo->q_char, &fpinfo->name_qualifier_char); + + /* + * Identify which baserestrictinfo clauses can be sent to the remote + * server and which can't. + */ + odbc_classify_conditions(root, baserel, baserel->baserestrictinfo, + &fpinfo->remote_conds, &fpinfo->local_conds); + + /* + * Identify which attributes will need to be retrieved from the remote + * server. These include all attrs needed for joins or final output, plus + * all attrs used in the local_conds. (Note: if we end up using a + * parameterized scan, it's possible that some of the join clauses will be + * sent to the remote and thus we wouldn't really need to retrieve the + * columns used in them. Doesn't seem worth detecting that case though.) + */ + fpinfo->attrs_used = NULL; + pull_varattnos((Node *) baserel->reltarget->exprs, baserel->relid, + &fpinfo->attrs_used); + foreach(lc, fpinfo->local_conds) + { + RestrictInfo *rinfo = lfirst_node(RestrictInfo, lc); + + pull_varattnos((Node *) rinfo->clause, baserel->relid, + &fpinfo->attrs_used); + } baserel->rows = table_size; baserel->tuples = baserel->rows; @@ -1472,7 +1450,7 @@ static void odbcEstimateCosts(PlannerInfo *root, RelOptInfo *baserel, Cost *star /* Fetch the foreign table options */ odbcGetTableOptions(foreigntableid, &options); - odbcGetTableSize(&options, &table_size); + odbcGetTableInfo(&options, &table_size, NULL, NULL); *startup_cost = 25; @@ -1518,17 +1496,191 @@ static bool odbcAnalyzeForeignTable(Relation relation, AcquireSampleRowsFunc *fu static ForeignScan* odbcGetForeignPlan(PlannerInfo *root, RelOptInfo *baserel, Oid foreigntableid, ForeignPath *best_path, List *tlist, List *scan_clauses, Plan *outer_plan) { - Index scan_relid = baserel->relid; - elog_debug("----> starting %s", __func__); + OdbcFdwRelationInfo *fpinfo = (OdbcFdwRelationInfo *) baserel->fdw_private; + Index scan_relid; + List *fdw_private; + List *remote_exprs = NIL; + List *local_exprs = NIL; + List *retrieved_attrs; + StringInfoData sql; + ListCell *lc; + List *fdw_scan_tlist = NIL; + List *fdw_recheck_quals = NIL; - scan_clauses = extract_actual_clauses(scan_clauses, false); + if (IS_SIMPLE_REL(baserel)) + { + /* + * For base relations, set scan_relid as the relid of the relation. + */ + scan_relid = baserel->relid; - elog_debug("----> finishing %s", __func__); + /* + * In a base-relation scan, we must apply the given scan_clauses. + * + * Separate the scan_clauses into those that can be executed remotely + * and those that can't. baserestrictinfo clauses that were + * previously determined to be safe or unsafe by odbc_classify_conditions + * are found in fpinfo->remote_conds and fpinfo->local_conds. Anything + * else in the scan_clauses list will be a join clause, which we have + * to check for remote-safety. + * + * Note: the join clauses we see here should be the exact same ones + * previously examined by postgresGetForeignPaths. Possibly it'd be + * worth passing forward the classification work done then, rather + * than repeating it here. + * + * This code must match "extract_actual_clauses(scan_clauses, false)" + * except for the additional decision about remote versus local + * execution. + */ + foreach(lc, scan_clauses) + { + RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc); + + + Assert(IsA(rinfo, RestrictInfo)); + + /* + * Ignore any pseudoconstants, they're dealt with elsewhere + */ + if (rinfo->pseudoconstant) + continue; + + if (list_member_ptr(fpinfo->remote_conds, rinfo)) + { + remote_exprs = lappend(remote_exprs, rinfo->clause); + } + else if (list_member_ptr(fpinfo->local_conds, rinfo)) + local_exprs = lappend(local_exprs, rinfo->clause); + else if (odbc_is_foreign_expr(root, baserel, rinfo->clause)) + { + remote_exprs = lappend(remote_exprs, rinfo->clause); + } + else + local_exprs = lappend(local_exprs, rinfo->clause); + } + + /* + * For a base-relation scan, we have to support EPQ recheck, which + * should recheck all the remote quals. + */ + fdw_recheck_quals = remote_exprs; + } + else + { + /* + * Join relation or upper relation - set scan_relid to 0. + */ + scan_relid = 0; + + /* + * For a join rel, baserestrictinfo is NIL and we are not considering + * parameterization right now, so there should be no scan_clauses for + * a joinrel or an upper rel either. + */ + Assert(!scan_clauses); + + /* + * Instead we get the conditions to apply from the fdw_private + * structure. + */ + remote_exprs = extract_actual_clauses(fpinfo->remote_conds, false); + local_exprs = extract_actual_clauses(fpinfo->local_conds, false); + + /* + * We leave fdw_recheck_quals empty in this case, since we never need + * to apply EPQ recheck clauses. In the case of a joinrel, EPQ + * recheck is handled elsewhere --- see GetForeignJoinPaths(). If + * we're planning an upperrel (ie, remote grouping or aggregation) + * then there's no EPQ to do because SELECT FOR UPDATE wouldn't be + * allowed, and indeed we *can't* put the remote clauses into + * fdw_recheck_quals because the unaggregated Vars won't be available + * locally. + */ + + /* + * Build the list of columns to be fetched from the foreign server. + */ + + fdw_scan_tlist = odbc_build_tlist_to_deparse(baserel); + + /* + * Ensure that the outer plan produces a tuple whose descriptor + * matches our scan tuple slot. Also, remove the local conditions + * from outer plan's quals, lest they be evaluated twice, once by the + * local plan and once by the scan. + */ + if (outer_plan) + { + ListCell *lc; + + /* + * Right now, we only consider grouping and aggregation beyond + * joins. Queries involving aggregates or grouping do not require + * EPQ mechanism, hence should not have an outer plan here. + */ + Assert(!IS_UPPER_REL(baserel)); + + /* + * First, update the plan's qual list if possible. In some cases + * the quals might be enforced below the topmost plan level, in + * which case we'll fail to remove them; it's not worth working + * harder than this. + */ + foreach(lc, local_exprs) + { + Node *qual = lfirst(lc); + + outer_plan->qual = list_delete(outer_plan->qual, qual); + + /* + * For an inner join the local conditions of foreign scan plan + * can be part of the joinquals as well. (They might also be + * in the mergequals or hashquals, but we can't touch those + * without breaking the plan.) + */ + if (IsA(outer_plan, NestLoop) || + IsA(outer_plan, MergeJoin) || + IsA(outer_plan, HashJoin)) + { + Join *join_plan = (Join *) outer_plan; + + if (join_plan->jointype == JOIN_INNER) + join_plan->joinqual = list_delete(join_plan->joinqual, + qual); + } + } + + /* + * Now fix the subplan's tlist --- this might result in inserting + * a Result node atop the plan tree. + */ + outer_plan = change_plan_targetlist(outer_plan, fdw_scan_tlist, + best_path->path.parallel_safe); + } + } + + /* + * Build the query string to be sent for execution, and identify + * expressions to be sent as parameters. + */ + initStringInfo(&sql); + odbc_deparse_select_stmt_for_rel(&sql, root, baserel, fdw_scan_tlist, + remote_exprs, best_path->path.pathkeys, + false, false, false, + &retrieved_attrs); + + /* + * Build the fdw_private list that will be available to the executor. + * Items in the list must match order in enum FdwScanPrivateIndex. + */ + fdw_private = list_make2(makeString(sql.data), retrieved_attrs); - return make_foreignscan(tlist, scan_clauses, - scan_relid, NIL, NIL, - NIL /* fdw_scan_tlist */, NIL, /* fdw_recheck_quals */ - NULL /* outer_plan */ ); + return make_foreignscan(tlist, local_exprs, + scan_relid, NIL, fdw_private, + fdw_scan_tlist, + fdw_recheck_quals, + outer_plan); } /* @@ -1542,35 +1694,27 @@ odbcBeginForeignScan(ForeignScanState *node, int eflags) SQLHDBC dbc; odbcFdwScanState *festate; odbcFdwOptions options; - Relation rel; - int num_of_columns; - StringInfoData *columns; - int i; - StringInfoData sql; - StringInfoData col_str; - StringInfoData name_qualifier_char; - StringInfoData quote_char; - char *qual_key = NULL; - char *qual_value = NULL; - bool pushdown = false; - const char *schema_name; int encoding = -1; + EState *estate = node->ss.ps.state; + ForeignScan *fsplan = (ForeignScan *) node->ss.ps.plan; + RangeTblEntry *rte; + int rtindex; + TupleTableSlot *tupleSlot = node->ss.ss_ScanTupleSlot; + TupleDesc tupleDescriptor = tupleSlot->tts_tupleDescriptor; elog_debug("%s", __func__); - /* Fetch the foreign table options */ - odbcGetTableOptions(RelationGetRelid(node->ss.ss_currentRelation), &options); + if (fsplan->scan.scanrelid > 0) + rtindex = fsplan->scan.scanrelid; + else + rtindex = bms_next_member(fsplan->fs_relids, -1); + rte = exec_rt_fetch(rtindex, estate); - schema_name = get_schema_name(&options); + /* Fetch the foreign table options */ + odbcGetTableOptions(rte->relid, &options); odbc_connection(&options, &env, &dbc); - /* Get quote char */ - getQuoteChar(dbc, "e_char); - - /* Get name qualifier char */ - getNameQualifierChar(dbc, &name_qualifier_char); - if (!is_blank_string(options.encoding)) { encoding = pg_char_to_encoding(options.encoding); @@ -1583,427 +1727,384 @@ odbcBeginForeignScan(ForeignScanState *node, int eflags) } } - /* Fetch the table column info */ - rel = table_open(RelationGetRelid(node->ss.ss_currentRelation), AccessShareLock); - num_of_columns = rel->rd_att->natts; - columns = (StringInfoData *) palloc0(sizeof(StringInfoData) * num_of_columns); - initStringInfo(&col_str); - for (i = 0; i < num_of_columns; i++) - { - StringInfoData col; - StringInfoData mapping; - bool mapped; - List* options = NULL; - ListCell* lc; - - /* retrieve the column name */ - initStringInfo(&col); - appendStringInfo(&col, "%s", NameStr(TupleDescAttr(rel->rd_att,i)->attname)); - mapped = false; + festate = (odbcFdwScanState *) palloc0(sizeof(odbcFdwScanState)); + festate->attinmeta = TupleDescGetAttInMetadata(tupleDescriptor); + copy_odbcFdwOptions(&(festate->options), &options); + festate->env = env; + festate->dbc = dbc; + festate->query = strVal(list_nth(fsplan->fdw_private, FdwScanPrivateSelectSql)); + festate->retrieved_attrs = (List *) list_nth(fsplan->fdw_private, + FdwScanPrivateRetrievedAttrs); + /* prepare for the first iteration, there will be some precalculation needed in the first iteration */ + festate->query_executed = false; + festate->first_iteration = true; + festate->encoding = encoding; + node->fdw_state = (void *) festate; +} - elog(DEBUG1, "columns:%d/%d attname:%s", i, rel->rd_att->natts, rel->rd_att->attrs[i].attname.data); - options = GetForeignColumnOptions(rel->rd_att->attrs[i].attrelid, rel->rd_att->attrs[i].attnum); - foreach(lc, options){ - DefElem *def = (DefElem *) lfirst(lc); - elog(DEBUG1, "defname %s", def->defname); +/* + * odbcIterateForeignScan + * Retrieve next row from the result set, or clear tuple slot to indicate + * EOF. + */ +static TupleTableSlot * +odbcIterateForeignScan(ForeignScanState *node) +{ + odbcFdwScanState *festate = (odbcFdwScanState *) node->fdw_state; + TupleTableSlot *tupleSlot = node->ss.ss_ScanTupleSlot; + TupleDesc tupleDescriptor = tupleSlot->tts_tupleDescriptor; + int ret = 0; + SQLHSTMT stmt; - if (strcmp(def->defname, "column") == 0) - { - initStringInfo(&mapping); - appendStringInfo(&mapping, "%s", defGetString(def)); - mapped = true; - break; - } - } + elog(DEBUG1, "odbc_fdw : %s", __func__); - /* decide which name is going to be used */ - if (mapped) - columns[i] = mapping; - else - columns[i] = col; - appendStringInfo(&col_str, i == 0 ? "%s%s%s" : ",%s%s%s", (char *) quote_char.data, columns[i].data, (char *) quote_char.data); - } - table_close(rel, NoLock); + ExecClearTuple(tupleSlot); - /* See if we've got a qual we can push down */ - if (node->ss.ps.plan->qual) + PG_TRY(); { -#if PG_VERSION_NUM >= 100000 - ExprState *state = node->ss.ps.qual; + /* + * If this is the first call after Begin or ReScan, we need to + * execute the query. + */ + if (!festate->query_executed) + { + /* Allocate a statement handle */ + SQLAllocHandle(SQL_HANDLE_STMT, festate->dbc, &stmt); - odbcGetQual((Node *) state->expr, node->ss.ss_currentRelation->rd_att, NULL, &qual_key, &qual_value, &pushdown); -#else - ListCell *lc; + elog_debug("Executing query: %s", festate->query); + /* Retrieve a list of rows */ + ret = SQLExecDirect(stmt, (SQLCHAR *) festate->query, SQL_NTS); + check_return(ret, "Executing ODBC query", stmt, SQL_HANDLE_STMT); + festate->query_executed = true; + festate->stmt = stmt; + } + else + stmt = festate->stmt; + + ret = SQLFetch(stmt); - foreach (lc, node->ss.ps.qual) + if (SQL_SUCCEEDED(ret)) { - /* Only the first qual can be pushed down to remote DBMS */ - ExprState *state = lfirst(lc); + /* + * If this is the first iteration, + * we need to calculate the column size as well as the column conversion + */ + if (festate->first_iteration == true) + { + odbc_get_column_info(stmt, node, festate); + festate->first_iteration = false; + } - odbcGetQual((Node *) state->expr, node->ss.ss_currentRelation->rd_att, options.mapping_list, &qual_key, &qual_value, &pushdown); - if (pushdown) - break; + odbc_make_tuple_from_result_row(festate->stmt, tupleDescriptor, festate->retrieved_attrs, + tupleSlot->tts_values, tupleSlot->tts_isnull, festate); + ExecStoreVirtualTuple(tupleSlot); } -#endif } - - /* Construct the SQL statement used for remote querying */ - initStringInfo(&sql); - if (!is_blank_string(options.sql_query)) - { - /* Use custom query if it's available */ - appendStringInfo(&sql, "%s", options.sql_query); - } - else + PG_CATCH(); { - /* Get options.table */ - if (is_blank_string(schema_name)) + /* Release resources related ODBC connections safely. */ + if(festate->stmt) { - appendStringInfo(&sql, "SELECT %s FROM %s%s%s", col_str.data, - (char *) quote_char.data, options.table, (char *) quote_char.data); + ret = SQLFreeHandle(SQL_HANDLE_STMT, festate->stmt); + check_return(ret, "SQLFreeHandle", festate->stmt, SQL_HANDLE_STMT); + festate->stmt = NULL; } - else + + if(festate->dbc) { - appendStringInfo(&sql, "SELECT %s FROM %s%s%s%s%s%s%s", col_str.data, - (char *) quote_char.data, schema_name, (char *) quote_char.data, - (char *) name_qualifier_char.data, - (char *) quote_char.data, options.table, (char *) quote_char.data); + ret = SQLDisconnect(festate->dbc); + check_return(ret, "SQLDisconnect", festate->dbc, SQL_HANDLE_DBC); + ret = SQLFreeHandle(SQL_HANDLE_DBC, festate->dbc); + check_return(ret, "SQLFreeHandle", festate->dbc, SQL_HANDLE_DBC); + festate->dbc = NULL; } - if (pushdown) + + if(festate->env) { - appendStringInfo(&sql, " WHERE %s%s%s = '%s'", - (char *) quote_char.data, qual_key, (char *) quote_char.data, qual_value); + ret = SQLFreeHandle(SQL_HANDLE_ENV, festate->env); + check_return(ret, "SQLFreeHandle", festate->env, SQL_HANDLE_ENV); + festate->env = NULL; } + PG_RE_THROW(); } + PG_END_TRY(); - festate = (odbcFdwScanState *) palloc0(sizeof(odbcFdwScanState)); - festate->attinmeta = TupleDescGetAttInMetadata(node->ss.ss_currentRelation->rd_att); - copy_odbcFdwOptions(&(festate->options), &options); - festate->env = env; - festate->dbc = dbc; - festate->query = sql.data; - festate->query_executed = false; - festate->table_columns = columns; - festate->num_of_table_cols = num_of_columns; - /* prepare for the first iteration, there will be some precalculation needed in the first iteration */ - festate->first_iteration = true; - festate->encoding = encoding; - node->fdw_state = (void *) festate; + return tupleSlot; } /* - * odbcIterateForeignScan - * + * Get column describe from remote server: + * - Column size + * - Data type (column conversion) */ -static TupleTableSlot * -odbcIterateForeignScan(ForeignScanState *node) +static void +odbc_get_column_info(SQLHSTMT *stmt, ForeignScanState *node, odbcFdwScanState *festate) { - EState *executor_state = node->ss.ps.state; MemoryContext prev_context; - /* ODBC API return status */ - SQLRETURN ret; - odbcFdwScanState *festate = (odbcFdwScanState *) node->fdw_state; - TupleTableSlot *slot = node->ss.ss_ScanTupleSlot; + SQLCHAR *ColumnName; + SQLSMALLINT NameLengthPtr; + SQLSMALLINT DataTypePtr; + SQLULEN ColumnSizePtr; + SQLSMALLINT DecimalDigitsPtr; + SQLSMALLINT NullablePtr; + SQLRETURN ret; SQLSMALLINT columns; - char **values; - HeapTuple tuple; - StringInfoData col_data; - SQLHSTMT stmt; - bool first_iteration = festate->first_iteration; - int num_of_table_cols = festate->num_of_table_cols; - int num_of_result_cols; - StringInfoData *table_columns = festate->table_columns; - List *col_position_mask = NIL; - List *col_size_array = NIL; - List *col_conversion_array = NIL; + int i; + StringInfoData sql_type; + List *col_size_array; + List *col_conversion_array; - elog_debug("%s", __func__); + /* Get number of column */ + ret = SQLNumResultCols(stmt, &columns); + check_return(ret, "SQLNumResultCols()", stmt, SQL_HANDLE_STMT); - if (!festate->query_executed) - { - /* Allocate a statement handle */ - SQLAllocHandle(SQL_HANDLE_STMT, festate->dbc, &stmt); + prev_context = MemoryContextSwitchTo(node->ss.ps.state->es_query_cxt); + col_size_array = NIL; + col_conversion_array = NIL; - elog_debug("Executing query: %s", festate->query); - /* Retrieve a list of rows */ - ret = SQLExecDirect(stmt, (SQLCHAR *) festate->query, SQL_NTS); - check_return(ret, "Executing ODBC query", stmt, SQL_HANDLE_STMT); - festate->query_executed = true; - festate->stmt = stmt; - } - else - stmt = festate->stmt; + /* Obtain the column information of the first row. */ + for (i = 1; i <= columns; i++) + { + ColumnConversion conversion = TEXT_CONVERSION; + ColumnName = (SQLCHAR *) palloc0(sizeof(SQLCHAR) * MAXIMUM_COLUMN_NAME_LEN); - ret = SQLFetch(stmt); + ret = SQLDescribeCol(stmt, + i, /* ColumnName */ + ColumnName, + sizeof(SQLCHAR) * MAXIMUM_COLUMN_NAME_LEN, /* BufferLength */ + &NameLengthPtr, + &DataTypePtr, + &ColumnSizePtr, + &DecimalDigitsPtr, + &NullablePtr); + check_return(ret, "SQLDescribeCol()", stmt, SQL_HANDLE_STMT); + col_size_array = lappend_int(col_size_array, (int) ColumnSizePtr); + + /* get column conversion */ + sql_data_type(DataTypePtr, ColumnSizePtr, DecimalDigitsPtr, NullablePtr, &sql_type); + if (strcmp("bytea", (char*)sql_type.data) == 0) + { + conversion = BIN_CONVERSION; + } + if (strcmp("boolean", (char*)sql_type.data) == 0) + { + conversion = BOOL_CONVERSION; + } + else if (strncmp("bit(",(char*)sql_type.data,4)==0 || strncmp("varbit(",(char*)sql_type.data,7)==0) + { + conversion = BIN_CONVERSION; + } + col_conversion_array = lappend_int(col_conversion_array, (int) conversion); - SQLNumResultCols(stmt, &columns); + pfree(ColumnName); + } - /* - * If this is the first iteration, - * we need to calculate the mask for column mapping as well as the column size - */ - if (first_iteration == true) - { - SQLCHAR *ColumnName; - SQLSMALLINT NameLengthPtr; - SQLSMALLINT DataTypePtr; - SQLULEN ColumnSizePtr; - SQLSMALLINT DecimalDigitsPtr; - SQLSMALLINT NullablePtr; - int i; - int k; - bool found; + festate->col_size_array = col_size_array; + festate->col_conversion_array = col_conversion_array; + MemoryContextSwitchTo(prev_context); +} - StringInfoData sql_type; +/* + * odbc_make_tuple_from_result_row: + * Create a tuple from the specified row of the ODBC resultset. + */ +static void +odbc_make_tuple_from_result_row(SQLHSTMT * stmt, + TupleDesc tupleDescriptor, + List *retrieved_attrs, + Datum *row, + bool *is_null, + odbcFdwScanState * festate) +{ + ListCell *lc = NULL; + int attid = 0; + char *value; + SQLLEN result_size; - /* - * Allocate memory for the masks in a memory context that - * persists between IterateForeignScan calls - */ - prev_context = MemoryContextSwitchTo(executor_state->es_query_cxt); - col_position_mask = NIL; - col_size_array = NIL; - col_conversion_array = NIL; - num_of_result_cols = columns; - /* Obtain the column information of the first row. */ - for (i = 1; i <= columns; i++) - { - ColumnConversion conversion = TEXT_CONVERSION; - found = false; - ColumnName = (SQLCHAR *) palloc0(sizeof(SQLCHAR) * MAXIMUM_COLUMN_NAME_LEN); - SQLDescribeCol(stmt, - i, /* ColumnName */ - ColumnName, - sizeof(SQLCHAR) * MAXIMUM_COLUMN_NAME_LEN, /* BufferLength */ - &NameLengthPtr, - &DataTypePtr, - &ColumnSizePtr, - &DecimalDigitsPtr, - &NullablePtr); - - sql_data_type(DataTypePtr, ColumnSizePtr, DecimalDigitsPtr, NullablePtr, &sql_type); - if (strcmp("bytea", (char*)sql_type.data) == 0) - { - conversion = BIN_CONVERSION; - } - if (strcmp("boolean", (char*)sql_type.data) == 0) - { - conversion = BOOL_CONVERSION; - } - else if (strncmp("bit(",(char*)sql_type.data,4)==0 || strncmp("varbit(",(char*)sql_type.data,7)==0) - { - conversion = BIN_CONVERSION; - } + memset(row, 0, sizeof(Datum) * tupleDescriptor->natts); + memset(is_null, true, sizeof(bool) * tupleDescriptor->natts); - /* Get the position of the column in the FDW table */ - for (k=0; k max_size) - ColumnSizePtr = max_size; - - col_size_array = lappend_int(col_size_array, (int) ColumnSizePtr); - col_conversion_array = lappend_int(col_conversion_array, (int) conversion); - break; - } - } - /* if current column is not used by the foreign table */ - if (!found) - { - col_position_mask = lappend_int(col_position_mask, -1); - col_size_array = lappend_int(col_size_array, -1); - col_conversion_array = lappend_int(col_conversion_array, 0); - } - pfree(ColumnName); + foreach(lc, retrieved_attrs) + { + int attnum = lfirst_int(lc) - 1; + Oid pgtype = TupleDescAttr(tupleDescriptor, attnum)->atttypid; + int32 pgtypmod = TupleDescAttr(tupleDescriptor, attnum)->atttypmod; + ColumnConversion conversion = list_nth_int(festate->col_conversion_array, attid); + + /* Get column value */ + value = odbc_get_attr_value(festate, attid, pgtype, &result_size, conversion); + if (result_size != SQL_NULL_DATA) + { + is_null[attnum] = false; + row[attnum] = odbc_convert_to_pg(pgtype, pgtypmod, value, result_size, conversion); } - festate->num_of_result_cols = num_of_result_cols; - festate->col_position_mask = col_position_mask; - festate->col_size_array = col_size_array; - festate->col_conversion_array = col_conversion_array; - festate->first_iteration = false; - - MemoryContextSwitchTo(prev_context); + attid++; } - else +} + +/* + * odbc_get_attr_value: + * Get attr value from remote server as a string value. + */ +static char* +odbc_get_attr_value(odbcFdwScanState *festate, int attid, Oid pgtype, SQLLEN *result_size, ColumnConversion conversion) +{ + int col_size = list_nth_int(festate->col_size_array, attid); + SQLHSTMT stmt = festate->stmt; + SQLRETURN ret = 0; + SQLSMALLINT target_type = SQL_C_CHAR; + int chunk_size, effective_chunk_size; + int buffer_size = 0; + char *buffer = 0; + int used_buffer_size = 0; + GetDataTruncation truncation; + bool binary_data = false; + + if (conversion == BIN_CONVERSION) { - num_of_result_cols = festate->num_of_result_cols; - col_position_mask = festate->col_position_mask; - col_size_array = festate->col_size_array; - col_conversion_array = festate->col_conversion_array; + target_type = SQL_C_BINARY; + binary_data = true; } - /* Clear tuple to terminate Iteration loop when no more data can be fetched */ - ExecClearTuple(slot); - if (SQL_SUCCEEDED(ret)) + if (col_size == 0) { - SQLSMALLINT i; - values = (char **) palloc0(sizeof(char *) * columns); - - /* Loop through the columns */ - for (i = 1; i <= columns; i++) - { - int mask_index = i - 1; - int col_size = list_nth_int(col_size_array, mask_index); - int mapped_pos = list_nth_int(col_position_mask, mask_index); - ColumnConversion conversion = list_nth_int(col_conversion_array, mask_index); - SQLSMALLINT target_type = SQL_C_CHAR; - SQLLEN result_size; - int chunk_size, effective_chunk_size; - int buffer_size = 0; - char * buffer = 0; - char * hex; - int used_buffer_size = 0; - GetDataTruncation truncation; - bool binary_data = false; - if (conversion == BIN_CONVERSION) - { - target_type = SQL_C_BINARY; - binary_data = true; - } - - if (col_size == 0) - { - col_size = 1024; - } - - chunk_size = binary_data ? col_size : col_size + 1; - - /* Ignore this column if position is marked as invalid */ - if (mapped_pos == -1) - continue; + col_size = 1024; + } - do // Loop for reading the field in chunks - { - resize_buffer(&buffer, &buffer_size, used_buffer_size, used_buffer_size + chunk_size); - ret = SQLGetData(stmt, i, target_type, buffer + used_buffer_size, chunk_size, &result_size); - effective_chunk_size = chunk_size; - if (!binary_data && buffer[used_buffer_size + chunk_size - 1] == 0) - { - effective_chunk_size--; - } - truncation = result_truncation(ret, stmt); - if (truncation == STRING_TRUNCATION) - { - if (result_size == SQL_NO_TOTAL) - { - // no info about remaining data size; keep reading with same chunk_size - used_buffer_size += effective_chunk_size; - } - else - { - // we read chunk_size, but there was result_size pending in total; - // adjust chunk_size for the remaining, so next wil hopely be the final chunk - used_buffer_size += effective_chunk_size; - // note that we need to read result_size - effective_chunk_size more data bytes, - chunk_size = (int)result_size - effective_chunk_size; - // wait, maybe we don't need to read, just append a zero! - if (chunk_size == 0) - { - if (!binary_data) - { - resize_buffer(&buffer, &buffer_size, used_buffer_size, used_buffer_size + 1); - buffer[used_buffer_size - 1] = 0; - } - break; - } - if (!binary_data) - { - chunk_size += 1; - } - } - } - else if (truncation == FRACTIONAL_TRUNCATION) + chunk_size = binary_data ? col_size : col_size + 1; + + do // Loop for reading the field in chunks + { + resize_buffer(&buffer, &buffer_size, used_buffer_size, used_buffer_size + chunk_size); + ret = SQLGetData(stmt, attid + 1, target_type, buffer + used_buffer_size, chunk_size, result_size); + check_return(ret, "SQLGetData()", stmt, SQL_HANDLE_STMT); + effective_chunk_size = chunk_size; + if (!binary_data && buffer[used_buffer_size + chunk_size - 1] == 0) + { + effective_chunk_size--; + } + truncation = result_truncation(ret, stmt); + if (truncation == STRING_TRUNCATION) + { + if (*result_size == SQL_NO_TOTAL) + { + // no info about remaining data size; keep reading with same chunk_size + used_buffer_size += effective_chunk_size; + } + else + { + // we read chunk_size, but there was result_size pending in total; + // adjust chunk_size for the remaining, so next wil hopely be the final chunk + used_buffer_size += effective_chunk_size; + // note that we need to read result_size - effective_chunk_size more data bytes, + chunk_size = (int)*result_size - effective_chunk_size; + // wait, maybe we don't need to read, just append a zero! + if (chunk_size == 0) { - /* Fractional truncation has occurred; - * at this point we cannot obtain the lost digits - */ - used_buffer_size += effective_chunk_size; - if (chunk_size == effective_chunk_size) + if (!binary_data) { - /* The driver has omitted the trailing zero */ resize_buffer(&buffer, &buffer_size, used_buffer_size, used_buffer_size + 1); - buffer[used_buffer_size] = 0; + buffer[used_buffer_size - 1] = 0; } - elog_debug("Truncating number: %s", buffer); + break; } - else // NO_TRUNCATION: finish reading + if (!binary_data) { - used_buffer_size += result_size; + chunk_size += 1; } - } while (truncation == STRING_TRUNCATION && chunk_size > 0); - - if (!binary_data) - { - used_buffer_size = strnlen(buffer, used_buffer_size); } - - if (ret != SQL_SUCCESS_WITH_INFO) + } + else if (truncation == FRACTIONAL_TRUNCATION) + { + /* + * Fractional truncation has occurred; + * at this point we cannot obtain the lost digits + */ + used_buffer_size += effective_chunk_size; + if (chunk_size == effective_chunk_size) { - // TODO: review check_result behaviour for SQL_SUCCESS_WITH_INFO (it should not fail right?) - check_return(ret, "Reading data", stmt, SQL_HANDLE_STMT); + /* The driver has omitted the trailing zero */ + resize_buffer(&buffer, &buffer_size, used_buffer_size, used_buffer_size + 1); + buffer[used_buffer_size] = 0; } + elog_debug("Truncating number: %s", buffer); + } + else // NO_TRUNCATION: finish reading + { + used_buffer_size += *result_size; + } + } while (truncation == STRING_TRUNCATION && chunk_size > 0); - if (SQL_SUCCEEDED(ret)) - { - /* Handle null columns */ - if (result_size == SQL_NULL_DATA) - { - // BuildTupleFromCStrings expects NULLs to be NULL pointers - values[mapped_pos] = NULL; - } - else - { - if (festate->encoding != -1 && !binary_data) - { - /* Convert character encoding */ - buffer = pg_any_to_server(buffer, used_buffer_size, festate->encoding); - } - initStringInfo(&col_data); - switch (conversion) - { - case TEXT_CONVERSION : - appendStringInfoString (&col_data, buffer); - break; - case BOOL_CONVERSION : - if (buffer[0] == 0) - strcpy(buffer, "F"); - else if (buffer[0] == 1) - strcpy(buffer, "T"); - appendStringInfoString (&col_data, buffer); - break; - case BIN_CONVERSION : - /* TODO: avoid hex conversion by building the tuple from Datum values instead of using BuildTupleFromCStrings */ - hex = binary_to_hex(buffer, used_buffer_size); - appendStringInfoString (&col_data, "\\x"); - appendStringInfoString (&col_data, hex); - pfree(hex); - break; - } + if (!binary_data) + { + used_buffer_size = strnlen(buffer, used_buffer_size); + } - values[mapped_pos] = col_data.data; - } - } - pfree(buffer); - } + if (ret != SQL_SUCCESS_WITH_INFO) + { + // TODO: review check_result behaviour for SQL_SUCCESS_WITH_INFO (it should not fail right?) + check_return(ret, "Reading data", stmt, SQL_HANDLE_STMT); + } + if (festate->encoding != -1 && !binary_data) + { + /* Convert character encoding */ + buffer = pg_any_to_server(buffer, used_buffer_size, festate->encoding); + } - tuple = BuildTupleFromCStrings(festate->attinmeta, values); - if (tuple) -#if PG_VERSION_NUM < 120000 - ExecStoreTuple(tuple, slot, InvalidBuffer, false); -#else - ExecStoreHeapTuple(tuple, slot, false); -#endif - pfree(values); + return buffer; +} + +/* + * odbc_convert_to_pg: + * Convert ODBC data into PostgreSQL's compatible data types + */ +static Datum +odbc_convert_to_pg(Oid pgtyp, int pgtypmod, char* value, int size, ColumnConversion conversion) +{ + Datum value_datum = 0; + Datum valueDatum = 0; + regproc typeinput; + HeapTuple tuple; + char *hex; + + /* get the type's output function */ + tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(pgtyp)); + if (!HeapTupleIsValid(tuple)) + elog(ERROR, "cache lookup failed for type%u", pgtyp); + + typeinput = ((Form_pg_type) GETSTRUCT(tuple))->typinput; + ReleaseSysCache(tuple); + + switch (conversion) + { + case BOOL_CONVERSION: + { + if (value[0] == 0) + strcpy(value, "F"); + else if (value[0] == 1) + strcpy(value, "T"); + valueDatum = PointerGetDatum(value); + break; + } + case BIN_CONVERSION: + { + hex = binary_to_hex(value, size); + valueDatum = (Datum) palloc0(strlen(hex) + VARHDRSZ); + memcpy(VARDATA(valueDatum), hex, strlen(hex)); + SET_VARSIZE(valueDatum, strlen(hex) + VARHDRSZ); + break; + } + default: + /* TEXT_CONVERSION */ + valueDatum = CStringGetDatum((char *) value); + break; } - return slot; + value_datum = OidFunctionCall3(typeinput, valueDatum, + ObjectIdGetDatum(pgtyp), + Int32GetDatum(pgtypmod)); + + return value_datum; } /* @@ -2018,7 +2119,7 @@ odbcExplainForeignScan(ForeignScanState *node, ExplainState *es) elog_debug("%s", __func__); - odbcGetTableSize(&(festate->options), &table_size); + odbcGetTableInfo(&(festate->options), &table_size, NULL, NULL); /* Suppress file size if we're not showing cost details */ if (es->costs) @@ -2771,9 +2872,14 @@ deparseInsertSql(StringInfo buf, RangeTblEntry *rte, AttrNumber pindex; bool first; ListCell *lc; + deparse_expr_cxt deparse_cxt; + + deparse_cxt.buf = buf; + deparse_cxt.name_qualifier_char = name_qualifier_char; + deparse_cxt.q_char = quote_char; appendStringInfoString(buf, "INSERT INTO "); - deparseRelation(buf, rel, name_qualifier_char, quote_char); + odbc_deparse_relation(buf, rel, name_qualifier_char, quote_char); if (targetAttrs) { @@ -2788,7 +2894,7 @@ deparseInsertSql(StringInfo buf, RangeTblEntry *rte, appendStringInfoString(buf, ", "); first = false; - deparseColumnRef(buf, rtindex, attnum, rte, false, quote_char); + odbc_deparse_column_ref(buf, rtindex, attnum, rte, false, &deparse_cxt); } appendStringInfoString(buf, ") VALUES ("); @@ -2832,9 +2938,14 @@ deparseUpdateSql(StringInfo buf, RangeTblEntry *rte, { bool first; ListCell *lc; + deparse_expr_cxt deparse_cxt; + + deparse_cxt.buf = buf; + deparse_cxt.name_qualifier_char = name_qualifier_char; + deparse_cxt.q_char = quote_char; appendStringInfoString(buf, "UPDATE "); - deparseRelation(buf, rel, name_qualifier_char, quote_char); + odbc_deparse_relation(buf, rel, name_qualifier_char, quote_char); appendStringInfoString(buf, " SET "); first = true; @@ -2846,7 +2957,7 @@ deparseUpdateSql(StringInfo buf, RangeTblEntry *rte, appendStringInfoString(buf, ", "); first = false; - deparseColumnRef(buf, rtindex, attnum, rte, false, quote_char); + odbc_deparse_column_ref(buf, rtindex, attnum, rte, false, &deparse_cxt); appendStringInfo(buf, " = ?"); } @@ -2864,7 +2975,7 @@ deparseUpdateSql(StringInfo buf, RangeTblEntry *rte, appendStringInfoString(buf, " AND "); first = false; - deparseColumnRef(buf, rtindex, attnum, rte, false, quote_char); + odbc_deparse_column_ref(buf, rtindex, attnum, rte, false, &deparse_cxt); appendStringInfoString(buf, " = ?"); } } @@ -2886,9 +2997,14 @@ deparseDeleteSql(StringInfo buf, RangeTblEntry *rte, { bool first; ListCell *lc; + deparse_expr_cxt deparse_cxt; + + deparse_cxt.buf = buf; + deparse_cxt.name_qualifier_char = name_qualifier_char; + deparse_cxt.q_char = quote_char; appendStringInfoString(buf, "DELETE FROM "); - deparseRelation(buf, rel, name_qualifier_char, quote_char); + odbc_deparse_relation(buf, rel, name_qualifier_char, quote_char); // NULLでなければ、でいいのか? NULLでなく要素が0のパターンは? if (attname) @@ -2904,128 +3020,12 @@ deparseDeleteSql(StringInfo buf, RangeTblEntry *rte, appendStringInfoString(buf, " AND "); first = false; - deparseColumnRef(buf, rtindex, attnum, rte, false, quote_char); + odbc_deparse_column_ref(buf, rtindex, attnum, rte, false, &deparse_cxt); appendStringInfoString(buf, " = ?"); } } } -/* - * Construct name to use for given column, and emit it into buf. - * If it has a column_name FDW option, use that instead of attribute name. - * - * If qualify_col is true, qualify column name with the alias of relation. - */ -static void -deparseColumnRef(StringInfo buf, int varno, int varattno, RangeTblEntry *rte, - bool qualify_col, char *quote_char) -{ - /* We not support fetching the remote side's CTID and OID. */ - if (varattno == SelfItemPointerAttributeNumber) - { - elog(ERROR, "not support CTID/OID"); - } - else if (varattno < 0) - { - elog(ERROR, "not support system attributes"); - } - else if (varattno == 0) - { - elog(ERROR, "not support row reference"); - } - else - { - char *colname = NULL; - List *options; - ListCell *lc; - - /* varno must not be any of OUTER_VAR, INNER_VAR and INDEX_VAR. */ - Assert(!IS_SPECIAL_VARNO(varno)); - - /* - * If it's a column of a foreign table, and it has the column_name FDW - * option, use that value. - */ - options = GetForeignColumnOptions(rte->relid, varattno); - foreach(lc, options) - { - DefElem *def = (DefElem *) lfirst(lc); - - if (strcmp(def->defname, "column") == 0) - { - colname = defGetString(def); - break; - } - } - - /* - * If it's a column of a regular table or it doesn't have column_name - * FDW option, use attribute name. - */ - if (colname == NULL) - colname = get_attname(rte->relid, varattno, false); - - if (qualify_col) - ADD_REL_QUALIFIER(buf, varno); - - appendStringInfo(buf, "%s%s%s", quote_char, colname, quote_char); - - - } -} - -/* - * Append remote name of specified foreign table to buf. - * Use value of table_name FDW option (if any) instead of relation's name. - * Similarly, schema_name FDW option overrides schema name. - */ -static void -deparseRelation(StringInfo buf, Relation rel, char *name_qualifier_char, char *quote_char) -{ - ForeignTable *table; - const char *nspname = NULL; - const char *relname = NULL; - ListCell *lc; - - /* obtain additional catalog information. */ - table = GetForeignTable(RelationGetRelid(rel)); - - /* - * Use value of FDW options if any, instead of the name of object itself. - */ - foreach(lc, table->options) - { - DefElem *def = (DefElem *) lfirst(lc); - - if (strcmp(def->defname, "schema") == 0) - nspname = defGetString(def); - else if (strcmp(def->defname, "table") == 0) - relname = defGetString(def); - } - - /* - * Note: we could skip printing the schema name if it's pg_catalog, but - * that doesn't seem worth the trouble. - */ - if (nspname == NULL) - nspname = get_namespace_name(RelationGetNamespace(rel)); - if (relname == NULL) - relname = RelationGetRelationName(rel); - - if (is_blank_string(nspname)) - { - appendStringInfo(buf, "%s%s%s", - quote_char, relname, quote_char); - } - else - { - appendStringInfo(buf, "%s%s%s%s%s%s%s", - quote_char, nspname, quote_char, - name_qualifier_char, - quote_char, relname, quote_char); - } -} - /* * odbcBeginForeignModify * Begin an insert/update/delete operation on a foreign table @@ -3181,7 +3181,7 @@ odbcEndForeignModify(EState *estate, /* If fmstate is NULL, we are in EXPLAIN; nothing to do */ if (fmstate == NULL) return; - + /* Destroy the execution state */ finish_foreign_modify(fmstate); } @@ -3228,7 +3228,7 @@ odbcExecForeignInsert(EState *estate, PG_RE_THROW(); } PG_END_TRY(); - + return rslot; } @@ -3322,7 +3322,7 @@ bind_stmt_params(odbcFdwModifyState *fmstate, int nestlevel; ListCell *lc; - nestlevel = set_transmission_modes(); + nestlevel = odbc_set_transmission_modes(); foreach(lc, fmstate->target_attrs) { @@ -3349,7 +3349,7 @@ bind_stmt_params(odbcFdwModifyState *fmstate, pindex++; } - reset_transmission_modes(nestlevel); + odbc_reset_transmission_modes(nestlevel); } Assert(pindex == fmstate->p_nums); @@ -3647,14 +3647,14 @@ bindJunkColumnValue(odbcFdwModifyState *fmstate, TupleTableSlot *slot, TupleTabl * user-visible computations. * * We use the equivalent of a function SET option to allow the settings to - * persist only until the caller calls reset_transmission_modes(). If an + * persist only until the caller calls odbc_reset_transmission_modes(). If an * error is thrown in between, guc.c will take care of undoing the settings. * * The return value is the nestlevel that must be passed to - * reset_transmission_modes() to undo things. + * odbc_reset_transmission_modes() to undo things. */ -static int -set_transmission_modes(void) +int +odbc_set_transmission_modes(void) { int nestlevel = NewGUCNestLevel(); @@ -3679,10 +3679,10 @@ set_transmission_modes(void) } /* - * Undo the effects of set_transmission_modes(). + * Undo the effects of odbc_set_transmission_modes(). */ -static void -reset_transmission_modes(int nestlevel) +void +odbc_reset_transmission_modes(int nestlevel) { AtEOXact_GUC(true, nestlevel); } @@ -3986,3 +3986,329 @@ validate_retrieved_string(SQLHSTMT stmt, SQLUSMALLINT ColumnNumber, const char * pfree(result); return ret; } + +/* + * Assess whether the aggregation, grouping and having operations can be + * pushed down to the foreign server. As a side effect, save information we + * obtain in this function to OdbcFdwRelationInfo of the input relation. + */ +static bool +odbc_foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel, Node *havingQual) +{ + Query *query = root->parse; + OdbcFdwRelationInfo *fpinfo = (OdbcFdwRelationInfo *) grouped_rel->fdw_private; + PathTarget *grouping_target; + OdbcFdwRelationInfo *ofpinfo; + ListCell *lc; + int i; + List *tlist = NIL; + + /* We currently don't support pushing Grouping Sets. */ + if (query->groupingSets) + return false; + + /* Get the fpinfo of the underlying scan relation. */ + ofpinfo = (OdbcFdwRelationInfo *) fpinfo->outerrel->fdw_private; + + /* + * If underlying scan relation has any local conditions, those conditions + * are required to be applied before performing aggregation. Hence the + * aggregate cannot be pushed down. + */ + if (ofpinfo->local_conds) + return false; + + /* + * The targetlist expected from this node and the targetlist pushed down + * to the foreign server may be different. The latter requires + * sortgrouprefs to be set to push down GROUP BY clause, but should not + * have those arising from ORDER BY clause. These sortgrouprefs may be + * different from those in the plan's targetlist. Use a copy of path + * target to record the new sortgrouprefs. + */ + grouping_target = grouped_rel->reltarget; + + /* + * Examine grouping expressions, as well as other expressions we'd need to + * compute, and check whether they are safe to push down to the foreign + * server. All GROUP BY expressions will be part of the grouping target + * and thus there is no need to search for them separately. Add grouping + * expressions into target list which will be passed to foreign server. + * + * A tricky fine point is that we must not put any expression into the + * target list that is just a foreign param (that is, something that + * deparse.c would conclude has to be sent to the foreign server). If we + * do, the expression will also appear in the fdw_exprs list of the plan + * node, and setrefs.c will get confused and decide that the fdw_exprs + * entry is actually a reference to the fdw_scan_tlist entry, resulting in + * a broken plan. Somewhat oddly, it's OK if the expression contains such + * a node, as long as it's not at top level; then no match is possible. + */ + i = 0; + + foreach(lc, grouping_target->exprs) + { + Expr *expr = (Expr *) lfirst(lc); + ListCell *l; + + /* + * Non-grouping expression we need to compute. Can we ship it as-is + * to the foreign server? + */ + if (odbc_is_foreign_expr(root, grouped_rel, expr)) + { + /* + * Yes, so add to tlist as-is; OK to suppress duplicates + */ + tlist = add_to_flat_tlist(tlist, list_make1(expr)); + } + else + { + /* + * Not pushable as a whole; extract its Vars and aggregates + */ + List *aggvars; + + aggvars = pull_var_clause((Node *) expr, + PVC_INCLUDE_AGGREGATES); + + /* + * If any aggregate expression is not shippable, then we cannot + * push down aggregation to the foreign server. (We don't have to + * check is_foreign_param, since that certainly won't return true + * for any such expression.) + */ + if (!odbc_is_foreign_expr(root, grouped_rel, (Expr *) aggvars)) + return false; + + /* + * Add aggregates, if any, into the targetlist. Plain Vars outside + * an aggregate can be ignored, because they should be either same + * as some GROUP BY column or part of some GROUP BY expression. In + * either case, they are already part of the targetlist and thus + * no need to add them again. In fact including plain Vars in the + * tlist when they do not match a GROUP BY column would cause the + * foreign server to complain that the shipped query is invalid. + */ + foreach(l, aggvars) + { + Expr *expr = (Expr *) lfirst(l); + + if (IsA(expr, Aggref)) + tlist = add_to_flat_tlist(tlist, list_make1(expr)); + } + } + + i++; + } + + /* + * Classify the pushable and non-pushable HAVING clauses and save them in + * remote_conds and local_conds of the grouped rel's fpinfo. + */ + if (havingQual) + { + ListCell *lc; + + foreach(lc, (List *) havingQual) + { + Expr *expr = (Expr *) lfirst(lc); + RestrictInfo *rinfo; + + /* + * Currently, the core code doesn't wrap havingQuals in + * RestrictInfos, so we must make our own. + */ + Assert(!IsA(expr, RestrictInfo)); + rinfo = make_restrictinfo(root, + expr, + true, + false, + false, + root->qual_security_level, + grouped_rel->relids, + NULL, + NULL); + /* + * Currently, ODBC_fdw does not support push down HAVING clause, + * so, add all havingQuals to local_conds + */ + fpinfo->local_conds = lappend(fpinfo->local_conds, rinfo); + } + } + + /* + * If there are any local conditions, pull Vars and aggregates from it and + * check whether they are safe to pushdown or not. + */ + if (fpinfo->local_conds) + { + List *aggvars = NIL; + ListCell *lc; + + foreach(lc, fpinfo->local_conds) + { + RestrictInfo *rinfo = lfirst_node(RestrictInfo, lc); + + aggvars = list_concat(aggvars, + pull_var_clause((Node *) rinfo->clause, + PVC_INCLUDE_AGGREGATES)); + } + + foreach(lc, aggvars) + { + Expr *expr = (Expr *) lfirst(lc); + + /* + * If aggregates within local conditions are not safe to push + * down, then we cannot push down the query. Vars are already part + * of GROUP BY clause which are checked above, so no need to + * access them again here. Again, we need not check + * is_foreign_param for a foreign aggregate. + */ + if (IsA(expr, Aggref)) + { + if (!odbc_is_foreign_expr(root, grouped_rel, expr)) + return false; + + tlist = add_to_flat_tlist(tlist, list_make1(expr)); + } + } + } + + /* Store generated targetlist */ + fpinfo->grouped_tlist = tlist; + + /* Safe to pushdown */ + fpinfo->pushdown_safe = true; + + return true; +} + +/* + * odbcGetForeignUpperPaths + * Add paths for post-join operations like aggregation, grouping etc. if + * corresponding operations are safe to push down. + */ +static void +odbcGetForeignUpperPaths(PlannerInfo *root, UpperRelationKind stage, + RelOptInfo *input_rel, RelOptInfo *output_rel, + void *extra) +{ + OdbcFdwRelationInfo *fpinfo; + + /* + * If input rel is not safe to pushdown, then simply return as we cannot + * perform any post-join operations on the foreign server. + */ + if (!input_rel->fdw_private || + !((OdbcFdwRelationInfo *) input_rel->fdw_private)->pushdown_safe) + return; + + /* Ignore stages we don't support; and skip any duplicate calls. */ + if (stage != UPPERREL_GROUP_AGG || + output_rel->fdw_private) + return; + + fpinfo = (OdbcFdwRelationInfo *) palloc0(sizeof(OdbcFdwRelationInfo)); + fpinfo->pushdown_safe = false; + output_rel->fdw_private = fpinfo; + + switch (stage) + { + case UPPERREL_GROUP_AGG: + odbc_add_foreign_grouping_paths(root, input_rel, output_rel, + (GroupPathExtraData *) extra); + break; + default: + elog(ERROR, "unexpected upper relation: %d", (int) stage); + break; + } +} + +/* + * odbc_add_foreign_grouping_paths Add foreign path for grouping and/or + * aggregation. + * + * Given input_rel represents the underlying scan. The paths are added to + * the given grouped_rel. + */ +static void +odbc_add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel, + RelOptInfo *grouped_rel, GroupPathExtraData *extra) +{ + Query *parse = root->parse; + OdbcFdwRelationInfo *ifpinfo = input_rel->fdw_private; + OdbcFdwRelationInfo *fpinfo = grouped_rel->fdw_private; + ForeignPath *grouppath; + double rows; + int width; + Cost startup_cost; + Cost total_cost; + + /* + * Nothing to be done, if there is no aggregation required. Odbc_fdw does not + * support GROUP BY, GROUPING SET so also return when there are those clauses. + */ + if (parse->groupClause || + parse->groupingSets || + !parse->hasAggs) + return; + +#if (PG_VERSION_NUM >= 110000) + Assert(extra->patype == PARTITIONWISE_AGGREGATE_NONE || + extra->patype == PARTITIONWISE_AGGREGATE_FULL); +#endif + + /* save the input_rel as outerrel in fpinfo */ + fpinfo->outerrel = input_rel; + + /* + * Copy foreign table, foreign server, user mapping, FDW options etc. + * details from the input relation's fpinfo. + */ + fpinfo->table = ifpinfo->table; + fpinfo->server = ifpinfo->server; + fpinfo->user = ifpinfo->user; + fpinfo->q_char = ifpinfo->q_char; + fpinfo->name_qualifier_char = ifpinfo->name_qualifier_char; + + /* + * Assess if it is safe to push down aggregation and grouping. + * + * Use HAVING qual from extra. In case of child partition, it will have + * translated Vars. + */ + if (!odbc_foreign_grouping_ok(root, grouped_rel, extra->havingQual)) + return; + + /* Use small cost to push down aggregate always */ + rows = width = startup_cost = total_cost = 1; + + /* Create and add foreign path to the grouping relation. */ +#if (PG_VERSION_NUM >= 120000) + grouppath = create_foreign_upper_path(root, + grouped_rel, + grouped_rel->reltarget, + rows, + startup_cost, + total_cost, + NIL, /* no pathkeys */ + NULL, + NIL); /* no fdw_private */ +#else + grouppath = create_foreignscan_path(root, + grouped_rel, + root->upper_targets[UPPERREL_GROUP_AGG], + rows, + startup_cost, + total_cost, + NIL, /* no pathkeys */ + NULL, /* no required_outer */ + NULL, + NIL); /* no fdw_private */ +#endif + + /* Add generated path into grouped_rel by add_path(). */ + add_path(grouped_rel, (Path *) grouppath); +} diff --git a/odbc_fdw.h b/odbc_fdw.h new file mode 100644 index 0000000..f748f87 --- /dev/null +++ b/odbc_fdw.h @@ -0,0 +1,95 @@ +/*------------------------------------------------------------------------- + * + * odbc_fdw.h + * foreign-data wrapper for ODBC + * + * Copyright (c) 2021, TOSHIBA Corporation + * + * IDENTIFICATION + * contrib/odbc_fdw/odbc_fdw.h + * + *------------------------------------------------------------------------- + */ +#ifndef ODBC_FDW_H +#define ODBC_FDW_H + +#include "foreign/foreign.h" +#include "lib/stringinfo.h" +#include "nodes/execnodes.h" +#include "nodes/pathnodes.h" +#include "utils/relcache.h" + +#define REL_ALIAS_PREFIX "r" + +/* + * FDW-specific planner information kept in RelOptInfo.fdw_private for a + * odbc_fdw foreign table. For a baserel, this struct is created by + * odbcGetForeignRelSize, although some fields are not filled till later. + * odbcGetForeignJoinPaths creates it for a joinrel, and + * odbcGetForeignUpperPaths creates it for an upperrel. + */ +typedef struct OdbcFdwRelationInfo +{ + /* + * True means that the relation can be pushed down. Always true for simple + * foreign scan. + */ + bool pushdown_safe; + + /* + * Restriction clauses, divided into safe and unsafe to pushdown subsets. + * All entries in these lists should have RestrictInfo wrappers; that + * improves efficiency of selectivity and cost estimation. + */ + List *remote_conds; + List *local_conds; + + /* Bitmap of attr numbers we need to fetch from the remote server. */ + Bitmapset *attrs_used; + + /* Cached catalog information. */ + ForeignTable *table; + ForeignServer *server; + UserMapping *user; /* only set in use_remote_estimate mode */ + char *q_char; + char *name_qualifier_char; + + RelOptInfo *outerrel; + + /* Grouping information */ + List *grouped_tlist; +} OdbcFdwRelationInfo; + +/* + * Context for deparseExpr + */ +typedef struct deparse_expr_cxt +{ + PlannerInfo *root; /* global planner state */ + RelOptInfo *foreignrel; /* the foreign relation we are planning for */ + RelOptInfo *scanrel; /* the underlying scan relation. Same as + * foreignrel, when that represents a join or + * a base relation. */ + StringInfo buf; /* output buffer to append to */ + + char *q_char; + char *name_qualifier_char; +} deparse_expr_cxt; + +extern int odbc_set_transmission_modes(void); +extern void odbc_reset_transmission_modes(int nestlevel); + +/* depare.c headers */ +extern void odbc_classify_conditions(PlannerInfo *root, RelOptInfo *baserel, List *input_conds, + List **remote_conds, List **local_conds); +extern bool odbc_is_foreign_expr(PlannerInfo *root, RelOptInfo *baserel, Expr *expr); +extern void odbc_deparse_select_stmt_for_rel(StringInfo buf, PlannerInfo *root, RelOptInfo *rel, + List *tlist, List *remote_conds, List *pathkeys, + bool has_final_sort, bool has_limit, bool is_subquery, + List **retrieved_attrs); +extern List *odbc_build_tlist_to_deparse(RelOptInfo *foreignrel); +const char *odbc_quote_identifier(const char *ident, char *q_char, bool quote_all_identifiers); +void odbc_deparse_column_ref(StringInfo buf, int varno, int varattno, + RangeTblEntry *rte, bool qualify_col, deparse_expr_cxt *context); +void odbc_deparse_relation(StringInfo buf, Relation rel, char *name_qualifier_char, char *q_char); +#endif /* ODBC_FDW_H */ diff --git a/sql/13.4/char.sql b/sql/13.4/char.sql index 4252898..141f1bd 100644 --- a/sql/13.4/char.sql +++ b/sql/13.4/char.sql @@ -71,6 +71,8 @@ EXPLAIN VERBOSE SELECT f1 FROM CHAR_TBL; --Testcase 24: SELECT f1 FROM CHAR_TBL; +-- For Char, varchar, text in MySQL, comparison is case-insensitive. +-- Result at MySQL will not same as Postgres. --Testcase 25: EXPLAIN VERBOSE SELECT c.f1 diff --git a/sql/13.4/float4.sql b/sql/13.4/float4.sql index 17dcf64..945e793 100644 --- a/sql/13.4/float4.sql +++ b/sql/13.4/float4.sql @@ -141,8 +141,12 @@ DELETE FROM FLOAT4_TBL; INSERT INTO FLOAT4_TBL(f1) VALUES ('nan'::numeric); --Testcase 60: SELECT (f1::float4) AS float4 FROM FLOAT4_TBL; --- +-- The comparison of floating-point values for equality is not safe +-- because of the rounding errors when converting between binary and decimal. +-- A floating-point value as written in an SQL statement may not be +-- the same as the value represented internally. +-- E.g: binary value of 1004.3 may be 1004.2999999999999 --Testcase 61: ALTER FOREIGN TABLE FLOAT4_TBL OPTIONS (SET table 'float4_tbl'); --Testcase 62: diff --git a/sql/13.4/function_pushdown.sql b/sql/13.4/function_pushdown.sql new file mode 100644 index 0000000..47b6632 --- /dev/null +++ b/sql/13.4/function_pushdown.sql @@ -0,0 +1,523 @@ +-- +-- function push-down +-- +--Testcase 1: +CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; +--Testcase 2: +CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME + OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); +--Testcase 3: +CREATE USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); + + +--Testcase 4: +CREATE FOREIGN TABLE s1(id int, tag1 text, value1 float, value2 int, value3 float, value4 int, value5 numeric, str1 text, str2 text) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 's1'); + +--Testcase 5: +CREATE FOREIGN TABLE tbl04 (id int OPTIONS (key 'true'), c1 float8, c2 bigint, c3 text, c4 boolean, c5 timestamp) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl04'); + +--Testcase 6: +EXPLAIN VERBOSE +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; +--Testcase 7: +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + +-- numeric function +--Testcase 8: +EXPLAIN VERBOSE +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; +--Testcase 9: +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + +--Testcase 10: +EXPLAIN VERBOSE +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; +--Testcase 11: +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + +--Testcase 12: +EXPLAIN VERBOSE +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; +--Testcase 13: +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + +--Testcase 14: +EXPLAIN VERBOSE +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; +--Testcase 15: +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + +--Testcase 16: +EXPLAIN VERBOSE +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; +--Testcase 17: +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + +--Testcase 18: +EXPLAIN VERBOSE +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; +--Testcase 19: +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + +--Testcase 20: +EXPLAIN VERBOSE +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; +--Testcase 21: +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + +--Testcase 22: +EXPLAIN VERBOSE +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; +--Testcase 23: +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + +--Testcase 24: +EXPLAIN VERBOSE +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; +--Testcase 25: +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + +--Testcase 26: +EXPLAIN VERBOSE +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; +--Testcase 27: +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + +--Testcase 28: +EXPLAIN VERBOSE +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; +--Testcase 29: +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + +--Testcase 30: +EXPLAIN VERBOSE +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; +--Testcase 31: +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + +--Testcase 32: +EXPLAIN VERBOSE +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; +--Testcase 33: +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + +--Testcase 34: +EXPLAIN VERBOSE +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; +--Testcase 35: +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + +--Testcase 37: +EXPLAIN VERBOSE +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down +--Testcase 38: +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + +--Testcase 39: +EXPLAIN VERBOSE +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; +--Testcase 40: +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + +--Testcase 41: +EXPLAIN VERBOSE +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; +--Testcase 42: +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + +--Testcase 43: +EXPLAIN VERBOSE +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; +--Testcase 44: +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + +--Testcase 45: +EXPLAIN VERBOSE +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; +--Testcase 46: +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + +--Testcase 47: +EXPLAIN VERBOSE +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; +--Testcase 48: +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + +--Testcase 49: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; +--Testcase 50: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + +--Testcase 51: +EXPLAIN VERBOSE +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; +--Testcase 52: +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + +--Testcase 53: +EXPLAIN VERBOSE +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; +--Testcase 54: +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + +--Testcase 55: +EXPLAIN VERBOSE +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; +--Testcase 56: +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + +--Testcase 57: +EXPLAIN VERBOSE +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; +--Testcase 58: +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + +--Testcase 59: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; +--Testcase 60: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + +-- date/time function: +--Testcase 61: +EXPLAIN VERBOSE +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; +--Testcase 62: +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + +-- string function: +--Testcase 63: +EXPLAIN VERBOSE +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; +--Testcase 64: +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + +--Testcase 65: +-- for bit_length() function, postgre's core will optimize it to octet_length() * 8 and push it down +EXPLAIN VERBOSE +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; +--Testcase 66: +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + +--Testcase 67: +EXPLAIN VERBOSE +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down +--Testcase 68: +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + +--Testcase 69: +EXPLAIN VERBOSE +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down +--Testcase 70: +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + +--Testcase 71: +EXPLAIN VERBOSE +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; +--Testcase 72: +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + +--Testcase 73: +EXPLAIN VERBOSE +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; +--Testcase 74: +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + +--Testcase 75: +EXPLAIN VERBOSE +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; +--Testcase 76: +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + +--Testcase 77: +EXPLAIN VERBOSE +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; +--Testcase 78: +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + +--Testcase 79: +EXPLAIN VERBOSE +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; +--Testcase 80: +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + +--Testcase 81: +EXPLAIN VERBOSE +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; +--Testcase 82: +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + +--Testcase 83: +EXPLAIN VERBOSE +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; +--Testcase 84: +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + +--Testcase 85: +EXPLAIN VERBOSE +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; +--Testcase 86: +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + +--Testcase 87: +EXPLAIN VERBOSE +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down +--Testcase 88: +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + +--Testcase 89: +EXPLAIN VERBOSE +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down +--Testcase 90: +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + +--Testcase 91: +EXPLAIN VERBOSE +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; +--Testcase 92: +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + +--Testcase 93: +EXPLAIN VERBOSE +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; +--Testcase 94: +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + +--Testcase 95: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; +--Testcase 96: +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + +--Testcase 97: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; +--Testcase 98: +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + +--Testcase 99: +EXPLAIN VERBOSE +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; +--Testcase 100: +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + +--Testcase 101: +EXPLAIN VERBOSE +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; +--Testcase 102: +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + +--Testcase 103: +EXPLAIN VERBOSE +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; +--Testcase 104: +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + +--Testcase 105: +EXPLAIN VERBOSE +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; +--Testcase 106: +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + +--Testcase 107: +EXPLAIN VERBOSE +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; +--Testcase 108: +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + +--Testcase 109: +EXPLAIN VERBOSE +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down +--Testcase 110: +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + + +--Testcase 111: +EXPLAIN VERBOSE +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down +--Testcase 112: +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + +--Testcase 113: +EXPLAIN VERBOSE +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; +--Testcase 114: +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + +--Testcase 115: +EXPLAIN VERBOSE +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; +--Testcase 116: +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + +--Testcase 117: +EXPLAIN VERBOSE +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; +--Testcase 118: +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + +--Testcase 119: +EXPLAIN VERBOSE +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; +--Testcase 120: +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + +--Testcase 121: +EXPLAIN VERBOSE +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; +--Testcase 122: +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + +--Testcase 123: +EXPLAIN VERBOSE +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; +--Testcase 124: +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + +--Testcase 125: +EXPLAIN VERBOSE +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down +--Testcase 126: +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + +--Testcase 127: +EXPLAIN VERBOSE +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down +--Testcase 128: +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + +--Testcase 129: +EXPLAIN VERBOSE +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down +--Testcase 130: +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + +--Testcase 131: +EXPLAIN VERBOSE +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down +--Testcase 132: +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + +--Testcase 133: +EXPLAIN VERBOSE +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down +--Testcase 134: +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + +--Testcase 135: +EXPLAIN VERBOSE +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; +--Testcase 136: +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + +-- explicit cast function: +--Testcase 137: +EXPLAIN VERBOSE +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down +--Testcase 138: +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + +--Testcase 139: +EXPLAIN VERBOSE +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down +--Testcase 140: +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + +--Testcase 141: +EXPLAIN VERBOSE +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down +--Testcase 142: +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + +--Testcase 143: +EXPLAIN VERBOSE +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down +--Testcase 144: +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + +--Testcase 145: +EXPLAIN VERBOSE +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down +--Testcase 146: +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + +--Testcase 147: +EXPLAIN VERBOSE +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down +--Testcase 148: +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + +--Testcase 149: +EXPLAIN VERBOSE +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down +--Testcase 150: +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + +--Testcase 151: +EXPLAIN VERBOSE +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down +--Testcase 152: +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + +--Testcase 153: +EXPLAIN VERBOSE +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down +--Testcase 154: +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + +--Testcase 155: +EXPLAIN VERBOSE +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down +--Testcase 156: +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + +--Testcase 157: +EXPLAIN VERBOSE +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down +--Testcase 158: +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + +--Testcase 159: +EXPLAIN VERBOSE +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down +--Testcase 160: +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + +--Testcase 161: +EXPLAIN VERBOSE +SELECT c2::real FROM tbl04 WHERE c2::real > 20; +--Testcase 162: +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + +--Testcase 163: +EXPLAIN VERBOSE +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; +--Testcase 164: +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + +--Testcase 165: +EXPLAIN VERBOSE +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; +--Testcase 166: +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + +--Testcase 167: +EXPLAIN VERBOSE +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; +--Testcase 168: +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + +--Testcase 169: +DROP FOREIGN TABLE s1; +--Testcase 170: +DROP FOREIGN TABLE tbl04; + +--Testcase 171: +DROP USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME; +--Testcase 172: +DROP SERVER :DB_SERVERNAME CASCADE; +--Testcase 173: +DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/sql/13.4/mysql/function_pushdown.sql b/sql/13.4/mysql/function_pushdown.sql new file mode 100644 index 0000000..5e08462 --- /dev/null +++ b/sql/13.4/mysql/function_pushdown.sql @@ -0,0 +1,7 @@ +-- +-- MySQL +-- +\set ECHO none +\ir sql/configs/MySql_parameters.conf +\set ECHO all +\i sql/13.4/function_pushdown.sql diff --git a/sql/13.4/new_test.sql b/sql/13.4/new_test.sql index 0ac16fb..59dab74 100644 --- a/sql/13.4/new_test.sql +++ b/sql/13.4/new_test.sql @@ -7,11 +7,11 @@ CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); --Testcase 3: -CREATE USER MAPPING FOR public SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); +CREATE USER MAPPING FOR public SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); --Primary key options --Testcase 4: -CREATE FOREIGN TABLE tbl01 (id bigint OPTIONS (key 'true'), c1 int) +CREATE FOREIGN TABLE tbl01 (id bigint OPTIONS (key 'true'), c1 int) SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl01'); --Testcase 5: EXPLAIN VERBOSE @@ -57,6 +57,7 @@ INSERT INTO tbl02(c1) VALUES (3); --fail ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp01'); --Testcase 20: ALTER FOREIGN TABLE tbl02 ALTER COLUMN c2 SET NOT NULL; +--Testcase 77: \dS+ tbl02 --Testcase 21: INSERT INTO tbl02(id, c2) VALUES ('b', NULL); -- fail @@ -69,9 +70,11 @@ ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp02'); --Testcase 23: ALTER FOREIGN TABLE tbl02 ALTER c1 OPTIONS (key 'true'); -- now, id and c1 are key +--Testcase 78: \dS+ tbl02 --Testcase 73 INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- ok +--Testcase 79: INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- fail --Testcase 74 INSERT INTO tbl02(id, c1) VALUES ('a', 13113.13); -- ok @@ -80,7 +83,6 @@ EXPLAIN VERBOSE SELECT * FROM tbl02; --Testcase 25: SELECT * FROM tbl02; - --Testcase 32: CREATE FOREIGN TABLE tbl03 (id timestamp OPTIONS (key 'true'), c1 int) SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl03'); @@ -133,6 +135,71 @@ EXPLAIN VERBOSE SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); --Testcase 51: SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); + +--Testcase 245: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); +--Testcase 246: +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); +--Testcase 247: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); +--Testcase 248: +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + +--Testcase 249: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); +--Testcase 250: +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); +--Testcase 251: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); +--Testcase 252: +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + +--Testcase 253: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); +--Testcase 254: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); +--Testcase 255: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); +--Testcase 256: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); +--Testcase 257: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); +--Testcase 258: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); +--Testcase 259: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); +--Testcase 260: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); + +--Testcase 261: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); +--Testcase 262: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); +--Testcase 263: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); +--Testcase 264: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); +--Testcase 265: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); +--Testcase 266: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); +--Testcase 267: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); +--Testcase 268: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + --Testcase 52: EXPLAIN VERBOSE SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); @@ -180,6 +247,532 @@ EXPLAIN VERBOSE SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 AND variance(c2) > 55.54; --Testcase 69: SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 AND variance(c2) > 55.54; +--Testcase 241: +EXPLAIN VERBOSE +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); +--Testcase 242: +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); +--Testcase 243: +EXPLAIN VERBOSE +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; +--Testcase 244: +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + +--aggregation function push-down: +-- avg +--Testcase 80: +EXPLAIN VERBOSE +SELECT avg(c1), avg(c2) + 1 FROM tbl04; +--Testcase 81: +SELECT avg(c1), avg(c2) + 1 FROM tbl04; +-- avg(DISTINCT) +--Testcase 82: +EXPLAIN VERBOSE +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; +--Testcase 83: +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + +-- bit_and +--Testcase 84: +EXPLAIN VERBOSE +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; +--Testcase 85: +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; +-- bit_and(DISTINCT) +--Testcase 86: +EXPLAIN VERBOSE +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; +--Testcase 87: +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + +-- bit_or +--Testcase 88: +EXPLAIN VERBOSE +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; +--Testcase 89: +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; +-- bit_or(DISTINCT) +--Testcase 90: +EXPLAIN VERBOSE +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; +--Testcase 91: +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + +-- count +--Testcase 92: +EXPLAIN VERBOSE +SELECT count(c1), count(c2), count(c3) FROM tbl04; +--Testcase 93: +SELECT count(c1), count(c2), count(c3) FROM tbl04; +-- count(DISTINCT) +--Testcase 94: +EXPLAIN VERBOSE +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; +--Testcase 95: +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + +-- max/min +--Testcase 241: +EXPLAIN VERBOSE +SELECT max(c1), min(c1) FROM tbl04; +--Testcase 242: +SELECT max(c1), min(c1) FROM tbl04; + +-- max/min (DISTINCT) +--Testcase 243: +EXPLAIN VERBOSE +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; +--Testcase 244: +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + +-- stddev +--Testcase 96: +EXPLAIN VERBOSE +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; +--Testcase 97: +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; +-- stddev(DISTINCT) +--Testcase 98: +EXPLAIN VERBOSE +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; +--Testcase 99: +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + +-- stddev_pop +--Testcase 100: +EXPLAIN VERBOSE +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; +--Testcase 101: +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; +-- stddev_pop(DISTINCT) +--Testcase 102: +EXPLAIN VERBOSE +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; +--Testcase 103: +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + +-- stddev_samp +--Testcase 104: +EXPLAIN VERBOSE +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; +--Testcase 105: +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; +-- stddev_samp(DISTINCT) +--Testcase 106: +EXPLAIN VERBOSE +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; +--Testcase 107: +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + +-- sum +--Testcase 108: +EXPLAIN VERBOSE +SELECT sum(c1), sum(c2) + 1 FROM tbl04; +--Testcase 109: +SELECT sum(c1), sum(c2) + 1 FROM tbl04; +-- sum(DISTINCT) +--Testcase 110: +EXPLAIN VERBOSE +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; +--Testcase 111: +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + +-- var_pop +--Testcase 112: +EXPLAIN VERBOSE +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; +--Testcase 113: +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; +-- var_pop(DISTINCT) +--Testcase 114: +EXPLAIN VERBOSE +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; +--Testcase 115: +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + +-- var_samp +--Testcase 116: +EXPLAIN VERBOSE +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; +--Testcase 117: +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; +-- var_samp(DISTINCT) +--Testcase 118: +EXPLAIN VERBOSE +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; +--Testcase 119: +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + +-- variance(DISTINCT) +--Testcase 120: +EXPLAIN VERBOSE +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; +--Testcase 121: +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + +-- non-push down case: +--Testcase 122: +EXPLAIN VERBOSE +SELECT corr(id, c1) FROM tbl04; +--Testcase 123: +SELECT corr(id, c1) FROM tbl04; + +-- =================================================================== +-- WHERE push-down +-- =================================================================== +-- add some null record +--Testcase 124: +INSERT INTO tbl04 VALUES (11, -1.12, NULL, '(!)JAWLFJ', false, '2010-11-01 00:00:00'); +--Testcase 125: +INSERT INTO tbl04 VALUES (12, 45021.21, 2121, 'example', NULL, '1999-10-01 00:00:00'); +--Testcase 126: +INSERT INTO tbl04 VALUES (13, 121.9741, 23241, 'thing', NULL, '2010-10-01 00:00:00'); +--Testcase 127: +INSERT INTO tbl04 VALUES (14, 75, 316, 'example', NULL, '1999-10-01 10:10:00'); +--Testcase 128: +INSERT INTO tbl04 VALUES (15, 6867.34, 8916, NULL, false, '2010-10-01 10:10:00'); +-- Logical operator +--Testcase 129: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; +--Testcase 130: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + +--Testcase 131: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; +--Testcase 132: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + +--Testcase 133: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; +--Testcase 134: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + +--Testcase 135: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; +--Testcase 136: +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + +-- Comparison operator +--Testcase 137: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; +--Testcase 138: +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + +--Testcase 139: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; +--Testcase 140: +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + +--Testcase 141: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; +--Testcase 142: +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + +--Testcase 143: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; +--Testcase 144: +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + +--Testcase 145: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; +--Testcase 146: +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + +--Testcase 147: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; +--Testcase 148: +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + +--Testcase 149: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; +--Testcase 150: +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + +--Testcase 151: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; +--Testcase 152: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + +--Testcase 153: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; +--Testcase 154: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + +--Testcase 155: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; +--Testcase 156: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + +--Testcase 157: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; +--Testcase 158: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + +--Testcase 159: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down +--Testcase 160: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + +--Testcase 161: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down +--Testcase 162: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + +--Testcase 163: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; +--Testcase 164: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + +--Testcase 165: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; +--Testcase 166: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + +--Testcase 167: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; +--Testcase 168: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + +--Testcase 169: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; +--Testcase 170: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + +--Testcase 171: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; +--Testcase 172: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + +--Testcase 173: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; +--Testcase 174: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + +--Testcase 175: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down +--Testcase 176: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + +--Testcase 177: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down +--Testcase 178: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down +-- Mathematical operator +--Testcase 179: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id * 100 + 100 > c2; +--Testcase 180: +SELECT id, c1, c2 FROM tbl04 WHERE c1 * 100 + 100 > c2; + +--Testcase 181: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; +--Testcase 182: +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + +--Testcase 183: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down +--Testcase 184: +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + +--Testcase 185: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down +--Testcase 186: +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + +--Testcase 187: +EXPLAIN VERBOSE +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down +--Testcase 188: +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + +--Testcase 189: +EXPLAIN VERBOSE +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down +--Testcase 190: +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + +--Testcase 191: +EXPLAIN VERBOSE +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down +--Testcase 192: +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + +--Testcase 193: +EXPLAIN VERBOSE +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down +--Testcase 194: +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + +--Testcase 195: +EXPLAIN VERBOSE +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down +--Testcase 196: +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + +--Testcase 197: +EXPLAIN VERBOSE +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down +--Testcase 198: +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + +--Testcase 199: +EXPLAIN VERBOSE +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down +--Testcase 200: +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + +--Testcase 201: +EXPLAIN VERBOSE +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down +--Testcase 202: +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + +--Testcase 203: +EXPLAIN VERBOSE +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down +--Testcase 204: +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + +--Testcase 205: +EXPLAIN VERBOSE +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down +--Testcase 206: +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + +-- String operator +--Testcase 207: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down +--Testcase 208: +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + +--Testcase 209: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down +--Testcase 210: +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + +-- Pattern matching operator +--Testcase 211: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; +--Testcase 212: +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + +--Testcase 213: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; +--Testcase 214: +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + +--Testcase 215: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down +--Testcase 216: +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + +--Testcase 217: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down +--Testcase 218: +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + +--Testcase 219: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down +--Testcase 220: +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + +--Testcase 221: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down +--Testcase 222: +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + +--Testcase 223: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down +--Testcase 224: +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + +--Testcase 225: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down +--Testcase 226: +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + + +--Testcase 227: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down +--Testcase 228: +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + +--Testcase 229: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down +--Testcase 230: +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + +-- test for specific type +--Testcase 231: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE inet; +--Testcase 232: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 + 1 > inet '192.168.1.100'; -- does not push down + +--Testcase 233: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE json; +--Testcase 234: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + +--Testcase 235: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE jsonb; +--Testcase 236: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + +--Testcase 237: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE point; +--Testcase 238: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 >> point '(1, 3)'; -- does not push down +-- reset c3 column type +--Testcase 239: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE text; + +-- Reset data for tbl04; +--Testcase 240: +DELETE FROM tbl04 WHERE id > 10; --Testcase 70: DROP SERVER :DB_SERVERNAME CASCADE; diff --git a/sql/13.4/postgresql/function_pushdown.sql b/sql/13.4/postgresql/function_pushdown.sql new file mode 100644 index 0000000..7f27e90 --- /dev/null +++ b/sql/13.4/postgresql/function_pushdown.sql @@ -0,0 +1,7 @@ +-- +-- postgreSql +-- +\set ECHO none +\ir sql/configs/postgreSql_parameters.conf +\set ECHO all +\i sql/13.4/function_pushdown.sql diff --git a/sql/14.0/char.sql b/sql/14.0/char.sql index 4252898..141f1bd 100644 --- a/sql/14.0/char.sql +++ b/sql/14.0/char.sql @@ -71,6 +71,8 @@ EXPLAIN VERBOSE SELECT f1 FROM CHAR_TBL; --Testcase 24: SELECT f1 FROM CHAR_TBL; +-- For Char, varchar, text in MySQL, comparison is case-insensitive. +-- Result at MySQL will not same as Postgres. --Testcase 25: EXPLAIN VERBOSE SELECT c.f1 diff --git a/sql/14.0/float4.sql b/sql/14.0/float4.sql index 83957aa..56ff6b6 100644 --- a/sql/14.0/float4.sql +++ b/sql/14.0/float4.sql @@ -160,7 +160,11 @@ INSERT INTO FLOAT4_TBL(f1) VALUES ('nan'::numeric); --Testcase 66: SELECT (f1::float4) AS float4 FROM FLOAT4_TBL; - +-- The comparison of floating-point values for equality is not safe +-- because of the rounding errors when converting between binary and decimal. +-- A floating-point value as written in an SQL statement may not be +-- the same as the value represented internally. +-- E.g: binary value of 1004.3 may be 1004.2999999999999 --Testcase 67: ALTER FOREIGN TABLE FLOAT4_TBL OPTIONS (SET table 'float4_tbl'); --Testcase 68: diff --git a/sql/14.0/float8.sql b/sql/14.0/float8.sql index 05439f3..496d829 100644 --- a/sql/14.0/float8.sql +++ b/sql/14.0/float8.sql @@ -322,6 +322,9 @@ DELETE FROM FLOAT8_TMP; --Testcase 116: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '144', float8 '0.5'); --Testcase 117: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; +--Testcase 164: SELECT power(f1, f2) FROM FLOAT8_TMP; --Testcase 118: @@ -329,6 +332,9 @@ DELETE FROM FLOAT8_TMP; --Testcase 119: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 'NaN', float8 '0.5'); --Testcase 120: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; +--Testcase 165: SELECT power(f1, f2) FROM FLOAT8_TMP; --Testcase 121: @@ -336,6 +342,9 @@ DELETE FROM FLOAT8_TMP; --Testcase 122: INSERT INTO FLOAT8_TMP(f1, f2) VALUES (float8 '144', float8 'NaN'); --Testcase 123: +EXPLAIN VERBOSE +SELECT power(f1, f2) FROM FLOAT8_TMP; +--Testcase 166: SELECT power(f1, f2) FROM FLOAT8_TMP; --Testcase 124: diff --git a/sql/14.0/function_pushdown.sql b/sql/14.0/function_pushdown.sql new file mode 100644 index 0000000..47b6632 --- /dev/null +++ b/sql/14.0/function_pushdown.sql @@ -0,0 +1,523 @@ +-- +-- function push-down +-- +--Testcase 1: +CREATE EXTENSION IF NOT EXISTS :DB_EXTENSIONNAME; +--Testcase 2: +CREATE SERVER :DB_SERVERNAME FOREIGN DATA WRAPPER :DB_EXTENSIONNAME + OPTIONS (odbc_DRIVER :DB_DRIVERNAME, odbc_SERVER :DB_SERVER, odbc_port :DB_PORT, odbc_DATABASE :DB_DATABASE); +--Testcase 3: +CREATE USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME OPTIONS (odbc_UID :DB_USER, odbc_PWD :DB_PASS); + + +--Testcase 4: +CREATE FOREIGN TABLE s1(id int, tag1 text, value1 float, value2 int, value3 float, value4 int, value5 numeric, str1 text, str2 text) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 's1'); + +--Testcase 5: +CREATE FOREIGN TABLE tbl04 (id int OPTIONS (key 'true'), c1 float8, c2 bigint, c3 text, c4 boolean, c5 timestamp) + SERVER :DB_SERVERNAME OPTIONS (schema :DB_SCHEMA, table 'tbl04'); + +--Testcase 6: +EXPLAIN VERBOSE +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; +--Testcase 7: +SELECT NULLIF(value2, 100) FROM s1 WHERE NULLIF(value2, 100) IS NULL; + +-- numeric function +--Testcase 8: +EXPLAIN VERBOSE +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; +--Testcase 9: +SELECT abs(value1) FROM s1 WHERE abs(value1) > 1; + +--Testcase 10: +EXPLAIN VERBOSE +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; +--Testcase 11: +SELECT acos(value1) FROM s1 WHERE value1 < 1 AND acos(value1) > 1; + +--Testcase 12: +EXPLAIN VERBOSE +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; +--Testcase 13: +SELECT asin(value1) FROM s1 WHERE value1 < 1 AND asin(value1) < 1; + +--Testcase 14: +EXPLAIN VERBOSE +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; +--Testcase 15: +SELECT atan(id) FROM s1 WHERE atan(id) > 0.2; + +--Testcase 16: +EXPLAIN VERBOSE +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; +--Testcase 17: +SELECT atan2(PI(), id) FROM s1 WHERE atan2(PI(), id) > 0.2; + +--Testcase 18: +EXPLAIN VERBOSE +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; +--Testcase 19: +SELECT ceil(value1) FROM s1 WHERE ceil(value1) > 0; + +--Testcase 20: +EXPLAIN VERBOSE +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; +--Testcase 21: +SELECT ceiling(value1) FROM s1 WHERE ceiling(value1) > 0; + +--Testcase 22: +EXPLAIN VERBOSE +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; +--Testcase 23: +SELECT cos(value1) FROM s1 WHERE cos(value1) > 0; + +--Testcase 24: +EXPLAIN VERBOSE +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; +--Testcase 25: +SELECT cot(value1) FROM s1 WHERE cot(value1) > 0; + +--Testcase 26: +EXPLAIN VERBOSE +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; +--Testcase 27: +SELECT degrees(value1) FROM s1 WHERE degrees(value1) > 0; + +--Testcase 28: +EXPLAIN VERBOSE +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; +--Testcase 29: +SELECT exp(value1) FROM s1 WHERE exp(value1) > 0; + +--Testcase 30: +EXPLAIN VERBOSE +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; +--Testcase 31: +SELECT floor(value1) FROM s1 WHERE floor(value1) > 0; + +--Testcase 32: +EXPLAIN VERBOSE +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; +--Testcase 33: +SELECT ln(value1) FROM s1 WHERE ln(value1) > 0; + +--Testcase 34: +EXPLAIN VERBOSE +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; +--Testcase 35: +SELECT value5, log(2, value5) FROM s1 WHERE log(2, value5) > 0; + +--Testcase 37: +EXPLAIN VERBOSE +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down +--Testcase 38: +SELECT log(value1) FROM s1 WHERE log(value1) > 0; -- Does not push down + +--Testcase 39: +EXPLAIN VERBOSE +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; +--Testcase 40: +SELECT log10(value1) FROM s1 WHERE log10(value1) > 0; + +--Testcase 41: +EXPLAIN VERBOSE +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; +--Testcase 42: +SELECT mod(value2, id + 1) FROM s1 WHERE mod(value2, id + 1) > 0; + +--Testcase 43: +EXPLAIN VERBOSE +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; +--Testcase 44: +SELECT pow(value2, id) FROM s1 WHERE pow(value2, id) > 0; + +--Testcase 45: +EXPLAIN VERBOSE +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; +--Testcase 46: +SELECT power(value2, id) FROM s1 WHERE power(value2, id) > 0; + +--Testcase 47: +EXPLAIN VERBOSE +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; +--Testcase 48: +SELECT radians(value1) FROM s1 WHERE radians(value1) > 0; + +--Testcase 49: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; +--Testcase 50: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + +--Testcase 51: +EXPLAIN VERBOSE +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; +--Testcase 52: +SELECT sign(value3), value3 FROM s1 WHERE sign(value3) = -1; + +--Testcase 53: +EXPLAIN VERBOSE +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; +--Testcase 54: +SELECT sin(value1) FROM s1 WHERE sin(value1) > 0; + +--Testcase 55: +EXPLAIN VERBOSE +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; +--Testcase 56: +SELECT sqrt(value1) FROM s1 WHERE sqrt(value1) > 0; + +--Testcase 57: +EXPLAIN VERBOSE +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; +--Testcase 58: +SELECT tan(value1) FROM s1 WHERE tan(value1) > 0; + +--Testcase 59: +EXPLAIN VERBOSE +SELECT round(value1) FROM s1 WHERE round(value1) > 0; +--Testcase 60: +SELECT round(value1) FROM s1 WHERE round(value1) > 0; + +-- date/time function: +--Testcase 61: +EXPLAIN VERBOSE +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; +--Testcase 62: +SELECT date(c5) FROM tbl04 WHERE date(c5) > '1970-01-01'; + +-- string function: +--Testcase 63: +EXPLAIN VERBOSE +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; +--Testcase 64: +SELECT ascii(str1), ascii(str2) FROM s1 WHERE ascii(str1) > 0; + +--Testcase 65: +-- for bit_length() function, postgre's core will optimize it to octet_length() * 8 and push it down +EXPLAIN VERBOSE +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; +--Testcase 66: +SELECT bit_length(str1), bit_length(str2) FROM s1 WHERE bit_length(str1) > 0; + +--Testcase 67: +EXPLAIN VERBOSE +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down +--Testcase 68: +SELECT btrim(str2) FROM s1 WHERE btrim(str2) LIKE 'XYZ'; -- Does not push-down + +--Testcase 69: +EXPLAIN VERBOSE +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down +--Testcase 70: +SELECT btrim(str2, ' ') FROM s1 WHERE btrim(str2, ' ') LIKE 'XYZ'; -- Does not push-down + +--Testcase 71: +EXPLAIN VERBOSE +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; +--Testcase 72: +SELECT char_length(str1), char_length(str2) FROM s1 WHERE char_length(str1) > 0; + +--Testcase 73: +EXPLAIN VERBOSE +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; +--Testcase 74: +SELECT character_length(str1), character_length(str2) FROM s1 WHERE character_length(str1) > 0; + +--Testcase 75: +EXPLAIN VERBOSE +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; +--Testcase 76: +SELECT concat(str1, str2) FROM s1 WHERE concat(str1, str2) LIKE '---XYZ--- XYZ '; + +--Testcase 77: +EXPLAIN VERBOSE +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; +--Testcase 78: +SELECT concat_ws(',', str1, str2) FROM s1 WHERE concat_ws(',', str1, str2) LIKE '---XYZ---, XYZ '; + +--Testcase 79: +EXPLAIN VERBOSE +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; +--Testcase 80: +SELECT left(str1, 3) FROM s1 WHERE left(str1, 3) LIKE '---'; + +--Testcase 81: +EXPLAIN VERBOSE +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; +--Testcase 82: +SELECT length(str1), length(str2) FROM s1 WHERE length(str1) > 0; + +--Testcase 83: +EXPLAIN VERBOSE +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; +--Testcase 84: +SELECT lower(str1), lower(str2) FROM s1 WHERE lower(str1) LIKE '%xyz%'; + +--Testcase 85: +EXPLAIN VERBOSE +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; +--Testcase 86: +SELECT lpad(str1, 20, 'ABCD'), lpad(str2, 20, 'ABCD') FROM s1 WHERE lpad(str1, 20, 'ABCD') LIKE '%XYZ%'; + +--Testcase 87: +EXPLAIN VERBOSE +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down +--Testcase 88: +SELECT ltrim(str2) FROM s1 WHERE ltrim(str2) LIKE 'XYZ '; -- Does not push-down + +--Testcase 89: +EXPLAIN VERBOSE +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down +--Testcase 90: +SELECT ltrim(str2, ' ') FROM s1 WHERE ltrim(str2, ' ') LIKE 'XYZ '; -- Does not push-down + +--Testcase 91: +EXPLAIN VERBOSE +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; +--Testcase 92: +SELECT octet_length(str1), octet_length(str2) FROM s1 WHERE octet_length(str1) > 0; + +--Testcase 93: +EXPLAIN VERBOSE +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; +--Testcase 94: +SELECT position('X' IN str1) FROM s1 WHERE position('X' IN str1) > 0; + +--Testcase 95: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; +--Testcase 96: +SELECT regexp_replace(str1, 'X..', 'xyz') FROM s1 WHERE regexp_replace(str1, 'X..', 'xyz') LIKE '%xyz%'; + +--Testcase 97: +EXPLAIN VERBOSE +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; +--Testcase 98: +SELECT regexp_replace(str1, '[Y]', 'y', 'i') FROM s1 WHERE regexp_replace(str1, '[Y]', 'y', 'i') LIKE '%XyZ%'; + +--Testcase 99: +EXPLAIN VERBOSE +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; +--Testcase 100: +SELECT repeat(str1, 3), repeat(str2, 3) FROM s1 WHERE repeat(str2, 3) LIKE '%X%'; + +--Testcase 101: +EXPLAIN VERBOSE +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; +--Testcase 102: +SELECT replace(str1, 'XYZ', 'ABC') FROM s1 WHERE replace(str1, 'XYZ', 'ABC') LIKE '%A%'; + +--Testcase 103: +EXPLAIN VERBOSE +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; +--Testcase 104: +SELECT reverse(str1), reverse(str2) FROM s1 WHERE reverse(str1) LIKE '%ZYX%'; + +--Testcase 105: +EXPLAIN VERBOSE +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; +--Testcase 106: +SELECT right(str1, 4), right(str2, 4) FROM s1 WHERE right(str1, 4) LIKE 'Z%'; + +--Testcase 107: +EXPLAIN VERBOSE +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; +--Testcase 108: +SELECT rpad(str1, 16, str2), rpad(str1, 4, str2) FROM s1 WHERE rpad(str1, 16, str2) LIKE '---XYZ---%'; + +--Testcase 109: +EXPLAIN VERBOSE +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down +--Testcase 110: +SELECT rtrim(str2) FROM s1 WHERE rtrim(str2) LIKE '%XYZ'; -- Does not push-down + + +--Testcase 111: +EXPLAIN VERBOSE +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down +--Testcase 112: +SELECT rtrim(str2, ' ') FROM s1 WHERE rtrim(str2, ' ') LIKE '%XYZ'; -- Does not push-down + +--Testcase 113: +EXPLAIN VERBOSE +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; +--Testcase 114: +SELECT substr(str1, 3) FROM s1 WHERE substr(str1, 3) LIKE '-XYZ---'; + +--Testcase 115: +EXPLAIN VERBOSE +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; +--Testcase 116: +SELECT substr(str2, 3, 4) FROM s1 WHERE substr(str2, 3, 4) LIKE ' XYZ'; + +--Testcase 117: +EXPLAIN VERBOSE +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; +--Testcase 118: +SELECT substring(str1, 3) FROM s1 WHERE substring(str1, 3) LIKE '-XYZ---'; + +--Testcase 119: +EXPLAIN VERBOSE +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; +--Testcase 120: +SELECT substring(str2, 3, 4) FROM s1 WHERE substring(str2, 3, 4) LIKE ' XYZ'; + +--Testcase 121: +EXPLAIN VERBOSE +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; +--Testcase 122: +SELECT substring(str1 FROM 3) FROM s1 WHERE substring(str1 FROM 3) LIKE '-XYZ---'; + +--Testcase 123: +EXPLAIN VERBOSE +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; +--Testcase 124: +SELECT substring(str2 FROM 3 FOR 4) FROM s1 WHERE substring(str2 FROM 3 FOR 4) LIKE ' XYZ'; + +--Testcase 125: +EXPLAIN VERBOSE +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down +--Testcase 126: +SELECT trim(str2) FROM s1 WHERE trim(str2) LIKE 'XYZ'; -- Does not push-down + +--Testcase 127: +EXPLAIN VERBOSE +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down +--Testcase 128: +SELECT trim('-' FROM str1) FROM s1 WHERE trim('-' FROM str1) LIKE 'XYZ'; -- Does not push-down + +--Testcase 129: +EXPLAIN VERBOSE +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down +--Testcase 130: +SELECT trim(LEADING '-' FROM str1) FROM s1 WHERE trim(LEADING '-' FROM str1) LIKE 'XYZ---'; -- Does not push-down + +--Testcase 131: +EXPLAIN VERBOSE +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down +--Testcase 132: +SELECT trim(BOTH '-' FROM str1) FROM s1 WHERE trim(BOTH '-' FROM str1) LIKE 'XYZ'; -- Does not push-down + +--Testcase 133: +EXPLAIN VERBOSE +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down +--Testcase 134: +SELECT trim(TRAILING '-' FROM str1) FROM s1 WHERE trim(TRAILING '-' FROM str1) LIKE '---XYZ'; -- Does not push-down + +--Testcase 135: +EXPLAIN VERBOSE +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; +--Testcase 136: +SELECT upper(tag1) FROM s1 WHERE upper(tag1) LIKE 'A'; + +-- explicit cast function: +--Testcase 137: +EXPLAIN VERBOSE +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down +--Testcase 138: +SELECT cos(value1::decimal), value1::decimal FROM s1 WHERE cos(value1::decimal) > 0; -- Does not push down + +--Testcase 139: +EXPLAIN VERBOSE +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down +--Testcase 140: +SELECT cos(value1::decimal(10,0)), value1::decimal(10,0) FROM s1 WHERE cos(value1::decimal(10,0)) > 0; -- Does not push down + +--Testcase 141: +EXPLAIN VERBOSE +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down +--Testcase 142: +SELECT cos(value1::numeric), value1::numeric FROM s1 WHERE cos(value1::numeric) > 0; -- Does not push down + +--Testcase 143: +EXPLAIN VERBOSE +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down +--Testcase 144: +SELECT cos(value1::numeric(10,1)), value1::numeric(10,1) FROM s1 WHERE cos(value1::numeric(10,1)) > 0; -- Does not push down + +--Testcase 145: +EXPLAIN VERBOSE +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down +--Testcase 146: +SELECT value2::char FROM s1 WHERE value2::char LIKE '1'; -- Does not push down + +--Testcase 147: +EXPLAIN VERBOSE +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down +--Testcase 148: +SELECT value2::varchar FROM s1 WHERE value2::varchar LIKE '100'; -- Does not push down + +--Testcase 149: +EXPLAIN VERBOSE +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down +--Testcase 150: +SELECT value2::char(6) FROM s1 WHERE value2::char(6) LIKE '100 '; -- Does not push down + +--Testcase 151: +EXPLAIN VERBOSE +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down +--Testcase 152: +SELECT value2::varchar(6) FROM s1 WHERE value2::varchar(6) LIKE '100'; -- Does not push down + +--Testcase 153: +EXPLAIN VERBOSE +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down +--Testcase 154: +SELECT value2::text FROM s1 WHERE value2::text LIKE '100'; -- Does not push down + +--Testcase 155: +EXPLAIN VERBOSE +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down +--Testcase 156: +SELECT value2::smallint FROM s1 WHERE value2::smallint > 20; -- Does not push down + +--Testcase 157: +EXPLAIN VERBOSE +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down +--Testcase 158: +SELECT c1::int FROM tbl04 WHERE c1::int > 20; -- Does not push down + +--Testcase 159: +EXPLAIN VERBOSE +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down +--Testcase 160: +SELECT c2::double precision FROM tbl04 WHERE c2::double precision > 20; -- Does not push down + +--Testcase 161: +EXPLAIN VERBOSE +SELECT c2::real FROM tbl04 WHERE c2::real > 20; +--Testcase 162: +SELECT c2::real FROM tbl04 WHERE c2::real > 20; + +--Testcase 163: +EXPLAIN VERBOSE +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; +--Testcase 164: +SELECT c2::float4 FROM tbl04 WHERE c2::float4 > 20; + +--Testcase 165: +EXPLAIN VERBOSE +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; +--Testcase 166: +SELECT c5::date FROM tbl04 WHERE c5::date > '2001-01-01'::date; + +--Testcase 167: +EXPLAIN VERBOSE +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; +--Testcase 168: +SELECT c5::time FROM tbl04 WHERE c5::time > '00:00:00'::time; + +--Testcase 169: +DROP FOREIGN TABLE s1; +--Testcase 170: +DROP FOREIGN TABLE tbl04; + +--Testcase 171: +DROP USER MAPPING FOR CURRENT_USER SERVER :DB_SERVERNAME; +--Testcase 172: +DROP SERVER :DB_SERVERNAME CASCADE; +--Testcase 173: +DROP EXTENSION :DB_EXTENSIONNAME CASCADE; diff --git a/sql/14.0/mysql/function_pushdown.sql b/sql/14.0/mysql/function_pushdown.sql new file mode 100644 index 0000000..6992a92 --- /dev/null +++ b/sql/14.0/mysql/function_pushdown.sql @@ -0,0 +1,7 @@ +-- +-- MySQL +-- +\set ECHO none +\ir sql/configs/MySql_parameters.conf +\set ECHO all +\i sql/14.0/function_pushdown.sql diff --git a/sql/14.0/new_test.sql b/sql/14.0/new_test.sql index 5d4af49..59dab74 100644 --- a/sql/14.0/new_test.sql +++ b/sql/14.0/new_test.sql @@ -57,6 +57,7 @@ INSERT INTO tbl02(c1) VALUES (3); --fail ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp01'); --Testcase 20: ALTER FOREIGN TABLE tbl02 ALTER COLUMN c2 SET NOT NULL; +--Testcase 77: \dS+ tbl02 --Testcase 21: INSERT INTO tbl02(id, c2) VALUES ('b', NULL); -- fail @@ -69,9 +70,11 @@ ALTER FOREIGN TABLE tbl02 OPTIONS (SET table 'tbl02_tmp02'); --Testcase 23: ALTER FOREIGN TABLE tbl02 ALTER c1 OPTIONS (key 'true'); -- now, id and c1 are key +--Testcase 78: \dS+ tbl02 --Testcase 73 INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- ok +--Testcase 79: INSERT INTO tbl02(id, c1) VALUES ('a', 12112.12); -- fail --Testcase 74 INSERT INTO tbl02(id, c1) VALUES ('a', 13113.13); -- ok @@ -132,6 +135,71 @@ EXPLAIN VERBOSE SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); --Testcase 51: SELECT c5, c4, c2 FROM tbl04 WHERE c5 IN ('2000-01-01', '2010-11-01 00:00:00'); + +--Testcase 245: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); +--Testcase 246: +SELECT * FROM tbl04 WHERE id IN (1, 2, 3); +--Testcase 247: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); +--Testcase 248: +SELECT * FROM tbl04 WHERE id NOT IN (1, 2, 3); + +--Testcase 249: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); +--Testcase 250: +SELECT * FROM tbl04 WHERE id IN (1, c2, 3); +--Testcase 251: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); +--Testcase 252: +SELECT * FROM tbl04 WHERE id NOT IN (1, c2, 3); + +--Testcase 253: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); +--Testcase 254: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[c2, 2, 3]); +--Testcase 255: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); +--Testcase 256: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[c2, 2, 3]); +--Testcase 257: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); +--Testcase 258: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[c2, 2, 3]); +--Testcase 259: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); +--Testcase 260: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[c2, 2, 3]); + +--Testcase 261: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); +--Testcase 262: +SELECT * FROM tbl04 WHERE id <> ALL(ARRAY[1, 2, 3]); +--Testcase 263: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); +--Testcase 264: +SELECT * FROM tbl04 WHERE id = ALL(ARRAY[1, 2, 3]); +--Testcase 265: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); +--Testcase 266: +SELECT * FROM tbl04 WHERE id <> ANY(ARRAY[1, 2, 3]); +--Testcase 267: +EXPLAIN VERBOSE +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); +--Testcase 268: +SELECT * FROM tbl04 WHERE id = ANY(ARRAY[1, 2, 3]); + --Testcase 52: EXPLAIN VERBOSE SELECT c3, c5, c1 FROM tbl04 WHERE c1 > ALL(SELECT id FROM tbl04 WHERE c4 = true); @@ -179,6 +247,532 @@ EXPLAIN VERBOSE SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 AND variance(c2) > 55.54; --Testcase 69: SELECT count(c1) + sum (c2), variance(c2)/2.12 FROM tbl04 HAVING count(c4) != 0 AND variance(c2) > 55.54; +--Testcase 241: +EXPLAIN VERBOSE +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); +--Testcase 242: +SELECT count(c1), sum(c2) FROM tbl04 HAVING (count(c1) > 0); +--Testcase 243: +EXPLAIN VERBOSE +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; +--Testcase 244: +SELECT count(c1) + sum (c2) FROM tbl04 HAVING count(c4) != 0 AND avg(c2) > 55.54; + +--aggregation function push-down: +-- avg +--Testcase 80: +EXPLAIN VERBOSE +SELECT avg(c1), avg(c2) + 1 FROM tbl04; +--Testcase 81: +SELECT avg(c1), avg(c2) + 1 FROM tbl04; +-- avg(DISTINCT) +--Testcase 82: +EXPLAIN VERBOSE +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; +--Testcase 83: +SELECT avg(DISTINCT c1), avg(DISTINCT c2) FROM tbl04; + +-- bit_and +--Testcase 84: +EXPLAIN VERBOSE +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; +--Testcase 85: +SELECT bit_and(id), bit_and(c2) + 1 FROM tbl04; +-- bit_and(DISTINCT) +--Testcase 86: +EXPLAIN VERBOSE +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; +--Testcase 87: +SELECT bit_and(DISTINCT id), bit_and(DISTINCT c2) FROM tbl04; + +-- bit_or +--Testcase 88: +EXPLAIN VERBOSE +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; +--Testcase 89: +SELECT bit_or(id), bit_or(c2) + 1 FROM tbl04; +-- bit_or(DISTINCT) +--Testcase 90: +EXPLAIN VERBOSE +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; +--Testcase 91: +SELECT bit_or(DISTINCT id), bit_or(DISTINCT c2) FROM tbl04; + +-- count +--Testcase 92: +EXPLAIN VERBOSE +SELECT count(c1), count(c2), count(c3) FROM tbl04; +--Testcase 93: +SELECT count(c1), count(c2), count(c3) FROM tbl04; +-- count(DISTINCT) +--Testcase 94: +EXPLAIN VERBOSE +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; +--Testcase 95: +SELECT count(DISTINCT c1), count(DISTINCT c2), count(DISTINCT c3) FROM tbl04; + +-- max/min +--Testcase 241: +EXPLAIN VERBOSE +SELECT max(c1), min(c1) FROM tbl04; +--Testcase 242: +SELECT max(c1), min(c1) FROM tbl04; + +-- max/min (DISTINCT) +--Testcase 243: +EXPLAIN VERBOSE +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; +--Testcase 244: +SELECT max(DISTINCT c1), min(DISTINCT c1) FROM tbl04; + +-- stddev +--Testcase 96: +EXPLAIN VERBOSE +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; +--Testcase 97: +SELECT stddev(c1), stddev(c2) + 1 FROM tbl04; +-- stddev(DISTINCT) +--Testcase 98: +EXPLAIN VERBOSE +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; +--Testcase 99: +SELECT stddev(DISTINCT c1), stddev(DISTINCT c2) FROM tbl04; + +-- stddev_pop +--Testcase 100: +EXPLAIN VERBOSE +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; +--Testcase 101: +SELECT stddev_pop(c1), stddev_pop(c2) + 1 FROM tbl04; +-- stddev_pop(DISTINCT) +--Testcase 102: +EXPLAIN VERBOSE +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; +--Testcase 103: +SELECT stddev_pop(DISTINCT c1), stddev_pop(DISTINCT c2) FROM tbl04; + +-- stddev_samp +--Testcase 104: +EXPLAIN VERBOSE +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; +--Testcase 105: +SELECT stddev_samp(c1), stddev_samp(c2) + 1 FROM tbl04; +-- stddev_samp(DISTINCT) +--Testcase 106: +EXPLAIN VERBOSE +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; +--Testcase 107: +SELECT stddev_samp(DISTINCT c1), stddev_samp(DISTINCT c2) FROM tbl04; + +-- sum +--Testcase 108: +EXPLAIN VERBOSE +SELECT sum(c1), sum(c2) + 1 FROM tbl04; +--Testcase 109: +SELECT sum(c1), sum(c2) + 1 FROM tbl04; +-- sum(DISTINCT) +--Testcase 110: +EXPLAIN VERBOSE +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; +--Testcase 111: +SELECT sum(DISTINCT c1), sum(DISTINCT c2) FROM tbl04; + +-- var_pop +--Testcase 112: +EXPLAIN VERBOSE +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; +--Testcase 113: +SELECT var_pop(c1), var_pop(c2) + 1 FROM tbl04; +-- var_pop(DISTINCT) +--Testcase 114: +EXPLAIN VERBOSE +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; +--Testcase 115: +SELECT var_pop(DISTINCT c1), var_pop(DISTINCT c2) FROM tbl04; + +-- var_samp +--Testcase 116: +EXPLAIN VERBOSE +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; +--Testcase 117: +SELECT var_samp(c1), var_samp(c2) + 1 FROM tbl04; +-- var_samp(DISTINCT) +--Testcase 118: +EXPLAIN VERBOSE +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; +--Testcase 119: +SELECT var_samp(DISTINCT c1), var_samp(DISTINCT c2) FROM tbl04; + +-- variance(DISTINCT) +--Testcase 120: +EXPLAIN VERBOSE +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; +--Testcase 121: +SELECT variance(DISTINCT c1), variance(DISTINCT c2) FROM tbl04; + +-- non-push down case: +--Testcase 122: +EXPLAIN VERBOSE +SELECT corr(id, c1) FROM tbl04; +--Testcase 123: +SELECT corr(id, c1) FROM tbl04; + +-- =================================================================== +-- WHERE push-down +-- =================================================================== +-- add some null record +--Testcase 124: +INSERT INTO tbl04 VALUES (11, -1.12, NULL, '(!)JAWLFJ', false, '2010-11-01 00:00:00'); +--Testcase 125: +INSERT INTO tbl04 VALUES (12, 45021.21, 2121, 'example', NULL, '1999-10-01 00:00:00'); +--Testcase 126: +INSERT INTO tbl04 VALUES (13, 121.9741, 23241, 'thing', NULL, '2010-10-01 00:00:00'); +--Testcase 127: +INSERT INTO tbl04 VALUES (14, 75, 316, 'example', NULL, '1999-10-01 10:10:00'); +--Testcase 128: +INSERT INTO tbl04 VALUES (15, 6867.34, 8916, NULL, false, '2010-10-01 10:10:00'); +-- Logical operator +--Testcase 129: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; +--Testcase 130: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c2 > 0 AND NOT c4; + +--Testcase 131: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; +--Testcase 132: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 OR c4; + +--Testcase 133: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; +--Testcase 134: +SELECT id, c1, c2 FROM tbl04 WHERE c1 >= 0 AND c4; + +--Testcase 135: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; +--Testcase 136: +SELECT id, c1, c2 FROM tbl04 WHERE NOT c4; + +-- Comparison operator +--Testcase 137: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; +--Testcase 138: +SELECT id, c1, c2 FROM tbl04 WHERE id > 1; + +--Testcase 139: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; +--Testcase 140: +SELECT id, c1, c2 FROM tbl04 WHERE id >= 1; + +--Testcase 141: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; +--Testcase 142: +SELECT id, c1, c2 FROM tbl04 WHERE id < 2; + +--Testcase 143: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; +--Testcase 144: +SELECT id, c1, c2 FROM tbl04 WHERE id <= 2; + +--Testcase 145: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; +--Testcase 146: +SELECT id, c1, c2 FROM tbl04 WHERE id = 2; + +--Testcase 147: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; +--Testcase 148: +SELECT id, c1, c2 FROM tbl04 WHERE id <> 2; + +--Testcase 149: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; +--Testcase 150: +SELECT id, c1, c2 FROM tbl04 WHERE id != 2; + +--Testcase 151: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; +--Testcase 152: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN 1 AND 5; + +--Testcase 153: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; +--Testcase 154: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN c1 AND c2; + +--Testcase 155: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; +--Testcase 156: +SELECT id, c1, c2 FROM tbl04 WHERE id NOT BETWEEN SYMMETRIC 1 AND 5; + +--Testcase 157: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; +--Testcase 158: +SELECT id, c1, c2 FROM tbl04 WHERE id BETWEEN SYMMETRIC c1 AND c2; + +--Testcase 159: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down +--Testcase 160: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM 2; -- does not push down + +--Testcase 161: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down +--Testcase 162: +SELECT id, c1, c2 FROM tbl04 WHERE c1 IS DISTINCT FROM id; -- does not push down + +--Testcase 163: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; +--Testcase 164: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NULL; + +--Testcase 165: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; +--Testcase 166: +SELECT id, c1, c2 FROM tbl04 WHERE c3 IS NOT NULL; + +--Testcase 167: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; +--Testcase 168: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS TRUE; + +--Testcase 169: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; +--Testcase 170: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS FALSE; + +--Testcase 171: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; +--Testcase 172: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT TRUE; + +--Testcase 173: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; +--Testcase 174: +SELECT id, c1, c2 FROM tbl04 WHERE c4 IS NOT FALSE; + +--Testcase 175: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down +--Testcase 176: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS UNKNOWN; -- does not push down + +--Testcase 177: +EXPLAIN VERBOSE +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down +--Testcase 178: +SELECT id, c1, c4 FROM tbl04 WHERE c4 IS NOT UNKNOWN; -- does not push down +-- Mathematical operator +--Testcase 179: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE id * 100 + 100 > c2; +--Testcase 180: +SELECT id, c1, c2 FROM tbl04 WHERE c1 * 100 + 100 > c2; + +--Testcase 181: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; +--Testcase 182: +SELECT id, c1, c2 FROM tbl04 WHERE c2 - c1 < 0; + +--Testcase 183: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down +--Testcase 184: +SELECT id, c1, c2 FROM tbl04 WHERE c2 / 100 > 0; -- does not push down + +--Testcase 185: +EXPLAIN VERBOSE +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down +--Testcase 186: +SELECT id, c1, c2 FROM tbl04 WHERE c2 % 2 = 1; -- does not push down + +--Testcase 187: +EXPLAIN VERBOSE +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down +--Testcase 188: +SELECT id, id ^ 2 FROM tbl04 WHERE id ^ 2 > 4; -- does not push down + +--Testcase 189: +EXPLAIN VERBOSE +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down +--Testcase 190: +SELECT id, |/id FROM tbl04 WHERE |/id < 4; -- does not push down + +--Testcase 191: +EXPLAIN VERBOSE +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down +--Testcase 192: +SELECT id, ||/id FROM tbl04 WHERE ||/id < 4; -- does not push down + +--Testcase 193: +EXPLAIN VERBOSE +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down +--Testcase 194: +SELECT id, @c2 FROM tbl04 WHERE @c2 < 1000; -- does not push down + +--Testcase 195: +EXPLAIN VERBOSE +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down +--Testcase 196: +SELECT id, id & 123 FROM tbl04 WHERE id & 123 < 4; -- does not push down + +--Testcase 197: +EXPLAIN VERBOSE +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down +--Testcase 198: +SELECT id, 123 | c2 FROM tbl04 WHERE 123 | c2 > 4; -- does not push down + +--Testcase 199: +EXPLAIN VERBOSE +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down +--Testcase 200: +SELECT id, id # 324 FROM tbl04 WHERE id # 324 > 4; -- does not push down + +--Testcase 201: +EXPLAIN VERBOSE +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down +--Testcase 202: +SELECT id, ~id FROM tbl04 WHERE ~id < -2; -- does not push down + +--Testcase 203: +EXPLAIN VERBOSE +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down +--Testcase 204: +SELECT id, id << 2 FROM tbl04 WHERE id << 2 < 10; -- does not push down + +--Testcase 205: +EXPLAIN VERBOSE +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down +--Testcase 206: +SELECT id, id >> 2 FROM tbl04 WHERE id >> 2 = 0; -- does not push down + +-- String operator +--Testcase 207: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down +--Testcase 208: +SELECT c3 FROM tbl04 WHERE c3 IS NFC NORMALIZED; -- does not push down + +--Testcase 209: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down +--Testcase 210: +SELECT c3 FROM tbl04 WHERE c3 IS NOT NFKC NORMALIZED; -- does not push down + +-- Pattern matching operator +--Testcase 211: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; +--Testcase 212: +SELECT c3 FROM tbl04 WHERE c3 LIKE '%hi%'; + +--Testcase 213: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; +--Testcase 214: +SELECT c3 FROM tbl04 WHERE c3 NOT LIKE '%hi%'; + +--Testcase 215: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down +--Testcase 216: +SELECT c3 FROM tbl04 WHERE c3 ILIKE '%Hi%'; -- does not push down + +--Testcase 217: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down +--Testcase 218: +SELECT c3 FROM tbl04 WHERE c3 NOT ILIKE '%Hi%'; -- does not push down + +--Testcase 219: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down +--Testcase 220: +SELECT c3 FROM tbl04 WHERE c3 SIMILAR TO '%(y|w)%'; -- does not push down + +--Testcase 221: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down +--Testcase 222: +SELECT c3 FROM tbl04 WHERE c3 NOT SIMILAR TO '%(y|w)%'; -- does not push down + +--Testcase 223: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down +--Testcase 224: +SELECT c3 FROM tbl04 WHERE c3 ~ 'any.*'; -- does not push down + +--Testcase 225: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down +--Testcase 226: +SELECT c3 FROM tbl04 WHERE c3 ~* 'ANY.*'; -- does not push down + + +--Testcase 227: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down +--Testcase 228: +SELECT c3 FROM tbl04 WHERE c3 !~ 'any.*'; -- does not push down + +--Testcase 229: +EXPLAIN VERBOSE +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down +--Testcase 230: +SELECT c3 FROM tbl04 WHERE c3 !~* 'ANY.*'; -- does not push down + +-- test for specific type +--Testcase 231: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE inet; +--Testcase 232: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 + 1 > inet '192.168.1.100'; -- does not push down + +--Testcase 233: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE json; +--Testcase 234: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + +--Testcase 235: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE jsonb; +--Testcase 236: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3->>'tag' = 'test data'; -- does not push down + +--Testcase 237: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE point; +--Testcase 238: +EXPLAIN VERBOSE +SELECT id FROM tbl04 WHERE c3 >> point '(1, 3)'; -- does not push down +-- reset c3 column type +--Testcase 239: +ALTER TABLE tbl04 ALTER COLUMN c3 TYPE text; + +-- Reset data for tbl04; +--Testcase 240: +DELETE FROM tbl04 WHERE id > 10; --Testcase 70: DROP SERVER :DB_SERVERNAME CASCADE; diff --git a/sql/14.0/postgresql/function_pushdown.sql b/sql/14.0/postgresql/function_pushdown.sql new file mode 100644 index 0000000..f289d52 --- /dev/null +++ b/sql/14.0/postgresql/function_pushdown.sql @@ -0,0 +1,7 @@ +-- +-- postgreSql +-- +\set ECHO none +\ir sql/configs/postgreSql_parameters.conf +\set ECHO all +\i sql/14.0/function_pushdown.sql diff --git a/test.sh b/test.sh index 2ecef3b..da4afb4 100755 --- a/test.sh +++ b/test.sh @@ -9,19 +9,19 @@ if [[ "--post" == $1 ]] then ./init/postgresql_init.sh --start - sed -i 's/REGRESS =.*/REGRESS = postgresql\/new_test postgresql\/char postgresql\/date postgresql\/delete postgresql\/float4 postgresql\/float8 postgresql\/insert postgresql\/int4 postgresql\/int8 postgresql\/select postgresql\/timestamp postgresql\/update postgresql\/ported_postgres_fdw /' Makefile + sed -i 's/REGRESS =.*/REGRESS = postgresql\/function_pushdown postgresql\/new_test postgresql\/char postgresql\/date postgresql\/delete postgresql\/float4 postgresql\/float8 postgresql\/insert postgresql\/int4 postgresql\/int8 postgresql\/select postgresql\/timestamp postgresql\/update postgresql\/ported_postgres_fdw /' Makefile elif [[ "--mysql" == $1 ]] then ./init/mysql_init.sh --start - sed -i 's/REGRESS =.*/REGRESS = mysql\/new_test mysql\/char mysql\/date mysql\/delete mysql\/float4 mysql\/float8 mysql\/insert mysql\/int4 mysql\/int8 mysql\/select mysql\/timestamp mysql\/update mysql\/ported_postgres_fdw /' Makefile + sed -i 's/REGRESS =.*/REGRESS = mysql\/function_pushdown mysql\/new_test mysql\/char mysql\/date mysql\/delete mysql\/float4 mysql\/float8 mysql\/insert mysql\/int4 mysql\/int8 mysql\/select mysql\/timestamp mysql\/update mysql\/ported_postgres_fdw /' Makefile elif [[ "--all" == $1 ]] then ./init/mysql_init.sh --start ./init/postgresql_init.sh --start - sed -i 's/REGRESS =.*/REGRESS = postgresql\/new_test postgresql\/char postgresql\/date postgresql\/delete postgresql\/float4 postgresql\/float8 postgresql\/insert postgresql\/int4 postgresql\/int8 postgresql\/select postgresql\/timestamp postgresql\/update postgresql\/ported_postgres_fdw mysql\/new_test mysql\/char mysql\/date mysql\/delete mysql\/float4 mysql\/float8 mysql\/insert mysql\/int4 mysql\/int8 mysql\/select mysql\/timestamp mysql\/update mysql\/ported_postgres_fdw /' Makefile + sed -i 's/REGRESS =.*/REGRESS = postgresql\/function_pushdown postgresql\/new_test postgresql\/char postgresql\/date postgresql\/delete postgresql\/float4 postgresql\/float8 postgresql\/insert postgresql\/int4 postgresql\/int8 postgresql\/select postgresql\/timestamp postgresql\/update postgresql\/ported_postgres_fdw mysql\/function_pushdown mysql\/new_test mysql\/char mysql\/date mysql\/delete mysql\/float4 mysql\/float8 mysql\/insert mysql\/int4 mysql\/int8 mysql\/select mysql\/timestamp mysql\/update mysql\/ported_postgres_fdw /' Makefile fi