|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/htup_details.h"#include "access/sysattr.h"#include "access/table.h"#include "catalog/pg_aggregate.h"#include "catalog/pg_authid.h"#include "catalog/pg_collation.h"#include "catalog/pg_database.h"#include "catalog/pg_namespace.h"#include "catalog/pg_operator.h"#include "catalog/pg_opfamily.h"#include "catalog/pg_proc.h"#include "catalog/pg_ts_config.h"#include "catalog/pg_ts_dict.h"#include "catalog/pg_type.h"#include "commands/defrem.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 "postgres_fdw.h"#include "utils/builtins.h"#include "utils/lsyscache.h"#include "utils/rel.h"#include "utils/syscache.h"#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
| struct | foreign_glob_cxt |
| struct | foreign_loc_cxt |
| struct | deparse_expr_cxt |
Macros | |
| #define | REL_ALIAS_PREFIX "r" |
| #define | ADD_REL_QUALIFIER(buf, varno) appendStringInfo((buf), "%s%d.", REL_ALIAS_PREFIX, (varno)) |
| #define | SUBQUERY_REL_ALIAS_PREFIX "s" |
| #define | SUBQUERY_COL_ALIAS_PREFIX "c" |
Typedefs | |
| typedef struct foreign_glob_cxt | foreign_glob_cxt |
| typedef struct foreign_loc_cxt | foreign_loc_cxt |
| typedef struct deparse_expr_cxt | deparse_expr_cxt |
Enumerations | |
| enum | FDWCollateState { FDW_COLLATE_NONE , FDW_COLLATE_SAFE , FDW_COLLATE_UNSAFE } |
| #define ADD_REL_QUALIFIER | ( | buf, | |
| varno | |||
| ) | appendStringInfo((buf), "%s%d.", REL_ALIAS_PREFIX, (varno)) |
| Enumerator | |
|---|---|
| FDW_COLLATE_NONE | |
| FDW_COLLATE_SAFE | |
| FDW_COLLATE_UNSAFE | |
Definition at line 79 of file deparse.c.
|
static |
Definition at line 3821 of file deparse.c.
References appendOrderBySuffix(), appendStringInfoString(), deparse_expr_cxt::buf, buf, deparseSortGroupClause(), exprType(), fb(), and lfirst.
Referenced by deparseAggref().
|
static |
Definition at line 1622 of file deparse.c.
References appendStringInfoChar(), appendStringInfoString(), deparse_expr_cxt::buf, buf, deparseExpr(), fb(), IsA, lfirst, reset_transmission_modes(), and set_transmission_modes().
Referenced by appendWhereClause(), deparseFromExprForRel(), and deparseSelectStmtForRel().
|
static |
Definition at line 4104 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), deparse_expr_cxt::buf, buf, elog, ERROR, fb(), Form_pg_proc, get_namespace_name(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), proname, quote_identifier(), ReleaseSysCache(), and SearchSysCache1().
Referenced by deparseAggref(), and deparseFuncExpr().
|
static |
Definition at line 3934 of file deparse.c.
References appendStringInfoString(), Assert, deparse_expr_cxt::buf, buf, deparseSortGroupClause(), fb(), Query::groupClause, Query::groupingSets, lfirst, PlannerInfo::parse, and deparse_expr_cxt::root.
Referenced by deparseSelectStmtForRel().
|
static |
Definition at line 4076 of file deparse.c.
References appendStringInfoString(), deparse_expr_cxt::buf, buf, deparseExpr(), fb(), reset_transmission_modes(), deparse_expr_cxt::root, root, and set_transmission_modes().
Referenced by deparseSelectStmtForRel().
|
static |
Definition at line 3982 of file deparse.c.
References appendOrderBySuffix(), appendStringInfoString(), deparse_expr_cxt::buf, buf, deparseExpr(), elog, ERROR, exprType(), fb(), find_em_for_rel(), find_em_for_rel_target(), deparse_expr_cxt::foreignrel, get_opfamily_member_for_cmptype(), IsA, lfirst, OidIsValid, oprid(), reset_transmission_modes(), deparse_expr_cxt::root, deparse_expr_cxt::scanrel, and set_transmission_modes().
Referenced by deparseSelectStmtForRel().
|
static |
Definition at line 3850 of file deparse.c.
References appendStringInfoString(), deparse_expr_cxt::buf, buf, deparseOperatorName(), elog, ERROR, fb(), Form_pg_operator, GETSTRUCT(), TypeCacheEntry::gt_opr, HeapTupleIsValid, lookup_type_cache(), TypeCacheEntry::lt_opr, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache1(), TYPECACHE_GT_OPR, and TYPECACHE_LT_OPR.
Referenced by appendAggOrderBy(), and appendOrderByClause().
|
static |
Definition at line 1659 of file deparse.c.
References appendConditions(), appendStringInfoString(), deparse_expr_cxt::buf, buf, fb(), lfirst, and NIL.
Referenced by deparseDirectDeleteSql(), deparseDirectUpdateSql(), deparseFromExpr(), and deparseFromExprForRel().
| List * build_tlist_to_deparse | ( | RelOptInfo * | foreignrel | ) |
Definition at line 1229 of file deparse.c.
References add_to_flat_tlist(), RestrictInfo::clause, PathTarget::exprs, fb(), IS_UPPER_REL, lfirst_node, NIL, pull_var_clause(), PVC_RECURSE_PLACEHOLDERS, and RelOptInfo::reltarget.
Referenced by estimate_path_cost_size(), and postgresGetForeignPlan().
| void classifyConditions | ( | PlannerInfo * | root, |
| RelOptInfo * | baserel, | ||
| List * | input_conds, | ||
| List ** | remote_conds, | ||
| List ** | local_conds | ||
| ) |
Definition at line 218 of file deparse.c.
References fb(), is_foreign_expr(), lappend(), lfirst_node, NIL, and root.
Referenced by estimate_path_cost_size(), and postgresGetForeignRelSize().
Definition at line 1210 of file deparse.c.
References fb(), format_type_extended(), FORMAT_TYPE_FORCE_QUALIFY, FORMAT_TYPE_TYPEMOD_GIVEN, and is_builtin().
Referenced by deparseArrayCoerceExpr(), deparseArrayExpr(), deparseConst(), deparseFuncExpr(), deparseRelabelType(), printRemoteParam(), and printRemotePlaceholder().
|
static |
Definition at line 3729 of file deparse.c.
References Aggref::aggdirectargs, Aggref::aggdistinct, Aggref::aggfilter, Aggref::aggfnoid, Aggref::aggorder, AGGSPLIT_SIMPLE, appendAggOrderBy(), appendFunctionName(), appendStringInfoChar(), appendStringInfoString(), arg, Aggref::args, Assert, deparse_expr_cxt::buf, buf, deparseExpr(), fb(), lfirst, lnext(), and NIL.
Referenced by deparseExpr().
| void deparseAnalyzeInfoSql | ( | StringInfo | buf, |
| Relation | rel | ||
| ) |
Definition at line 2572 of file deparse.c.
References appendStringInfoString(), buf, nameData::data, deparseRelation(), deparseStringLiteral(), initStringInfo(), and relname.
Referenced by fetch_relstats(), and postgresGetAnalyzeInfoForForeignTable().
| void deparseAnalyzeSizeSql | ( | StringInfo | buf, |
| Relation | rel | ||
| ) |
Definition at line 2550 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), buf, nameData::data, deparseRelation(), deparseStringLiteral(), fb(), initStringInfo(), and relname.
Referenced by postgresAnalyzeForeignTable().
| void deparseAnalyzeSql | ( | StringInfo | buf, |
| Relation | rel, | ||
| PgFdwSamplingMethod | sample_method, | ||
| double | sample_frac, | ||
| List ** | retrieved_attrs | ||
| ) |
Definition at line 2612 of file deparse.c.
References ANALYZE_SAMPLE_AUTO, ANALYZE_SAMPLE_BERNOULLI, ANALYZE_SAMPLE_OFF, ANALYZE_SAMPLE_RANDOM, ANALYZE_SAMPLE_SYSTEM, appendStringInfo(), appendStringInfoString(), attname, buf, defGetString(), DefElem::defname, deparseRelation(), elog, ERROR, fb(), GetForeignColumnOptions(), i, lappend_int(), lfirst, NameStr, TupleDescData::natts, NIL, quote_identifier(), RelationGetDescr, RelationGetRelid, and TupleDescAttr().
Referenced by postgresAcquireSampleRowsFunc().
|
static |
Definition at line 3564 of file deparse.c.
References appendStringInfo(), ArrayCoerceExpr::arg, deparse_expr_cxt::buf, COERCE_IMPLICIT_CAST, deparse_type_name(), deparseExpr(), and ArrayCoerceExpr::resulttype.
Referenced by deparseExpr().
|
static |
Definition at line 3703 of file deparse.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), deparse_expr_cxt::buf, buf, deparse_type_name(), deparseExpr(), fb(), lfirst, and NIL.
Referenced by deparseExpr().
|
static |
Definition at line 3582 of file deparse.c.
References AND_EXPR, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), BoolExpr::args, BoolExpr::boolop, deparse_expr_cxt::buf, buf, deparseExpr(), fb(), lfirst, linitial, NOT_EXPR, and OR_EXPR.
Referenced by deparseExpr().
|
static |
Definition at line 3653 of file deparse.c.
References appendStringInfoChar(), appendStringInfoString(), CaseExpr::arg, CaseExpr::args, deparse_expr_cxt::buf, buf, castNode, CaseExpr::defresult, deparseExpr(), CaseWhen::expr, fb(), lfirst, lsecond, and CaseWhen::result.
Referenced by deparseExpr().
|
static |
Definition at line 2732 of file deparse.c.
References ADD_REL_QUALIFIER, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert, bms_add_member(), bms_free(), buf, defGetString(), DefElem::defname, deparseTargetList(), fb(), FirstLowInvalidHeapAttributeNumber, get_attname(), GetForeignColumnOptions(), IS_SPECIAL_VARNO, lfirst, NoLock, quote_identifier(), SelfItemPointerAttributeNumber, table_close(), table_open(), and TableOidAttributeNumber.
Referenced by deparseDirectUpdateSql(), deparseInsertSql(), deparseTargetList(), deparseUpdateSql(), and deparseVar().
|
static |
Definition at line 3074 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), deparse_expr_cxt::buf, buf, Const::consttype, deparse_type_name(), deparseStringLiteral(), fb(), getTypeOutputInfo(), OidOutputFunctionCall(), and pfree().
Referenced by deparseExpr(), deparseOpExpr(), and deparseSortGroupClause().
| void deparseDeleteSql | ( | StringInfo | buf, |
| RangeTblEntry * | rte, | ||
| Index | rtindex, | ||
| Relation | rel, | ||
| List * | returningList, | ||
| List ** | retrieved_attrs | ||
| ) |
Definition at line 2413 of file deparse.c.
References appendStringInfoString(), buf, deparseRelation(), deparseReturningList(), fb(), NIL, TriggerDesc::trig_delete_after_row, and RelationData::trigdesc.
Referenced by postgresPlanForeignModify().
| void deparseDirectDeleteSql | ( | StringInfo | buf, |
| PlannerInfo * | root, | ||
| Index | rtindex, | ||
| Relation | rel, | ||
| RelOptInfo * | foreignrel, | ||
| List * | remote_conds, | ||
| List ** | params_list, | ||
| List * | returningList, | ||
| List ** | retrieved_attrs | ||
| ) |
Definition at line 2442 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), appendWhereClause(), deparse_expr_cxt::buf, buf, deparseExplicitTargetList(), deparseFromExprForRel(), deparseRelation(), deparseReturningList(), fb(), deparse_expr_cxt::foreignrel, list_concat(), list_free_deep(), NIL, deparse_expr_cxt::params_list, planner_rt_fetch, REL_ALIAS_PREFIX, RELOPT_JOINREL, RelOptInfo::reloptkind, deparse_expr_cxt::root, root, and deparse_expr_cxt::scanrel.
Referenced by postgresPlanDirectModify().
| void deparseDirectUpdateSql | ( | StringInfo | buf, |
| PlannerInfo * | root, | ||
| Index | rtindex, | ||
| Relation | rel, | ||
| RelOptInfo * | foreignrel, | ||
| List * | targetlist, | ||
| List * | targetAttrs, | ||
| List * | remote_conds, | ||
| List ** | params_list, | ||
| List * | returningList, | ||
| List ** | retrieved_attrs | ||
| ) |
Definition at line 2327 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), appendWhereClause(), Assert, attnum, deparse_expr_cxt::buf, buf, deparseColumnRef(), deparseExplicitTargetList(), deparseExpr(), deparseFromExprForRel(), deparseRelation(), deparseReturningList(), fb(), forboth, deparse_expr_cxt::foreignrel, lfirst_int, lfirst_node, list_concat(), list_free_deep(), NIL, deparse_expr_cxt::params_list, planner_rt_fetch, REL_ALIAS_PREFIX, RELOPT_JOINREL, RelOptInfo::reloptkind, reset_transmission_modes(), deparse_expr_cxt::root, root, deparse_expr_cxt::scanrel, and set_transmission_modes().
Referenced by postgresPlanDirectModify().
|
static |
Definition at line 3488 of file deparse.c.
References appendStringInfoChar(), appendStringInfoString(), OpExpr::args, Assert, deparse_expr_cxt::buf, buf, deparseExpr(), linitial, list_length(), and lsecond.
Referenced by deparseExpr().
|
static |
Definition at line 1732 of file deparse.c.
References appendStringInfoString(), deparse_expr_cxt::buf, buf, deparseExpr(), fb(), i, lappend_int(), lfirst_node, and NIL.
Referenced by deparseDirectDeleteSql(), deparseDirectUpdateSql(), and deparseSelectSql().
|
static |
Definition at line 2935 of file deparse.c.
References deparseAggref(), deparseArrayCoerceExpr(), deparseArrayExpr(), deparseBoolExpr(), deparseCaseExpr(), deparseConst(), deparseDistinctExpr(), deparseFuncExpr(), deparseNullTest(), deparseOpExpr(), deparseParam(), deparseRelabelType(), deparseScalarArrayOpExpr(), deparseSubscriptingRef(), deparseVar(), elog, ERROR, fb(), and nodeTag.
Referenced by appendConditions(), appendLimitClause(), appendOrderByClause(), deparseAggref(), deparseArrayCoerceExpr(), deparseArrayExpr(), deparseBoolExpr(), deparseCaseExpr(), deparseDirectUpdateSql(), deparseDistinctExpr(), deparseExplicitTargetList(), deparseFuncExpr(), deparseNullTest(), deparseOpExpr(), deparseRelabelType(), deparseScalarArrayOpExpr(), deparseSortGroupClause(), deparseSubqueryTargetList(), and deparseSubscriptingRef().
|
static |
Definition at line 1426 of file deparse.c.
References appendStringInfoString(), appendWhereClause(), Assert, bms_membership(), BMS_MULTIPLE, deparse_expr_cxt::buf, buf, deparseFromExprForRel(), fb(), deparse_expr_cxt::foreignrel, IS_JOIN_REL, IS_SIMPLE_REL, IS_UPPER_REL, list_free_deep(), NIL, deparse_expr_cxt::params_list, RelOptInfo::relids, deparse_expr_cxt::root, and deparse_expr_cxt::scanrel.
Referenced by deparseSelectStmtForRel().
|
static |
Definition at line 1812 of file deparse.c.
References appendBinaryStringInfo(), appendConditions(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), appendWhereClause(), Assert, bms_is_member(), deparse_expr_cxt::buf, buf, deparseRangeTblRef(), deparseRelation(), fb(), deparse_expr_cxt::foreignrel, get_jointype_name(), initStringInfo(), IS_JOIN_REL, JOIN_INNER, JOIN_SEMI, lappend(), list_concat(), list_free(), list_free_deep(), NIL, NoLock, deparse_expr_cxt::params_list, planner_rt_fetch, REL_ALIAS_PREFIX, RelOptInfo::relid, RelOptInfo::relids, deparse_expr_cxt::root, root, deparse_expr_cxt::scanrel, str, table_close(), and table_open().
Referenced by deparseDirectDeleteSql(), deparseDirectUpdateSql(), deparseFromExpr(), and deparseRangeTblRef().
|
static |
Definition at line 3267 of file deparse.c.
References appendFunctionName(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), arg, FuncExpr::args, deparse_expr_cxt::buf, buf, COERCE_EXPLICIT_CAST, COERCE_IMPLICIT_CAST, deparse_type_name(), deparseExpr(), exprIsLengthCoercion(), fb(), FuncExpr::funcid, lfirst, linitial, and lnext().
Referenced by deparseExpr().
| void deparseInsertSql | ( | StringInfo | buf, |
| RangeTblEntry * | rte, | ||
| Index | rtindex, | ||
| Relation | rel, | ||
| List * | targetAttrs, | ||
| bool | doNothing, | ||
| List * | withCheckOptionList, | ||
| List * | returningList, | ||
| List ** | retrieved_attrs, | ||
| int * | values_end_len | ||
| ) |
Definition at line 2134 of file deparse.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), CompactAttribute::attgenerated, attnum, buf, deparseColumnRef(), deparseRelation(), deparseReturningList(), fb(), lfirst_int, RelationGetDescr, TriggerDesc::trig_insert_after_row, RelationData::trigdesc, and TupleDescCompactAttr().
Referenced by postgresBeginForeignInsert(), and postgresPlanForeignModify().
|
static |
Definition at line 1532 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), bms_is_member(), bms_membership(), BMS_MULTIPLE, bms_next_member(), deparse_expr_cxt::buf, buf, CMD_DELETE, CMD_UPDATE, fb(), get_plan_rowmark(), IS_JOIN_REL, LCS_FORKEYSHARE, LCS_FORNOKEYUPDATE, LCS_FORSHARE, LCS_FORUPDATE, LCS_NONE, REL_ALIAS_PREFIX, RelOptInfo::relids, deparse_expr_cxt::root, root, deparse_expr_cxt::scanrel, and PlanRowMark::strength.
Referenced by deparseSelectStmtForRel().
|
static |
Definition at line 3620 of file deparse.c.
References appendStringInfoChar(), appendStringInfoString(), NullTest::arg, deparse_expr_cxt::buf, buf, deparseExpr(), exprType(), IS_NULL, NullTest::nulltesttype, and type_is_rowtype().
Referenced by deparseExpr().
|
static |
Definition at line 3460 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), buf, fb(), get_namespace_name(), NameStr, and quote_identifier().
Referenced by appendOrderBySuffix(), deparseOpExpr(), and deparseScalarArrayOpExpr().
|
static |
Definition at line 3330 of file deparse.c.
References appendStringInfoChar(), OpExpr::args, Assert, deparse_expr_cxt::buf, buf, deparseConst(), deparseExpr(), deparseOperatorName(), elog, ERROR, exprType(), fb(), Form_pg_operator, GETSTRUCT(), HeapTupleIsValid, IsA, isPlainForeignVar(), linitial, list_length(), llast, ObjectIdGetDatum(), OpExpr::opno, ReleaseSysCache(), and SearchSysCache1().
Referenced by deparseExpr().
|
static |
Definition at line 3188 of file deparse.c.
References equal(), fb(), lappend(), lfirst, deparse_expr_cxt::params_list, Param::paramtype, Param::paramtypmod, printRemoteParam(), and printRemotePlaceholder().
Referenced by deparseExpr().
|
static |
Definition at line 2059 of file deparse.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert, bms_is_member(), buf, deparseFromExprForRel(), deparseSelectStmtForRel(), PathTarget::exprs, fb(), i, IS_JOIN_REL, IS_SIMPLE_REL, list_length(), NIL, RelOptInfo::relids, RelOptInfo::reltarget, root, SUBQUERY_COL_ALIAS_PREFIX, and SUBQUERY_REL_ALIAS_PREFIX.
Referenced by deparseFromExprForRel().
|
static |
Definition at line 3551 of file deparse.c.
References appendStringInfo(), RelabelType::arg, deparse_expr_cxt::buf, COERCE_IMPLICIT_CAST, deparse_type_name(), deparseExpr(), and RelabelType::resulttype.
Referenced by deparseExpr().
|
static |
Definition at line 2860 of file deparse.c.
References appendStringInfo(), buf, defGetString(), DefElem::defname, fb(), get_namespace_name(), GetForeignTable(), lfirst, quote_identifier(), RelationGetNamespace, RelationGetRelationName, RelationGetRelid, relname, and table.
Referenced by deparseAnalyzeInfoSql(), deparseAnalyzeSizeSql(), deparseAnalyzeSql(), deparseDeleteSql(), deparseDirectDeleteSql(), deparseDirectUpdateSql(), deparseFromExprForRel(), deparseInsertSql(), deparseTruncateSql(), and deparseUpdateSql().
|
static |
Definition at line 2493 of file deparse.c.
References bms_make_singleton(), buf, deparseTargetList(), fb(), FirstLowInvalidHeapAttributeNumber, NIL, and pull_varattnos().
Referenced by deparseDeleteSql(), deparseDirectDeleteSql(), deparseDirectUpdateSql(), deparseInsertSql(), and deparseUpdateSql().
|
static |
Definition at line 3506 of file deparse.c.
References appendStringInfo(), appendStringInfoChar(), ScalarArrayOpExpr::args, Assert, deparse_expr_cxt::buf, buf, deparseExpr(), deparseOperatorName(), elog, ERROR, fb(), Form_pg_operator, GETSTRUCT(), HeapTupleIsValid, linitial, list_length(), lsecond, ObjectIdGetDatum(), ScalarArrayOpExpr::opno, ReleaseSysCache(), SearchSysCache1(), and ScalarArrayOpExpr::useOr.
Referenced by deparseExpr().
|
static |
Definition at line 1368 of file deparse.c.
References appendStringInfoString(), deparse_expr_cxt::buf, buf, deparseExplicitTargetList(), deparseSubqueryTargetList(), deparseTargetList(), fb(), deparse_expr_cxt::foreignrel, IS_JOIN_REL, IS_UPPER_REL, NoLock, planner_rt_fetch, RelOptInfo::relid, deparse_expr_cxt::root, root, table_close(), and table_open().
Referenced by deparseSelectStmtForRel().
| void deparseSelectStmtForRel | ( | 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, | ||
| List ** | params_list | ||
| ) |
Definition at line 1286 of file deparse.c.
References appendConditions(), appendGroupByClause(), appendLimitClause(), appendOrderByClause(), appendStringInfoString(), Assert, deparse_expr_cxt::buf, buf, deparseFromExpr(), deparseLockingClause(), deparseSelectSql(), fb(), deparse_expr_cxt::foreignrel, IS_JOIN_REL, IS_SIMPLE_REL, IS_UPPER_REL, PgFdwRelationInfo::outerrel, deparse_expr_cxt::params_list, deparse_expr_cxt::root, root, and deparse_expr_cxt::scanrel.
Referenced by deparseRangeTblRef(), estimate_path_cost_size(), and postgresGetForeignPlan().
|
static |
Definition at line 4139 of file deparse.c.
References appendStringInfo(), appendStringInfoChar(), Assert, deparse_expr_cxt::buf, buf, deparseConst(), deparseExpr(), fb(), get_sortgroupref_tle(), and IsA.
Referenced by appendAggOrderBy(), and appendGroupByClause().
| void deparseStringLiteral | ( | StringInfo | buf, |
| const char * | val | ||
| ) |
Definition at line 2900 of file deparse.c.
References appendStringInfoChar(), buf, ESCAPE_STRING_SYNTAX, fb(), SQL_STR_DOUBLE, and val.
Referenced by build_remattrmap(), deparseAnalyzeInfoSql(), deparseAnalyzeSizeSql(), deparseConst(), fetch_attstats(), and postgresImportForeignSchema().
|
static |
Definition at line 1768 of file deparse.c.
References appendStringInfoString(), Assert, deparse_expr_cxt::buf, buf, deparseExpr(), PathTarget::exprs, fb(), deparse_expr_cxt::foreignrel, IS_JOIN_REL, IS_SIMPLE_REL, lfirst, and RelOptInfo::reltarget.
Referenced by deparseSelectSql().
|
static |
Definition at line 3221 of file deparse.c.
References appendStringInfoChar(), deparse_expr_cxt::buf, buf, deparseExpr(), fb(), IsA, lfirst, list_head(), lnext(), SubscriptingRef::refexpr, SubscriptingRef::reflowerindexpr, and SubscriptingRef::refupperindexpr.
Referenced by deparseExpr().
|
static |
Definition at line 1458 of file deparse.c.
References ADD_REL_QUALIFIER, appendStringInfoString(), bms_is_member(), buf, deparseColumnRef(), fb(), FirstLowInvalidHeapAttributeNumber, i, lappend_int(), TupleDescData::natts, NIL, RelationGetDescr, SelfItemPointerAttributeNumber, and TupleDescCompactAttr().
Referenced by deparseColumnRef(), deparseReturningList(), and deparseSelectSql().
| void deparseTruncateSql | ( | StringInfo | buf, |
| List * | rels, | ||
| DropBehavior | behavior, | ||
| bool | restart_seqs | ||
| ) |
Definition at line 2697 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), buf, deparseRelation(), DROP_CASCADE, DROP_RESTRICT, lfirst, and list_head().
Referenced by postgresExecForeignTruncate().
| void deparseUpdateSql | ( | StringInfo | buf, |
| RangeTblEntry * | rte, | ||
| Index | rtindex, | ||
| Relation | rel, | ||
| List * | targetAttrs, | ||
| List * | withCheckOptionList, | ||
| List * | returningList, | ||
| List ** | retrieved_attrs | ||
| ) |
Definition at line 2267 of file deparse.c.
References appendStringInfo(), appendStringInfoString(), CompactAttribute::attgenerated, attnum, buf, deparseColumnRef(), deparseRelation(), deparseReturningList(), fb(), lfirst_int, RelationGetDescr, TriggerDesc::trig_update_after_row, RelationData::trigdesc, and TupleDescCompactAttr().
Referenced by postgresPlanForeignModify().
|
static |
Definition at line 3003 of file deparse.c.
References appendStringInfo(), bms_is_member(), bms_membership(), BMS_MULTIPLE, deparse_expr_cxt::buf, deparseColumnRef(), equal(), fb(), is_subquery_var(), lappend(), lfirst, deparse_expr_cxt::params_list, planner_rt_fetch, printRemoteParam(), printRemotePlaceholder(), RelOptInfo::relids, deparse_expr_cxt::root, deparse_expr_cxt::scanrel, SUBQUERY_COL_ALIAS_PREFIX, SUBQUERY_REL_ALIAS_PREFIX, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by deparseExpr().
|
static |
Definition at line 312 of file deparse.c.
References a, AGGSPLIT_SIMPLE, RelabelType::arg, b, bms_is_member(), foreign_loc_cxt::collation, DatumGetObjectId(), exprType(), fb(), FDW_COLLATE_NONE, FDW_COLLATE_SAFE, FDW_COLLATE_UNSAFE, fe(), FirstNormalObjectId, foreign_expr_walker(), get_sortgroupref_tle(), TypeCacheEntry::gt_opr, InvalidOid, is_shippable(), IS_UPPER_REL, IsA, lfirst, lfirst_node, linitial, list_length(), lookup_type_cache(), TypeCacheEntry::lt_opr, nodeTag, OidIsValid, PARAM_MULTIEXPR, Param::paramcollid, Param::paramkind, SelfItemPointerAttributeNumber, foreign_loc_cxt::state, strip_implicit_coercions(), TYPECACHE_GT_OPR, TYPECACHE_LT_OPR, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by foreign_expr_walker(), and is_foreign_expr().
Definition at line 1692 of file deparse.c.
References elog, ERROR, fb(), JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, and JOIN_SEMI.
Referenced by deparseFromExprForRel(), and foreign_join_ok().
|
static |
Definition at line 4246 of file deparse.c.
References elog, ERROR, PathTarget::exprs, fb(), i, IsA, lfirst, RelOptInfo::reltarget, Var::varattno, and Var::varno.
Referenced by is_subquery_var().
| bool is_foreign_expr | ( | PlannerInfo * | root, |
| RelOptInfo * | baserel, | ||
| Expr * | expr | ||
| ) |
Definition at line 244 of file deparse.c.
References contain_mutable_functions(), fb(), FDW_COLLATE_NONE, FDW_COLLATE_UNSAFE, foreign_expr_walker(), InvalidOid, IS_UPPER_REL, PgFdwRelationInfo::outerrel, RelOptInfo::relids, and root.
Referenced by add_foreign_final_paths(), classifyConditions(), find_em_for_rel(), find_em_for_rel_target(), foreign_grouping_ok(), foreign_join_ok(), postgresGetForeignPaths(), postgresGetForeignPlan(), and postgresPlanDirectModify().
| bool is_foreign_param | ( | PlannerInfo * | root, |
| RelOptInfo * | baserel, | ||
| Expr * | expr | ||
| ) |
Definition at line 1135 of file deparse.c.
References bms_is_member(), fb(), IS_UPPER_REL, nodeTag, Var::varlevelsup, and Var::varno.
Referenced by foreign_grouping_ok().
| bool is_foreign_pathkey | ( | PlannerInfo * | root, |
| RelOptInfo * | baserel, | ||
| PathKey * | pathkey | ||
| ) |
Definition at line 1176 of file deparse.c.
References fb(), find_em_for_rel(), is_shippable(), and root.
Referenced by get_useful_pathkeys_for_relation().
|
static |
Definition at line 4184 of file deparse.c.
References Assert, bms_is_member(), fb(), get_relation_column_alias_ids(), IS_JOIN_REL, IS_SIMPLE_REL, is_subquery_var(), RelOptInfo::relids, and Var::varno.
Referenced by deparseVar(), and is_subquery_var().
|
static |
Definition at line 3425 of file deparse.c.
References bms_is_member(), COERCE_IMPLICIT_CAST, fb(), IsA, RelOptInfo::relids, deparse_expr_cxt::scanrel, Var::varlevelsup, and Var::varno.
Referenced by deparseOpExpr().
|
static |
Definition at line 3895 of file deparse.c.
References appendStringInfo(), deparse_expr_cxt::buf, buf, deparse_type_name(), and fb().
Referenced by deparseParam(), and deparseVar().
|
static |
Definition at line 3921 of file deparse.c.
References appendStringInfo(), deparse_expr_cxt::buf, buf, deparse_type_name(), and fb().
Referenced by deparseParam(), and deparseVar().
| void rebuildInsertSql | ( | StringInfo | buf, |
| Relation | rel, | ||
| char * | orig_query, | ||
| List * | target_attrs, | ||
| int | values_end_len, | ||
| int | num_params, | ||
| int | num_rows | ||
| ) |
Definition at line 2207 of file deparse.c.
References appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert, CompactAttribute::attgenerated, attnum, buf, fb(), i, lfirst_int, RelationGetDescr, and TupleDescCompactAttr().
Referenced by execute_foreign_modify().