PostgreSQL Source Code git master
|
#include "postgres.h"
#include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
#include "access/amapi.h"
#include "access/htup_details.h"
#include "access/relation.h"
#include "access/table.h"
#include "catalog/pg_aggregate.h"
#include "catalog/pg_am.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_constraint.h"
#include "catalog/pg_depend.h"
#include "catalog/pg_language.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_partitioned_table.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_statistic_ext.h"
#include "catalog/pg_trigger.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "commands/tablespace.h"
#include "common/keywords.h"
#include "executor/spi.h"
#include "funcapi.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "nodes/pathnodes.h"
#include "optimizer/optimizer.h"
#include "parser/parse_agg.h"
#include "parser/parse_func.h"
#include "parser/parse_oper.h"
#include "parser/parse_relation.h"
#include "parser/parser.h"
#include "parser/parsetree.h"
#include "rewrite/rewriteHandler.h"
#include "rewrite/rewriteManip.h"
#include "rewrite/rewriteSupport.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/guc.h"
#include "utils/hsearch.h"
#include "utils/lsyscache.h"
#include "utils/partcache.h"
#include "utils/rel.h"
#include "utils/ruleutils.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
#include "utils/varlena.h"
#include "utils/xml.h"
Go to the source code of this file.
Data Structures | |
struct | deparse_context |
struct | deparse_namespace |
struct | deparse_columns |
struct | NameHashEntry |
Macros | |
#define | PRETTYINDENT_STD 8 |
#define | PRETTYINDENT_JOIN 4 |
#define | PRETTYINDENT_VAR 4 |
#define | PRETTYINDENT_LIMIT 40 /* wrap limit */ |
#define | PRETTYFLAG_PAREN 0x0001 |
#define | PRETTYFLAG_INDENT 0x0002 |
#define | PRETTYFLAG_SCHEMA 0x0004 |
#define | GET_PRETTY_FLAGS(pretty) |
#define | WRAP_COLUMN_DEFAULT 0 |
#define | PRETTY_PAREN(context) ((context)->prettyFlags & PRETTYFLAG_PAREN) |
#define | PRETTY_INDENT(context) ((context)->prettyFlags & PRETTYFLAG_INDENT) |
#define | PRETTY_SCHEMA(context) ((context)->prettyFlags & PRETTYFLAG_SCHEMA) |
#define | deparse_columns_fetch(rangetable_index, dpns) ((deparse_columns *) list_nth((dpns)->rtable_columns, (rangetable_index)-1)) |
#define | only_marker(rte) ((rte)->inh ? "" : "ONLY ") |
Typedefs | |
typedef void(* | rsv_callback) (Node *node, deparse_context *context, void *callback_arg) |
Variables | |
static SPIPlanPtr | plan_getrulebyoid = NULL |
static const char *const | query_getrulebyoid = "SELECT * FROM pg_catalog.pg_rewrite WHERE oid = $1" |
static SPIPlanPtr | plan_getviewrule = NULL |
static const char *const | query_getviewrule = "SELECT * FROM pg_catalog.pg_rewrite WHERE ev_class = $1 AND rulename = $2" |
bool | quote_all_identifiers = false |
#define deparse_columns_fetch | ( | rangetable_index, | |
dpns | |||
) | ((deparse_columns *) list_nth((dpns)->rtable_columns, (rangetable_index)-1)) |
Definition at line 312 of file ruleutils.c.
#define GET_PRETTY_FLAGS | ( | pretty | ) |
Definition at line 93 of file ruleutils.c.
#define only_marker | ( | rte | ) | ((rte)->inh ? "" : "ONLY ") |
Definition at line 550 of file ruleutils.c.
#define PRETTY_INDENT | ( | context | ) | ((context)->prettyFlags & PRETTYFLAG_INDENT) |
Definition at line 102 of file ruleutils.c.
#define PRETTY_PAREN | ( | context | ) | ((context)->prettyFlags & PRETTYFLAG_PAREN) |
Definition at line 101 of file ruleutils.c.
#define PRETTY_SCHEMA | ( | context | ) | ((context)->prettyFlags & PRETTYFLAG_SCHEMA) |
Definition at line 103 of file ruleutils.c.
#define PRETTYFLAG_INDENT 0x0002 |
Definition at line 89 of file ruleutils.c.
#define PRETTYFLAG_PAREN 0x0001 |
Definition at line 88 of file ruleutils.c.
#define PRETTYFLAG_SCHEMA 0x0004 |
Definition at line 90 of file ruleutils.c.
#define PRETTYINDENT_JOIN 4 |
Definition at line 82 of file ruleutils.c.
#define PRETTYINDENT_LIMIT 40 /* wrap limit */ |
Definition at line 85 of file ruleutils.c.
#define PRETTYINDENT_STD 8 |
Definition at line 81 of file ruleutils.c.
#define PRETTYINDENT_VAR 4 |
Definition at line 83 of file ruleutils.c.
#define WRAP_COLUMN_DEFAULT 0 |
Definition at line 98 of file ruleutils.c.
typedef void(* rsv_callback) (Node *node, deparse_context *context, void *callback_arg) |
Definition at line 325 of file ruleutils.c.
|
static |
Definition at line 13469 of file ruleutils.c.
References appendStringInfo(), buf, elog, ERROR, get_namespace_name_or_temp(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), quote_identifier(), ReleaseSysCache(), SearchSysCache1(), and typname.
Referenced by generate_operator_clause().
|
static |
Definition at line 5036 of file ruleutils.c.
References HASH_ENTER, hash_search(), name, and deparse_columns::names_hash.
Referenced by build_colinfo_names_hash(), set_join_column_names(), and set_relation_column_names().
|
static |
Definition at line 9072 of file ruleutils.c.
References appendStringInfoChar(), appendStringInfoSpaces(), appendStringInfoString(), deparse_context::buf, buf, deparse_context::indentLevel, Max, PRETTY_INDENT, PRETTYINDENT_LIMIT, PRETTYINDENT_STD, removeStringInfoSpaces(), and str.
Referenced by get_basic_select_query(), get_delete_query_def(), get_from_clause(), get_from_clause_item(), get_insert_query_def(), get_json_table(), get_json_table_columns(), get_json_table_nested_columns(), get_merge_query_def(), get_returning_clause(), get_rule_expr(), get_rule_windowclause(), get_select_query_def(), get_setop_query(), get_target_list(), get_update_query_def(), get_utility_query_def(), and get_with_clause().
|
static |
Definition at line 4978 of file ruleutils.c.
References add_to_names_hash(), deparse_columns::colnames, CurrentMemoryContext, HASHCTL::entrysize, HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_STRINGS, HASHCTL::hcxt, i, HASHCTL::keysize, lfirst, NAMEDATALEN, deparse_columns::names_hash, deparse_columns::new_colnames, deparse_columns::num_cols, deparse_columns::num_new_cols, and deparse_columns::parentUsing.
Referenced by set_join_column_names(), and set_relation_column_names().
|
static |
Definition at line 4848 of file ruleutils.c.
References deparse_columns::colnames, HASH_FIND, hash_search(), i, lfirst, deparse_columns::names_hash, deparse_columns::new_colnames, deparse_columns::num_cols, deparse_columns::num_new_cols, deparse_columns::parentUsing, and deparse_namespace::using_names.
Referenced by make_colname_unique().
|
static |
Definition at line 2621 of file ruleutils.c.
References appendStringInfo(), appendStringInfoString(), buf, DatumGetArrayTypeP, DatumGetInt16(), deconstruct_array_builtin(), get_attname(), j, and quote_identifier().
Referenced by pg_get_constraintdef_worker().
Definition at line 3708 of file ruleutils.c.
References AccessShareLock, deparse_namespace::appendrels, deparse_namespace::ctes, RangeTblEntry::inh, list_make1, makeAlias(), makeNode, NIL, palloc0(), RangeTblEntry::relid, deparse_namespace::rtable, RTE_RELATION, RangeTblEntry::rtekind, set_rtable_names(), set_simple_column_names(), and deparse_namespace::subplans.
Referenced by pg_get_constraintdef_worker(), pg_get_expr_worker(), pg_get_indexdef_worker(), pg_get_partconstrdef_string(), pg_get_partition_constraintdef(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), pg_get_statisticsobjdef_expressions(), transformPartitionBound(), and transformPartitionRangeBounds().
List * deparse_context_for_plan_tree | ( | PlannedStmt * | pstmt, |
List * | rtable_names | ||
) |
Definition at line 3753 of file ruleutils.c.
References PlannedStmt::appendRelations, deparse_namespace::appendrels, Assert(), AppendRelInfo::child_relid, deparse_namespace::ctes, lfirst_node, list_length(), list_make1, NIL, palloc0(), deparse_namespace::rtable, PlannedStmt::rtable, deparse_namespace::rtable_names, set_simple_column_names(), deparse_namespace::subplans, and PlannedStmt::subplans.
Referenced by ExplainPrintPlan().
Definition at line 3645 of file ruleutils.c.
References deparse_expression_pretty().
Referenced by AlterDomainDefault(), DefineDomain(), pg_get_function_arg_default(), pg_get_partconstrdef_string(), print_function_arguments(), show_expression(), show_grouping_set_keys(), show_memoize_info(), show_plan_tlist(), show_sort_group_keys(), show_tablesample(), show_window_keys(), transformPartitionBound(), and transformPartitionRangeBounds().
|
static |
Definition at line 3672 of file ruleutils.c.
References deparse_context::appendparents, deparse_context::buf, buf, deparse_context::colNamesVisible, get_rule_expr(), deparse_context::indentLevel, deparse_context::inGroupBy, initStringInfo(), deparse_context::namespaces, NIL, deparse_context::prettyFlags, deparse_context::resultDesc, deparse_context::targetList, deparse_context::varInOrderBy, deparse_context::varprefix, deparse_context::windowClause, WRAP_COLUMN_DEFAULT, and deparse_context::wrapColumn.
Referenced by deparse_expression(), pg_get_constraintdef_worker(), pg_get_expr_worker(), pg_get_indexdef_worker(), pg_get_partition_constraintdef(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), and pg_get_statisticsobjdef_expressions().
|
static |
Definition at line 5049 of file ruleutils.c.
References hash_destroy(), and deparse_columns::names_hash.
Referenced by set_join_column_names(), and set_relation_column_names().
|
static |
Definition at line 4962 of file ruleutils.c.
References deparse_columns::colnames, deparse_columns::num_cols, palloc0_array, and repalloc0_array.
Referenced by set_join_column_names(), set_relation_column_names(), and set_using_names().
|
static |
Definition at line 8559 of file ruleutils.c.
References deparse_namespace::ancestors, find_param_generator_initplan(), foreach_current_index, foreach_int, foreach_node, if(), IsA, lfirst, linitial, MULTIEXPR_SUBLINK, deparse_context::namespaces, PARAM_EXEC, Param::paramid, SubPlan::paramIds, Param::paramkind, deparse_namespace::plan, SubPlan::setParam, SubPlan::subLinkType, and Plan::targetlist.
Referenced by get_parameter().
|
static |
Definition at line 8656 of file ruleutils.c.
References foreach_current_index, foreach_int, foreach_node, Param::paramid, and plan.
Referenced by find_param_generator().
|
static |
Definition at line 8445 of file ruleutils.c.
References deparse_namespace::ancestors, arg, SubPlan::args, elog, ERROR, for_each_cell, forboth, innerPlan, IsA, lfirst, lfirst_int, linitial, lnext(), deparse_context::namespaces, NestLoop::nestParams, PARAM_EXEC, Param::paramid, Param::paramkind, NestLoopParam::paramno, NestLoopParam::paramval, SubPlan::parParam, and deparse_namespace::plan.
Referenced by get_name_for_var_field(), and get_parameter().
|
static |
Definition at line 5233 of file ruleutils.c.
References deparse_namespace::ancestors, elog, ERROR, IsA, lfirst, and WorkTableScan::wtParam.
Referenced by set_deparse_plan().
|
static |
Definition at line 13633 of file ruleutils.c.
References buf, elog, ERROR, get_reloptions(), HeapTupleIsValid, initStringInfo(), ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache1(), and SysCacheGetAttr().
Referenced by pg_get_constraintdef_worker(), and pg_get_indexdef_worker().
char * generate_collation_name | ( | Oid | collid | ) |
Definition at line 13533 of file ruleutils.c.
References CollationIsVisible(), collid, elog, ERROR, get_namespace_name_or_temp(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), quote_qualified_identifier(), ReleaseSysCache(), and SearchSysCache1().
Referenced by get_const_collation(), get_from_clause_coldeflist(), get_rule_expr(), pg_collation_for(), pg_get_indexdef_worker(), and pg_get_partkeydef_worker().
|
static |
Definition at line 13247 of file ruleutils.c.
References Assert(), elog, ERROR, func_get_detail(), FUNCDETAIL_AGGREGATE, FUNCDETAIL_NORMAL, FUNCDETAIL_NOTFOUND, FUNCDETAIL_WINDOWFUNC, get_namespace_name_or_temp(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, list_make1, makeString(), NameStr, NIL, ObjectIdGetDatum(), OidIsValid, proname, quote_qualified_identifier(), ReleaseSysCache(), and SearchSysCache1().
Referenced by get_agg_expr_helper(), get_func_expr(), get_tablesample_def(), get_windowfunc_expr_helper(), pg_get_functiondef(), and pg_get_triggerdef_worker().
char * generate_opclass_name | ( | Oid | opclass | ) |
Definition at line 12889 of file ruleutils.c.
References buf, get_opclass_name(), initStringInfo(), and InvalidOid.
Referenced by index_opclass_options().
void generate_operator_clause | ( | StringInfo | buf, |
const char * | leftop, | ||
Oid | leftoptype, | ||
Oid | opoid, | ||
const char * | rightop, | ||
Oid | rightoptype | ||
) |
Definition at line 13429 of file ruleutils.c.
References add_cast_to(), appendStringInfo(), appendStringInfoString(), Assert(), buf, elog, ERROR, get_namespace_name(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), quote_identifier(), ReleaseSysCache(), and SearchSysCache1().
Referenced by refresh_by_match_merge(), and ri_GenerateQual().
Definition at line 13352 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), buf, elog, ERROR, get_namespace_name_or_temp(), GETSTRUCT(), HeapTupleIsValid, initStringInfo(), left_oper(), list_make1, makeString(), NameStr, ObjectIdGetDatum(), oper(), oprid(), quote_identifier(), ReleaseSysCache(), and SearchSysCache1().
Referenced by get_oper_expr(), get_rule_expr(), get_rule_orderby(), get_simple_binary_op_name(), get_sublink_expr(), and pg_get_indexdef_worker().
|
static |
Definition at line 13203 of file ruleutils.c.
References elog, ERROR, get_namespace_name_or_temp(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), quote_qualified_identifier(), ReleaseSysCache(), relname, and SearchSysCache1().
Referenced by make_ruledef(), pg_get_constraintdef_worker(), pg_get_indexdef_worker(), pg_get_serial_sequence(), and pg_get_triggerdef_worker().
|
static |
Definition at line 13500 of file ruleutils.c.
References elog, ERROR, get_namespace_name_or_temp(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), quote_qualified_identifier(), ReleaseSysCache(), SearchSysCache1(), and typname.
Referenced by pg_get_constraintdef_worker().
Definition at line 13143 of file ruleutils.c.
References CommonTableExpr::ctename, deparse_namespace::ctes, elog, ERROR, get_namespace_name_or_temp(), GETSTRUCT(), HeapTupleIsValid, lfirst, NameStr, ObjectIdGetDatum(), quote_qualified_identifier(), RelationIsVisible(), ReleaseSysCache(), relname, and SearchSysCache1().
Referenced by get_delete_query_def(), get_from_clause_item(), get_insert_query_def(), get_merge_query_def(), get_rule_expr(), get_update_query_def(), make_ruledef(), pg_get_constraintdef_worker(), pg_get_indexdef_worker(), pg_get_statisticsobj_worker(), and pg_get_triggerdef_worker().
|
static |
Definition at line 10999 of file ruleutils.c.
References elog, ERROR, get_agg_expr(), and IsA.
Referenced by get_agg_expr_helper().
|
static |
Definition at line 10861 of file ruleutils.c.
References get_agg_expr_helper().
Referenced by get_agg_combine_expr(), and get_rule_expr().
|
static |
Definition at line 10873 of file ruleutils.c.
References Aggref::aggdirectargs, Aggref::aggdistinct, Aggref::aggfilter, Aggref::aggfnoid, Aggref::aggorder, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), arg, Aggref::args, Assert(), deparse_context::buf, buf, DO_AGGSPLIT_COMBINE, DO_AGGSPLIT_SKIPFINAL, TargetEntry::expr, FUNC_MAX_ARGS, funcname, generate_function_name(), get_agg_combine_expr(), get_aggregate_argtypes(), get_rule_expr(), get_rule_orderby(), i, deparse_context::inGroupBy, IsA, lfirst, linitial_node, list_length(), NIL, and resolve_special_varno().
Referenced by get_agg_expr(), and get_json_agg_constructor().
|
static |
Definition at line 6098 of file ruleutils.c.
References appendContextKeyword(), appendStringInfoChar(), appendStringInfoString(), deparse_context::buf, buf, Query::distinctClause, get_from_clause(), get_rule_expr(), get_rule_groupingset(), get_rule_sortgroupclause(), get_rule_windowclause(), get_simple_values_rte(), get_target_list(), get_values_def(), Query::groupClause, Query::groupDistinct, Query::groupingSets, Query::havingQual, deparse_context::indentLevel, deparse_context::inGroupBy, Query::jointree, lfirst, NIL, PRETTY_INDENT, PRETTYINDENT_STD, FromExpr::quals, deparse_context::resultDesc, Query::targetList, SortGroupClause::tleSortGroupRef, RangeTblEntry::values_lists, and Query::windowClause.
Referenced by get_select_query_def().
|
static |
Definition at line 11391 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), arg, deparse_context::buf, buf, format_type_with_typemod(), get_const_expr(), get_rule_expr_paren(), IsA, and PRETTY_PAREN.
Referenced by get_func_expr(), and get_rule_expr().
|
static |
Definition at line 12716 of file ruleutils.c.
References appendStringInfoChar(), appendStringInfoString(), deparse_context::buf, buf, i, deparse_columns::new_colnames, deparse_columns::num_new_cols, deparse_columns::printaliases, and quote_identifier().
Referenced by get_from_clause_item().
|
static |
Definition at line 11585 of file ruleutils.c.
References appendStringInfo(), deparse_context::buf, buf, Const::consttype, generate_collation_name(), get_typcollation(), and OidIsValid.
Referenced by get_const_expr().
|
static |
Definition at line 11455 of file ruleutils.c.
References appendStringInfo(), appendStringInfoString(), deparse_context::buf, buf, Const::consttype, format_type_with_typemod(), get_const_collation(), getTypeOutputInfo(), OidOutputFunctionCall(), pfree(), and simple_quote_literal().
Referenced by get_coercion_expr(), get_json_path_spec(), get_json_table(), get_json_table_nested_columns(), get_range_partbound_string(), get_rule_expr(), and get_rule_sortgroupclause().
|
static |
Definition at line 7345 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), Assert(), deparse_context::buf, buf, generate_relation_name(), get_from_clause(), get_returning_clause(), get_rte_alias(), get_rule_expr(), get_with_clause(), deparse_context::indentLevel, Query::jointree, NIL, only_marker, PRETTY_INDENT, PRETTYINDENT_STD, FromExpr::quals, RangeTblEntry::relid, Query::returningList, rt_fetch, Query::rtable, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by get_query_def().
|
static |
Definition at line 12260 of file ruleutils.c.
References appendBinaryStringInfo(), appendContextKeyword(), appendStringInfoString(), deparse_context::buf, buf, StringInfoData::data, FromExpr::fromlist, get_from_clause_item(), initStringInfo(), IsA, Query::jointree, StringInfoData::len, lfirst, pfree(), PRETTY_INDENT, PRETTYINDENT_STD, PRETTYINDENT_VAR, removeStringInfoSpaces(), rt_fetch, Query::rtable, and deparse_context::wrapColumn.
Referenced by get_basic_select_query(), get_delete_query_def(), get_merge_query_def(), and get_update_query_def().
|
static |
Definition at line 12756 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), attname, deparse_context::buf, buf, deparse_columns::colnames, forfour, format_type_with_typemod(), generate_collation_name(), get_typcollation(), i, lfirst, lfirst_int, lfirst_oid, OidIsValid, quote_identifier(), and strVal.
Referenced by get_from_clause_item().
|
static |
Definition at line 12354 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), generate_unaccent_rules::args, deparse_context::buf, buf, RangeTblEntry::ctename, deparse_columns_fetch, elog, ERROR, RangeTblFunction::funcexpr, RangeTblEntry::funcordinality, RangeTblEntry::functions, generate_relation_name(), get_column_alias_list(), get_from_clause_coldeflist(), get_from_clause_item(), get_query_def(), get_rtable_name(), get_rte_alias(), get_rule_expr(), get_rule_expr_funccall(), get_tablefunc(), get_tablesample_def(), get_values_def(), deparse_context::indentLevel, IsA, j, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, lfirst, linitial, list_concat(), list_length(), deparse_context::namespaces, NIL, nodeTag, only_marker, PRETTY_PAREN, deparse_context::prettyFlags, PRETTYINDENT_JOIN, PRETTYINDENT_STD, quote_identifier(), RangeTblEntry::relid, rt_fetch, Query::rtable, RTE_CTE, RTE_FUNCTION, RTE_RELATION, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, RangeTblEntry::subquery, RangeTblEntry::tablefunc, RangeTblEntry::tablesample, deparse_columns::usingNames, RangeTblEntry::values_lists, and deparse_context::wrapColumn.
Referenced by get_from_clause(), and get_from_clause_item().
|
static |
Definition at line 10765 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), arg, FuncExpr::args, deparse_context::buf, buf, COERCE_EXPLICIT_CAST, COERCE_IMPLICIT_CAST, COERCE_SQL_SYNTAX, ereport, errcode(), errmsg(), ERROR, exprIsLengthCoercion(), exprType(), FUNC_MAX_ARGS, FuncExpr::funcid, generate_function_name(), get_coercion_expr(), get_func_sql_syntax(), get_rule_expr(), get_rule_expr_paren(), deparse_context::inGroupBy, IsA, lappend(), lfirst, linitial, list_length(), lnext(), and NIL.
Referenced by get_rule_expr().
|
static |
Definition at line 11139 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), FuncExpr::args, Assert(), deparse_context::buf, buf, Const::consttype, FuncExpr::funcid, get_rule_expr(), get_rule_expr_paren(), IsA, lfourth, linitial, list_length(), lsecond, lthird, and TextDatumGetCString.
Referenced by get_func_expr().
|
static |
Definition at line 6929 of file ruleutils.c.
References OnConflictExpr::action, appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), OnConflictExpr::arbiterElems, OnConflictExpr::arbiterWhere, Assert(), deparse_context::buf, buf, OnConflictExpr::constraint, elog, ERROR, TargetEntry::expr, generate_relation_name(), get_attname(), get_constraint_name(), get_query_def(), get_returning_clause(), get_rte_alias(), get_rule_expr(), get_rule_list_toplevel(), get_update_query_targetlist_def(), get_values_def(), get_with_clause(), deparse_context::indentLevel, lappend(), lfirst, deparse_context::namespaces, NIL, OidIsValid, Query::onConflict, ONCONFLICT_NOTHING, OnConflictExpr::onConflictSet, OnConflictExpr::onConflictWhere, OVERRIDING_SYSTEM_VALUE, OVERRIDING_USER_VALUE, PRETTY_INDENT, deparse_context::prettyFlags, PRETTYINDENT_STD, processIndirection(), quote_identifier(), RangeTblEntry::relid, TargetEntry::resno, Query::returningList, rt_fetch, Query::rtable, RTE_RELATION, RTE_SUBQUERY, RTE_VALUES, RangeTblEntry::rtekind, RangeTblEntry::subquery, Query::targetList, RangeTblEntry::values_lists, deparse_context::varprefix, and deparse_context::wrapColumn.
Referenced by get_query_def().
|
static |
Definition at line 11758 of file ruleutils.c.
References elog, ERROR, JsonConstructorExpr::func, funcname, get_agg_expr_helper(), get_json_constructor_options(), get_windowfunc_expr_helper(), initStringInfo(), IsA, nodeTag, and options.
Referenced by get_json_constructor().
|
static |
Definition at line 9163 of file ruleutils.c.
References appendStringInfo(), appendStringInfoString(), JsonBehavior::btype, deparse_context::buf, elog, ERROR, JsonBehavior::expr, get_rule_expr(), JSON_BEHAVIOR_DEFAULT, and lengthof.
Referenced by get_json_expr_options(), and get_json_table().
|
static |
Definition at line 11662 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), JsonConstructorExpr::args, deparse_context::buf, buf, elog, ERROR, foreach_current_index, funcname, get_json_agg_constructor(), get_json_constructor_options(), get_rule_expr(), JSCTOR_JSON_ARRAY, JSCTOR_JSON_ARRAYAGG, JSCTOR_JSON_OBJECT, JSCTOR_JSON_OBJECTAGG, JSCTOR_JSON_PARSE, JSCTOR_JSON_SCALAR, JSCTOR_JSON_SERIALIZE, lfirst, and JsonConstructorExpr::type.
Referenced by get_rule_expr().
|
static |
Definition at line 11728 of file ruleutils.c.
References JsonConstructorExpr::absent_on_null, appendStringInfoString(), buf, get_json_returning(), JSCTOR_JSON_ARRAY, JSCTOR_JSON_ARRAYAGG, JSCTOR_JSON_OBJECT, JSCTOR_JSON_OBJECTAGG, JSCTOR_JSON_PARSE, JSCTOR_JSON_SCALAR, JsonConstructorExpr::returning, JsonConstructorExpr::type, and JsonConstructorExpr::unique.
Referenced by get_json_agg_constructor(), and get_json_constructor().
|
static |
Definition at line 9201 of file ruleutils.c.
References appendStringInfoString(), JsonBehavior::btype, deparse_context::buf, get_json_behavior(), JSON_QUERY_OP, JSW_CONDITIONAL, JSW_NONE, JSW_UNCONDITIONAL, JSW_UNSPEC, JsonExpr::omit_quotes, JsonExpr::on_empty, JsonExpr::on_error, JsonExpr::op, and JsonExpr::wrapper.
Referenced by get_json_table_columns(), and get_rule_expr().
|
static |
Definition at line 11617 of file ruleutils.c.
References appendStringInfo(), appendStringInfoString(), buf, encoding, format, JS_ENC_DEFAULT, JS_ENC_UTF16, JS_ENC_UTF32, JS_FORMAT_DEFAULT, and JS_FORMAT_JSONB.
Referenced by get_json_returning(), and get_rule_expr().
|
static |
Definition at line 11605 of file ruleutils.c.
References get_const_expr(), get_rule_expr(), and IsA.
Referenced by get_json_table_columns(), and get_rule_expr().
|
static |
Definition at line 11642 of file ruleutils.c.
References appendStringInfo(), buf, JsonReturning::format, JsonFormat::format_type, format_type_with_typemod(), get_json_format(), JS_FORMAT_JSON, JS_FORMAT_JSONB, OidIsValid, JsonReturning::typid, and JsonReturning::typmod.
Referenced by get_json_constructor_options(), and get_rule_expr().
|
static |
Definition at line 12172 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), JsonBehavior::btype, deparse_context::buf, buf, castNode, TableFunc::docexpr, forboth, JsonExpr::formatted_expr, get_const_expr(), get_json_behavior(), get_json_table_columns(), get_rule_expr(), deparse_context::indentLevel, JSON_BEHAVIOR_EMPTY_ARRAY, lfirst, lfirst_node, JsonExpr::on_error, JsonExpr::passing_names, JsonExpr::passing_values, PRETTY_INDENT, PRETTYINDENT_VAR, quote_identifier(), and root.
Referenced by get_tablefunc().
|
static |
Definition at line 12066 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), deparse_context::buf, buf, castNode, JsonTablePathScan::child, JsonTablePathScan::colMax, JsonTablePathScan::colMin, forfour, JsonExpr::format, JsonFormat::format_type, format_type_with_typemod(), get_json_expr_options(), get_json_path_spec(), get_json_table_nested_columns(), get_type_category_preferred(), deparse_context::indentLevel, JS_FORMAT_JSONB, JSON_BEHAVIOR_FALSE, JSON_BEHAVIOR_NULL, JSON_EXISTS_OP, JSON_QUERY_OP, lfirst, lfirst_int, lfirst_oid, JsonExpr::op, JsonExpr::path_spec, PRETTY_INDENT, PRETTYINDENT_VAR, quote_identifier(), and strVal.
Referenced by get_json_table(), and get_json_table_nested_columns().
|
static |
Definition at line 12034 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), deparse_context::buf, castNode, get_const_expr(), get_json_table_columns(), get_json_table_nested_columns(), IsA, JsonTableSiblingJoin::lplan, JsonTablePath::name, JsonTablePathScan::path, plan, quote_identifier(), JsonTableSiblingJoin::rplan, and JsonTablePath::value.
Referenced by get_json_table_columns(), and get_json_table_nested_columns().
|
static |
Definition at line 7392 of file ruleutils.c.
References generate_unaccent_rules::action, appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), deparse_context::buf, buf, CMD_DELETE, CMD_INSERT, CMD_NOTHING, CMD_UPDATE, elog, ERROR, TargetEntry::expr, generate_relation_name(), get_attname(), get_from_clause(), get_returning_clause(), get_rte_alias(), get_rule_expr(), get_rule_list_toplevel(), get_update_query_targetlist_def(), get_with_clause(), deparse_context::indentLevel, lappend(), lfirst, lfirst_node, MERGE_WHEN_MATCHED, MERGE_WHEN_NOT_MATCHED_BY_SOURCE, MERGE_WHEN_NOT_MATCHED_BY_TARGET, Query::mergeActionList, Query::mergeJoinCondition, NIL, only_marker, OVERRIDING_SYSTEM_VALUE, OVERRIDING_USER_VALUE, PRETTY_INDENT, PRETTYINDENT_STD, processIndirection(), quote_identifier(), RangeTblEntry::relid, TargetEntry::resno, Query::returningList, rt_fetch, Query::rtable, RTE_RELATION, and RangeTblEntry::rtekind.
Referenced by get_query_def().
|
static |
Definition at line 8007 of file ruleutils.c.
References Assert(), attname, attnum, RangeTblEntry::ctelevelsup, RangeTblEntry::ctename, CommonTableExpr::ctename, CommonTableExpr::ctequery, deparse_namespace::ctes, elog, ERROR, TargetEntry::expr, find_param_referent(), get_expr_result_tupdesc(), get_name_for_var_field(), get_rte_attribute_name(), get_tle_by_resno(), GetCTETargetList, if(), deparse_namespace::index_tlist, INDEX_VAR, deparse_namespace::inner_plan, deparse_namespace::inner_tlist, INNER_VAR, InvalidAttrNumber, IsA, lcons(), lfirst, list_copy_tail(), list_length(), list_nth(), deparse_context::namespaces, NameStr, NIL, deparse_namespace::outer_plan, deparse_namespace::outer_tlist, OUTER_VAR, palloc(), deparse_namespace::plan, pop_ancestor_plan(), pop_child_plan(), push_ancestor_plan(), push_child_plan(), rt_fetch, deparse_namespace::rtable, RTE_CTE, RTE_FUNCTION, RTE_GROUP, RTE_JOIN, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, set_deparse_for_query(), snprintf, strVal, RangeTblEntry::subquery, Query::targetList, TupleDescAttr(), Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by get_name_for_var_field(), and get_rule_expr().
|
static |
Definition at line 12851 of file ruleutils.c.
References appendStringInfo(), buf, elog, ERROR, get_namespace_name_or_temp(), GetDefaultOpClass(), GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), OidIsValid, OpclassIsVisible(), quote_identifier(), ReleaseSysCache(), and SearchSysCache1().
Referenced by generate_opclass_name(), get_rule_expr(), pg_get_indexdef_worker(), and pg_get_partkeydef_worker().
|
static |
Definition at line 10725 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), arg, generate_unaccent_rules::args, OpExpr::args, deparse_context::buf, buf, exprType(), generate_operator_name(), get_rule_expr_paren(), InvalidOid, linitial, list_length(), lsecond, OpExpr::opno, and PRETTY_PAREN.
Referenced by get_rule_expr().
|
static |
Definition at line 8677 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), deparse_namespace::argnames, Assert(), deparse_context::buf, find_param_generator(), find_param_referent(), deparse_namespace::funcname, get_rule_expr(), IsA, lfirst, llast, deparse_context::namespaces, NIL, deparse_namespace::numargs, PARAM_EXTERN, Param::paramid, Param::paramkind, SubPlan::plan_name, pop_ancestor_plan(), push_ancestor_plan(), quote_identifier(), deparse_namespace::rtable_names, SubPlan::useHashTable, and deparse_context::varprefix.
Referenced by get_rule_expr().
|
static |
Definition at line 5624 of file ruleutils.c.
References AcquireRewriteLocks(), deparse_context::appendparents, appendStringInfoString(), deparse_context::buf, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_NOTHING, CMD_SELECT, CMD_UPDATE, CMD_UTILITY, deparse_context::colNamesVisible, Query::commandType, elog, ERROR, flatten_group_exprs(), get_delete_query_def(), get_insert_query_def(), get_merge_query_def(), get_select_query_def(), get_update_query_def(), get_utility_query_def(), Query::havingQual, deparse_context::indentLevel, deparse_context::inGroupBy, lcons(), list_copy(), list_length(), deparse_context::namespaces, NIL, deparse_context::prettyFlags, deparse_context::resultDesc, Query::rtable, set_deparse_for_query(), deparse_context::targetList, Query::targetList, deparse_context::varInOrderBy, deparse_context::varprefix, deparse_context::windowClause, and deparse_context::wrapColumn.
Referenced by get_from_clause_item(), get_insert_query_def(), get_setop_query(), get_sublink_expr(), get_with_clause(), make_ruledef(), make_viewdef(), pg_get_querydef(), and print_function_sqlbody().
char * get_range_partbound_string | ( | List * | bound_datums | ) |
Definition at line 13666 of file ruleutils.c.
References appendStringInfoChar(), appendStringInfoString(), deparse_context::buf, buf, castNode, get_const_expr(), PartitionRangeDatum::kind, lfirst_node, makeStringInfo(), PARTITION_RANGE_DATUM_MAXVALUE, PARTITION_RANGE_DATUM_MINVALUE, val, and PartitionRangeDatum::value.
Referenced by check_new_partition_bound(), and get_rule_expr().
|
static |
Definition at line 13123 of file ruleutils.c.
References elog, ERROR, get_rel_name(), and relname.
Referenced by get_rte_alias(), pg_get_constraintdef_worker(), pg_get_indexdef_worker(), pg_get_partition_constraintdef(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), and pg_get_statisticsobjdef_expressions().
|
static |
Definition at line 13578 of file ruleutils.c.
References appendStringInfo(), appendStringInfoString(), buf, DatumGetArrayTypeP, deconstruct_array_builtin(), i, name, noptions, options, pfree(), quote_identifier(), simple_quote_literal(), TextDatumGetCString, and value.
Referenced by flatten_reloptions(), and pg_get_indexdef_worker().
|
static |
Definition at line 6365 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), deparse_context::buf, buf, get_target_list(), PRETTYINDENT_STD, quote_identifier(), and Query::returningList.
Referenced by get_delete_query_def(), get_insert_query_def(), get_merge_query_def(), and get_update_query_def().
|
static |
Definition at line 5133 of file ruleutils.c.
References Assert(), linitial, list_length(), list_nth(), deparse_context::namespaces, and deparse_namespace::rtable_names.
Referenced by get_from_clause_item(), get_rte_alias(), and get_select_query_def().
|
static |
Definition at line 12645 of file ruleutils.c.
References appendStringInfo(), deparse_context::buf, RangeTblEntry::ctename, deparse_columns_fetch, get_relation_name(), get_rtable_name(), linitial, deparse_context::namespaces, deparse_columns::printaliases, quote_identifier(), RangeTblEntry::relid, RTE_CTE, RTE_FUNCTION, RTE_RELATION, RTE_SUBQUERY, RTE_VALUES, and RangeTblEntry::rtekind.
Referenced by get_delete_query_def(), get_from_clause_item(), get_insert_query_def(), get_merge_query_def(), and get_update_query_def().
|
static |
Definition at line 9242 of file ruleutils.c.
References ALL_SUBLINK, deparse_namespace::ancestors, AND_EXPR, ANY_SUBLINK, appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), arg, NamedArgExpr::arg, FieldSelect::arg, RelabelType::arg, CoerceViaIO::arg, ArrayCoerceExpr::arg, CollateExpr::arg, CaseExpr::arg, NullTest::arg, BooleanTest::arg, CoerceToDomain::arg, generate_unaccent_rules::args, OpExpr::args, ScalarArrayOpExpr::args, BoolExpr::args, CaseExpr::args, RowExpr::args, CoalesceExpr::args, MinMaxExpr::args, XmlExpr::args, ARRAY_SUBLINK, Assert(), BoolExpr::boolop, BooleanTest::booltesttype, deparse_context::buf, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), COERCE_EXPLICIT_CALL, COERCE_EXPLICIT_CAST, COERCE_IMPLICIT_CAST, CollateExpr::collOid, convert(), CTE_SUBLINK, CurrentOfExpr::cursor_name, CurrentOfExpr::cursor_param, DatumGetBool(), DatumGetInt32(), CaseExpr::defresult, elog, ERROR, EXISTS_SUBLINK, JsonIsPredicate::expr, InferenceElem::expr, EXPR_SUBLINK, exprType(), exprTypmod(), FieldSelect::fieldnum, for_each_from, forboth, JsonValueExpr::format, format_type_with_typemod(), JsonExpr::formatted_expr, generate_collation_name(), generate_operator_name(), generate_relation_name(), get_agg_expr(), get_base_element_type(), get_coercion_expr(), get_const_expr(), get_func_expr(), get_json_constructor(), get_json_expr_options(), get_json_format(), get_json_path_spec(), get_json_returning(), get_name_for_var_field(), get_opclass_input_type(), get_opclass_name(), get_oper_expr(), get_parameter(), get_range_partbound_string(), get_rule_expr(), get_rule_expr_paren(), get_rule_expr_toplevel(), get_rule_list_toplevel(), get_sublink_expr(), get_tablefunc(), get_variable(), get_windowfunc_expr(), i, if(), XmlExpr::indent, InferenceElem::infercollid, InferenceElem::inferopclass, PartitionBoundSpec::is_default, IS_DOCUMENT, IS_FALSE, IS_GREATEST, IS_LEAST, IS_NOT_FALSE, IS_NOT_NULL, IS_NOT_TRUE, IS_NOT_UNKNOWN, IS_NULL, IS_TRUE, IS_UNKNOWN, IS_XMLCONCAT, IS_XMLELEMENT, IS_XMLFOREST, IS_XMLPARSE, IS_XMLPI, IS_XMLROOT, IS_XMLSERIALIZE, IsA, JsonIsPredicate::item_type, JS_TYPE_ARRAY, JS_TYPE_OBJECT, JS_TYPE_SCALAR, JSON_BEHAVIOR_FALSE, JSON_BEHAVIOR_NULL, JSON_EXISTS_OP, JSON_QUERY_OP, JSON_VALUE_OP, RowCompareExpr::largs, lcons(), lfirst, lfirst_node, linitial, linitial_oid, list_delete_first(), list_length(), PartitionBoundSpec::listdatums, lnext(), lookup_rowtype_tupdesc(), PartitionBoundSpec::lowerdatums, lsecond, lsecond_node, lthird_node, map_xml_name_to_sql_identifier(), PartitionBoundSpec::modulus, MULTIEXPR_SUBLINK, XmlExpr::named_args, deparse_context::namespaces, TupleDescData::natts, FieldStore::newvals, NIL, nodeTag, NOT_EXPR, NullTest::nulltesttype, MinMaxExpr::op, SQLValueFunction::op, XmlExpr::op, JsonExpr::op, ScalarArrayOpExpr::opno, OR_EXPR, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, JsonExpr::passing_names, JsonExpr::passing_values, JsonExpr::path_spec, SubPlan::plan_name, PRETTY_INDENT, PRETTY_PAREN, PRETTYINDENT_VAR, printSubscripts(), processIndirection(), quote_identifier(), RowCompareExpr::rargs, JsonValueExpr::raw_expr, SubscriptingRef::refassgnexpr, SubscriptingRef::refexpr, ReleaseTupleDesc, PartitionBoundSpec::remainder, RelabelType::resulttype, CoerceViaIO::resulttype, ArrayCoerceExpr::resulttype, CoerceToDomain::resulttype, ReturningExpr::retexpr, JsonExpr::returning, ROWCOMPARE_SUBLINK, NextValueExpr::seqid, simple_quote_literal(), splan, PartitionBoundSpec::strategy, strip_implicit_coercions(), strVal, SubPlan::subLinkType, AlternativeSubPlan::subplans, SVFOP_CURRENT_CATALOG, SVFOP_CURRENT_DATE, SVFOP_CURRENT_ROLE, SVFOP_CURRENT_SCHEMA, SVFOP_CURRENT_TIME, SVFOP_CURRENT_TIME_N, SVFOP_CURRENT_TIMESTAMP, SVFOP_CURRENT_TIMESTAMP_N, SVFOP_CURRENT_USER, SVFOP_LOCALTIME, SVFOP_LOCALTIME_N, SVFOP_LOCALTIMESTAMP, SVFOP_LOCALTIMESTAMP_N, SVFOP_SESSION_USER, SVFOP_USER, SubPlan::testexpr, TupleDescAttr(), type_is_rowtype(), JsonReturning::typid, SQLValueFunction::typmod, JsonIsPredicate::unique_keys, PartitionBoundSpec::upperdatums, SubPlan::useHashTable, ScalarArrayOpExpr::useOr, val, deparse_context::varprefix, XML_STANDALONE_NO, XML_STANDALONE_NO_VALUE, XML_STANDALONE_YES, and XMLOPTION_DOCUMENT.
Referenced by deparse_expression_pretty(), get_agg_expr_helper(), get_basic_select_query(), get_delete_query_def(), get_from_clause_item(), get_func_expr(), get_func_sql_syntax(), get_insert_query_def(), get_json_behavior(), get_json_constructor(), get_json_path_spec(), get_json_table(), get_merge_query_def(), get_parameter(), get_rule_expr(), get_rule_expr_funccall(), get_rule_expr_paren(), get_rule_expr_toplevel(), get_rule_sortgroupclause(), get_select_query_def(), get_special_variable(), get_sublink_expr(), get_tablesample_def(), get_target_list(), get_update_query_def(), get_update_query_targetlist_def(), get_variable(), get_window_frame_options(), get_windowfunc_expr_helper(), get_with_clause(), get_xmltable(), make_ruledef(), pg_get_triggerdef_worker(), and printSubscripts().
|
static |
Definition at line 10673 of file ruleutils.c.
References appendStringInfo(), appendStringInfoString(), deparse_context::buf, buf, exprType(), exprTypmod(), format_type_with_typemod(), get_rule_expr(), and looks_like_function().
Referenced by get_from_clause_item().
|
static |
Definition at line 9145 of file ruleutils.c.
References appendStringInfoChar(), deparse_context::buf, get_rule_expr(), isSimpleNode(), PRETTY_PAREN, and deparse_context::prettyFlags.
Referenced by get_coercion_expr(), get_func_expr(), get_func_sql_syntax(), get_oper_expr(), and get_rule_expr().
|
static |
Definition at line 10625 of file ruleutils.c.
References get_rule_expr(), get_variable(), and IsA.
Referenced by get_rule_expr(), get_rule_list_toplevel(), and get_values_def().
|
static |
Definition at line 6621 of file ruleutils.c.
References appendStringInfoChar(), appendStringInfoString(), deparse_context::buf, buf, GroupingSet::content, get_rule_groupingset(), get_rule_sortgroupclause(), GROUPING_SET_CUBE, GROUPING_SET_EMPTY, GROUPING_SET_ROLLUP, GROUPING_SET_SETS, GROUPING_SET_SIMPLE, lfirst, lfirst_int, and list_length().
Referenced by get_basic_select_query(), and get_rule_groupingset().
|
static |
Definition at line 10643 of file ruleutils.c.
References appendStringInfoString(), deparse_context::buf, get_rule_expr_toplevel(), and lfirst.
Referenced by get_insert_query_def(), get_merge_query_def(), and get_rule_expr().
|
static |
Definition at line 6681 of file ruleutils.c.
References appendStringInfo(), appendStringInfoString(), deparse_context::buf, buf, exprType(), generate_operator_name(), get_rule_sortgroupclause(), TypeCacheEntry::gt_opr, lfirst, lookup_type_cache(), TypeCacheEntry::lt_opr, SortGroupClause::nulls_first, SortGroupClause::sortop, SortGroupClause::tleSortGroupRef, TYPECACHE_GT_OPR, and TYPECACHE_LT_OPR.
Referenced by get_agg_expr_helper(), get_rule_windowspec(), and get_select_query_def().
|
static |
Definition at line 6552 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), Assert(), deparse_context::buf, buf, TargetEntry::expr, get_const_expr(), get_rule_expr(), get_sortgroupref_tle(), get_variable(), if(), IsA, PRETTY_PAREN, TargetEntry::resno, and deparse_context::varInOrderBy.
Referenced by get_basic_select_query(), get_rule_groupingset(), get_rule_orderby(), and get_rule_windowspec().
|
static |
Definition at line 6739 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoString(), deparse_context::buf, buf, get_rule_windowspec(), lfirst, PRETTYINDENT_STD, quote_identifier(), Query::targetList, and Query::windowClause.
Referenced by get_basic_select_query().
|
static |
Definition at line 6771 of file ruleutils.c.
References appendStringInfoChar(), appendStringInfoString(), deparse_context::buf, buf, WindowClause::endOffset, FRAMEOPTION_NONDEFAULT, WindowClause::frameOptions, get_rule_orderby(), get_rule_sortgroupclause(), get_window_frame_options(), lfirst, WindowClause::orderClause, WindowClause::partitionClause, quote_identifier(), WindowClause::startOffset, and SortGroupClause::tleSortGroupRef.
Referenced by get_rule_windowclause(), and get_windowfunc_expr_helper().
|
static |
Definition at line 5906 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoString(), deparse_context::buf, buf, elog, ERROR, get_basic_select_query(), get_rtable_name(), get_rule_expr(), get_rule_orderby(), get_setop_query(), get_with_clause(), IsA, LCS_FORKEYSHARE, LCS_FORNOKEYUPDATE, LCS_FORSHARE, LCS_FORUPDATE, LCS_NONE, lfirst, LIMIT_OPTION_WITH_TIES, Query::limitCount, Query::limitOffset, Query::limitOption, LockWaitError, LockWaitSkip, NIL, PRETTYINDENT_STD, RowMarkClause::pushedDown, quote_identifier(), Query::rowMarks, RowMarkClause::rti, Query::setOperations, Query::sortClause, RowMarkClause::strength, deparse_context::targetList, Query::targetList, RowMarkClause::waitPolicy, deparse_context::windowClause, and Query::windowClause.
Referenced by get_query_def().
|
static |
Definition at line 6404 of file ruleutils.c.
References SetOperationStmt::all, appendContextKeyword(), appendStringInfoChar(), appendStringInfoString(), Assert(), deparse_context::buf, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), deparse_context::colNamesVisible, Query::cteList, elog, ERROR, get_query_def(), get_setop_query(), if(), deparse_context::indentLevel, IsA, SetOperationStmt::larg, Query::limitCount, Query::limitOffset, deparse_context::namespaces, nodeTag, SetOperationStmt::op, PRETTY_INDENT, deparse_context::prettyFlags, PRETTYINDENT_STD, SetOperationStmt::rarg, deparse_context::resultDesc, Query::rowMarks, rt_fetch, Query::rtable, RangeTblRef::rtindex, SETOP_EXCEPT, SETOP_INTERSECT, SETOP_UNION, Query::setOperations, Query::sortClause, RangeTblEntry::subquery, and deparse_context::wrapColumn.
Referenced by get_select_query_def(), and get_setop_query().
|
static |
Definition at line 8814 of file ruleutils.c.
References generate_unaccent_rules::args, OpExpr::args, exprType(), generate_operator_name(), linitial, list_length(), lsecond, and OpExpr::opno.
Referenced by isSimpleNode().
|
static |
Definition at line 6029 of file ruleutils.c.
References attname, forboth, lfirst, list_length(), NameStr, Query::rtable, RTE_RELATION, RTE_VALUES, RangeTblEntry::rtekind, strVal, Query::targetList, and TupleDescAttr().
Referenced by get_basic_select_query().
|
static |
Definition at line 7878 of file ruleutils.c.
References appendStringInfoChar(), deparse_context::buf, buf, get_rule_expr(), and IsA.
Referenced by get_variable().
|
static |
Definition at line 11810 of file ruleutils.c.
References ALL_SUBLINK, ANY_SUBLINK, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), OpExpr::args, ARRAY_SUBLINK, deparse_context::buf, buf, CTE_SUBLINK, elog, ERROR, EXISTS_SUBLINK, EXPR_SUBLINK, exprType(), generate_operator_name(), get_query_def(), get_rule_expr(), deparse_context::indentLevel, IsA, RowCompareExpr::largs, lfirst_node, linitial, linitial_oid, lsecond, MULTIEXPR_SUBLINK, deparse_context::namespaces, nodeTag, OpExpr::opno, deparse_context::prettyFlags, RowCompareExpr::rargs, ROWCOMPARE_SUBLINK, SubLink::subLinkType, SubLink::subselect, SubLink::testexpr, and deparse_context::wrapColumn.
Referenced by get_rule_expr().
|
static |
Definition at line 12241 of file ruleutils.c.
References TableFunc::functype, get_json_table(), get_xmltable(), TFT_JSON_TABLE, and TFT_XMLTABLE.
Referenced by get_from_clause_item(), and get_rule_expr().
|
static |
Definition at line 12807 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), TableSampleClause::args, deparse_context::buf, buf, generate_function_name(), get_rule_expr(), lfirst, NIL, TableSampleClause::repeatable, and TableSampleClause::tsmhandler.
Referenced by get_from_clause_item().
|
static |
Definition at line 6229 of file ruleutils.c.
References appendBinaryStringInfo(), appendContextKeyword(), appendStringInfo(), appendStringInfoString(), attname, deparse_context::buf, buf, deparse_context::colNamesVisible, StringInfoData::data, TargetEntry::expr, get_rule_expr(), get_variable(), initStringInfo(), IsA, StringInfoData::len, lfirst, NameStr, TupleDescData::natts, pfree(), PRETTY_INDENT, PRETTYINDENT_STD, PRETTYINDENT_VAR, quote_identifier(), removeStringInfoSpaces(), resetStringInfo(), deparse_context::resultDesc, TupleDescAttr(), and deparse_context::wrapColumn.
Referenced by get_basic_select_query(), and get_returning_clause().
|
static |
Definition at line 7141 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), deparse_context::buf, buf, generate_relation_name(), get_from_clause(), get_returning_clause(), get_rte_alias(), get_rule_expr(), get_update_query_targetlist_def(), get_with_clause(), deparse_context::indentLevel, Query::jointree, NIL, only_marker, PRETTY_INDENT, PRETTYINDENT_STD, FromExpr::quals, RangeTblEntry::relid, Query::returningList, rt_fetch, Query::rtable, RTE_RELATION, RangeTblEntry::rtekind, and Query::targetList.
Referenced by get_query_def().
|
static |
Definition at line 7193 of file ruleutils.c.
References appendStringInfoChar(), appendStringInfoString(), CoerceToDomain::arg, Assert(), deparse_context::buf, buf, COERCE_IMPLICIT_CAST, count_nonjunk_tlist_entries(), TargetEntry::expr, get_attname(), get_rule_expr(), if(), IsA, lappend(), lfirst, linitial, list_head(), list_length(), lnext(), MULTIEXPR_SUBLINK, FieldStore::newvals, NIL, PARAM_MULTIEXPR, processIndirection(), quote_identifier(), SubscriptingRef::refassgnexpr, RangeTblEntry::relid, TargetEntry::resno, strip_implicit_coercions(), SubLink::subLinkId, SubLink::subLinkType, SubLink::subselect, and while().
Referenced by get_insert_query_def(), get_merge_query_def(), and get_update_query_def().
|
static |
Definition at line 7551 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoString(), deparse_context::buf, buf, elog, ERROR, IsA, PRETTYINDENT_STD, quote_identifier(), simple_quote_literal(), stmt, and Query::utilityStmt.
Referenced by get_query_def().
|
static |
Definition at line 5724 of file ruleutils.c.
References appendStringInfoChar(), appendStringInfoString(), deparse_context::buf, buf, get_rule_expr_toplevel(), and lfirst.
Referenced by get_basic_select_query(), get_from_clause_item(), and get_insert_query_def().
|
static |
Definition at line 7596 of file ruleutils.c.
References deparse_context::appendparents, deparse_namespace::appendrels, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), attname, attnum, bms_is_member(), deparse_context::buf, buf, deparse_columns::colnames, deparse_columns_fetch, elog, equal(), ERROR, TargetEntry::expr, foreach_node, format_type_with_typemod(), get_rte_attribute_name(), get_rule_expr(), get_special_variable(), get_tle_by_resno(), get_variable(), deparse_context::inGroupBy, deparse_namespace::inner_plan, deparse_namespace::inner_tlist, InvalidAttrNumber, IsA, list_length(), list_nth(), deparse_context::namespaces, NameStr, TupleDescData::natts, NIL, AppendRelInfo::num_child_cols, deparse_columns::num_cols, AppendRelInfo::parent_relid, deparse_namespace::plan, pop_child_plan(), push_child_plan(), quote_identifier(), resolve_special_varno(), deparse_context::resultDesc, deparse_namespace::ret_new_alias, deparse_namespace::ret_old_alias, rt_fetch, deparse_namespace::rtable, deparse_namespace::rtable_names, RTE_CTE, RTE_JOIN, RTE_RELATION, RTE_SUBQUERY, RangeTblEntry::rtekind, deparse_context::targetList, TupleDescAttr(), VAR_RETURNING_DEFAULT, VAR_RETURNING_NEW, VAR_RETURNING_OLD, Var::varattno, deparse_context::varInOrderBy, Var::varlevelsup, Var::varno, deparse_context::varprefix, and Var::varreturningtype.
Referenced by get_rule_expr(), get_rule_expr_toplevel(), get_rule_sortgroupclause(), get_target_list(), and get_variable().
|
static |
Definition at line 6828 of file ruleutils.c.
References appendStringInfoString(), Assert(), deparse_context::buf, buf, FRAMEOPTION_BETWEEN, FRAMEOPTION_END_CURRENT_ROW, FRAMEOPTION_END_OFFSET, FRAMEOPTION_END_OFFSET_FOLLOWING, FRAMEOPTION_END_OFFSET_PRECEDING, FRAMEOPTION_END_UNBOUNDED_FOLLOWING, FRAMEOPTION_EXCLUDE_CURRENT_ROW, FRAMEOPTION_EXCLUDE_GROUP, FRAMEOPTION_EXCLUDE_TIES, FRAMEOPTION_GROUPS, FRAMEOPTION_NONDEFAULT, FRAMEOPTION_RANGE, FRAMEOPTION_ROWS, FRAMEOPTION_START_CURRENT_ROW, FRAMEOPTION_START_OFFSET, FRAMEOPTION_START_OFFSET_FOLLOWING, FRAMEOPTION_START_OFFSET_PRECEDING, FRAMEOPTION_START_UNBOUNDED_PRECEDING, and get_rule_expr().
Referenced by get_rule_windowspec(), and get_window_frame_options_for_explain().
char * get_window_frame_options_for_explain | ( | int | frameOptions, |
Node * | startOffset, | ||
Node * | endOffset, | ||
List * | dpcontext, | ||
bool | forceprefix | ||
) |
Definition at line 6897 of file ruleutils.c.
References deparse_context::appendparents, deparse_context::buf, buf, deparse_context::colNamesVisible, get_window_frame_options(), deparse_context::indentLevel, deparse_context::inGroupBy, initStringInfo(), deparse_context::namespaces, NIL, deparse_context::prettyFlags, deparse_context::resultDesc, deparse_context::targetList, deparse_context::varInOrderBy, deparse_context::varprefix, deparse_context::windowClause, WRAP_COLUMN_DEFAULT, and deparse_context::wrapColumn.
Referenced by show_window_def().
|
static |
Definition at line 11015 of file ruleutils.c.
References get_windowfunc_expr_helper().
Referenced by get_rule_expr().
|
static |
Definition at line 11026 of file ruleutils.c.
References WindowFunc::aggfilter, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), arg, WindowFunc::args, deparse_context::buf, buf, elog, ereport, errcode(), errmsg(), ERROR, exprType(), FUNC_MAX_ARGS, funcname, generate_function_name(), get_rule_expr(), get_rule_windowspec(), if(), deparse_context::inGroupBy, IsA, lappend(), lfirst, linitial, list_length(), lsecond, deparse_context::namespaces, NIL, deparse_namespace::plan, quote_identifier(), deparse_context::targetList, deparse_context::windowClause, WindowFunc::winfnoid, WindowAgg::winname, WindowClause::winref, WindowAgg::winref, and WindowFunc::winref.
Referenced by get_json_agg_constructor(), and get_windowfunc_expr().
|
static |
Definition at line 5767 of file ruleutils.c.
References appendContextKeyword(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), deparse_context::buf, buf, castNode, Const::consttype, Query::cteList, CTEMaterializeAlways, CommonTableExpr::ctematerialized, CTEMaterializeDefault, CTEMaterializeNever, CommonTableExpr::ctename, CommonTableExpr::ctequery, DatumGetBool(), get_query_def(), get_rule_expr(), deparse_context::indentLevel, lfirst, deparse_context::namespaces, NIL, PRETTY_INDENT, deparse_context::prettyFlags, PRETTYINDENT_STD, quote_identifier(), strVal, and deparse_context::wrapColumn.
Referenced by get_delete_query_def(), get_insert_query_def(), get_merge_query_def(), get_select_query_def(), and get_update_query_def().
|
static |
Definition at line 11935 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), bms_is_member(), deparse_context::buf, buf, TableFunc::colexprs, TableFunc::docexpr, forboth, forfive, format_type_with_typemod(), get_rule_expr(), lfirst, lfirst_int, lfirst_node, lfirst_oid, NIL, quote_identifier(), TableFunc::rowexpr, and strVal.
Referenced by get_tablefunc().
|
static |
Definition at line 4140 of file ruleutils.c.
References elog, ERROR, FromExpr::fromlist, has_dangerous_join_using(), i, IsA, j, lfirst, list_nth(), nodeTag, rt_fetch, and deparse_namespace::rtable.
Referenced by has_dangerous_join_using(), and set_deparse_for_query().
|
static |
Definition at line 5065 of file ruleutils.c.
References Assert(), elog, ERROR, IsA, j, deparse_columns::leftattnos, deparse_columns::leftrti, lfirst_int, list_length(), nodeTag, palloc0(), deparse_columns::rightattnos, and deparse_columns::rightrti.
Referenced by set_using_names().
|
static |
Definition at line 3446 of file ruleutils.c.
Referenced by pg_get_function_arg_default().
Definition at line 8840 of file ruleutils.c.
References AND_EXPR, arg, generate_unaccent_rules::args, COERCE_EXPLICIT_CAST, COERCE_IMPLICIT_CAST, COERCE_SQL_SYNTAX, get_simple_binary_op_name(), IsA, isSimpleNode(), linitial, nodeTag, NOT_EXPR, OR_EXPR, PRETTYFLAG_PAREN, and type.
Referenced by get_rule_expr_paren(), and isSimpleNode().
|
static |
Definition at line 10696 of file ruleutils.c.
References COERCE_EXPLICIT_CALL, COERCE_SQL_SYNTAX, and nodeTag.
Referenced by get_rule_expr_funccall(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), and pg_get_statisticsobj_worker().
|
static |
Definition at line 4923 of file ruleutils.c.
References colname_is_unique(), i, NAMEDATALEN, palloc(), pg_mbcliplen(), and sprintf.
Referenced by set_join_column_names(), set_relation_column_names(), and set_using_names().
|
static |
Definition at line 5347 of file ruleutils.c.
References AccessShareLock, AcquireRewriteLocks(), generate_unaccent_rules::action, deparse_context::appendparents, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), deparse_context::buf, buf, deparse_context::colNamesVisible, DatumGetBool(), DatumGetChar(), DatumGetName(), DatumGetObjectId(), elog, ereport, errcode(), errmsg(), ERROR, generate_qualified_relation_name(), generate_relation_name(), get_query_def(), get_rule_expr(), getInsertSelectQuery(), deparse_context::indentLevel, deparse_context::inGroupBy, lfirst, linitial, list_length(), list_make1, deparse_context::namespaces, NameStr, NIL, PRETTYFLAG_INDENT, PRETTYFLAG_SCHEMA, deparse_context::prettyFlags, PRETTYINDENT_STD, quote_identifier(), RelationGetDescr, deparse_context::resultDesc, Query::rtable, set_deparse_for_query(), SPI_fnumber(), SPI_getbinval(), SPI_getvalue(), stringToNode(), table_close(), table_open(), deparse_context::targetList, deparse_context::varInOrderBy, deparse_context::varprefix, deparse_context::windowClause, WRAP_COLUMN_DEFAULT, and deparse_context::wrapColumn.
Referenced by pg_get_ruledef_worker().
|
static |
Definition at line 5539 of file ruleutils.c.
References AccessShareLock, appendStringInfoChar(), Assert(), buf, CMD_SELECT, Query::commandType, DatumGetBool(), DatumGetChar(), DatumGetObjectId(), get_query_def(), linitial, list_length(), NIL, RelationGetDescr, SPI_fnumber(), SPI_getbinval(), SPI_getvalue(), stringToNode(), table_close(), and table_open().
Referenced by pg_get_viewdef_worker().
Datum pg_get_constraintdef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2146 of file ruleutils.c.
References pg_get_constraintdef_worker(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, PRETTYFLAG_INDENT, and string_to_text().
char * pg_get_constraintdef_command | ( | Oid | constraintId | ) |
Definition at line 2184 of file ruleutils.c.
References pg_get_constraintdef_worker().
Referenced by RememberConstraintForRebuilding().
Datum pg_get_constraintdef_ext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2163 of file ruleutils.c.
References GET_PRETTY_FLAGS, pg_get_constraintdef_worker(), PG_GETARG_BOOL, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, and string_to_text().
|
static |
Definition at line 2193 of file ruleutils.c.
References AccessShareLock, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), attnum, BTEqualStrategyNumber, buf, DatumGetArrayTypeP, DatumGetInt16(), DatumGetInt32(), DatumGetObjectId(), decompile_column_index_array(), deconstruct_array_builtin(), deparse_context_for(), deparse_expression_pretty(), elog, ERROR, extractNotNullColumn(), FKCONSTR_ACTION_CASCADE, FKCONSTR_ACTION_NOACTION, FKCONSTR_ACTION_RESTRICT, FKCONSTR_ACTION_SETDEFAULT, FKCONSTR_ACTION_SETNULL, FKCONSTR_MATCH_FULL, FKCONSTR_MATCH_PARTIAL, FKCONSTR_MATCH_SIMPLE, flatten_reloptions(), generate_qualified_relation_name(), generate_qualified_type_name(), generate_relation_name(), get_attname(), get_rel_tablespace(), get_relation_name(), get_tablespace_name(), GETSTRUCT(), GetTransactionSnapshot(), HeapTupleIsValid, i, initStringInfo(), InvalidOid, j, NameStr, NIL, ObjectIdGetDatum(), OidIsValid, palloc(), pfree(), pg_get_indexdef_worker(), quote_identifier(), RegisterSnapshot(), ReleaseSysCache(), ScanKeyInit(), SearchSysCache1(), stringToNode(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), TextDatumGetCString, UnregisterSnapshot(), and val.
Referenced by pg_get_constraintdef(), pg_get_constraintdef_command(), and pg_get_constraintdef_ext().
Datum pg_get_expr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2675 of file ruleutils.c.
References pg_get_expr_worker(), PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, and PRETTYFLAG_INDENT.
Referenced by decompile_conbin().
Datum pg_get_expr_ext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2692 of file ruleutils.c.
References GET_PRETTY_FLAGS, pg_get_expr_worker(), PG_GETARG_BOOL, PG_GETARG_OID, PG_GETARG_TEXT_PP, PG_RETURN_NULL, and PG_RETURN_TEXT_P.
Definition at line 2710 of file ruleutils.c.
References AccessShareLock, bms_is_empty, bms_is_subset(), bms_make_singleton(), deparse_context_for(), deparse_expression_pretty(), ereport, errcode(), errmsg(), ERROR, IsA, linitial, NIL, OidIsValid, pfree(), pull_varnos(), relation_close(), RelationGetRelationName, str, string_to_text(), stringToNode(), text_to_cstring(), and try_relation_open().
Referenced by pg_get_expr(), and pg_get_expr_ext().
Datum pg_get_function_arg_default | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3486 of file ruleutils.c.
References castNode, deparse_expression(), get_func_arg_info(), GETSTRUCT(), HeapTupleIsValid, i, is_input_argument(), list_length(), list_nth(), NIL, ObjectIdGetDatum(), pfree(), PG_GETARG_INT32, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, ReleaseSysCache(), SearchSysCache1(), str, string_to_text(), stringToNode(), SysCacheGetAttr(), and TextDatumGetCString.
Datum pg_get_function_arguments | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3179 of file ruleutils.c.
References buf, HeapTupleIsValid, initStringInfo(), ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, print_function_arguments(), ReleaseSysCache(), SearchSysCache1(), and string_to_text().
Datum pg_get_function_identity_arguments | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3205 of file ruleutils.c.
References buf, HeapTupleIsValid, initStringInfo(), ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, print_function_arguments(), ReleaseSysCache(), SearchSysCache1(), and string_to_text().
Datum pg_get_function_result | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3230 of file ruleutils.c.
References buf, GETSTRUCT(), HeapTupleIsValid, initStringInfo(), ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, print_function_rettype(), ReleaseSysCache(), SearchSysCache1(), and string_to_text().
Datum pg_get_function_sqlbody | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3610 of file ruleutils.c.
References buf, cstring_to_text_with_len(), HeapTupleIsValid, initStringInfo(), ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, print_function_sqlbody(), ReleaseSysCache(), SearchSysCache1(), and SysCacheGetAttr().
Datum pg_get_functiondef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2927 of file ruleutils.c.
References a, appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, array_ref(), Assert(), buf, StringInfoData::data, DatumGetArrayTypeP, elog, ereport, errcode(), errmsg(), ERROR, generate_function_name(), get_language_name(), get_namespace_name_or_temp(), GetConfigOptionFlags(), GETSTRUCT(), GUC_LIST_QUOTE, HeapTupleIsValid, i, initStringInfo(), StringInfoData::len, lfirst, lnext(), name, NameStr, NIL, ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, print_function_arguments(), print_function_rettype(), print_function_sqlbody(), print_function_trftypes(), quote_identifier(), quote_qualified_identifier(), ReleaseSysCache(), SearchSysCache1(), simple_quote_literal(), SplitGUCList(), string_to_text(), SysCacheGetAttr(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Datum pg_get_indexdef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1178 of file ruleutils.c.
References pg_get_indexdef_worker(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, PRETTYFLAG_INDENT, and string_to_text().
char * pg_get_indexdef_columns | ( | Oid | indexrelid, |
bool | pretty | ||
) |
Definition at line 1235 of file ruleutils.c.
References GET_PRETTY_FLAGS, and pg_get_indexdef_worker().
Referenced by BuildIndexValueDescription().
Definition at line 1249 of file ruleutils.c.
References GET_PRETTY_FLAGS, pg_get_indexdef_worker(), RULE_INDEXDEF_KEYS_ONLY, and RULE_INDEXDEF_PRETTY.
Referenced by gist_page_items().
Datum pg_get_indexdef_ext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1198 of file ruleutils.c.
References GET_PRETTY_FLAGS, pg_get_indexdef_worker(), PG_GETARG_BOOL, PG_GETARG_INT32, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, and string_to_text().
char * pg_get_indexdef_string | ( | Oid | indexrelid | ) |
Definition at line 1225 of file ruleutils.c.
References pg_get_indexdef_worker().
Referenced by RememberIndexForRebuilding().
|
static |
Definition at line 1270 of file ruleutils.c.
References IndexAmRoutine::amcanorder, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), attname, attnum, buf, DatumGetPointer(), deparse_context_for(), deparse_expression_pretty(), elog, ERROR, exprCollation(), exprType(), flatten_reloptions(), generate_collation_name(), generate_operator_name(), generate_qualified_relation_name(), generate_relation_name(), get_attname(), get_attoptions(), get_atttypetypmodcoll(), get_opclass_name(), get_rel_tablespace(), get_relation_name(), get_reloptions(), get_tablespace_name(), GetIndexAmRoutine(), GETSTRUCT(), heap_attisnull(), HeapTupleIsValid, initStringInfo(), InvalidOid, lfirst, list_head(), lnext(), looks_like_function(), NameStr, NIL, ObjectIdGetDatum(), OidIsValid, pfree(), PRETTYFLAG_SCHEMA, quote_identifier(), ReleaseSysCache(), SearchSysCache1(), str, stringToNode(), SysCacheGetAttrNotNull(), TextDatumGetCString, int2vector::values, and oidvector::values.
Referenced by pg_get_constraintdef_worker(), pg_get_indexdef(), pg_get_indexdef_columns(), pg_get_indexdef_columns_extended(), pg_get_indexdef_ext(), and pg_get_indexdef_string().
char * pg_get_partconstrdef_string | ( | Oid | partitionId, |
char * | aliasname | ||
) |
Definition at line 2128 of file ruleutils.c.
References deparse_context_for(), deparse_expression(), and get_partition_qual_relid().
Referenced by RI_PartitionRemove_Check().
Datum pg_get_partition_constraintdef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2096 of file ruleutils.c.
References deparse_context_for(), deparse_expression_pretty(), get_partition_qual_relid(), get_relation_name(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, PRETTYFLAG_INDENT, and string_to_text().
Datum pg_get_partkeydef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1909 of file ruleutils.c.
References pg_get_partkeydef_worker(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, PRETTYFLAG_INDENT, and string_to_text().
char * pg_get_partkeydef_columns | ( | Oid | relid, |
bool | pretty | ||
) |
Definition at line 1924 of file ruleutils.c.
References GET_PRETTY_FLAGS, and pg_get_partkeydef_worker().
Referenced by ExecBuildSlotPartitionKeyDescription().
|
static |
Definition at line 1937 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), attname, attnum, buf, DatumGetPointer(), deparse_context_for(), deparse_expression_pretty(), elog, ERROR, exprCollation(), exprType(), generate_collation_name(), get_attname(), get_atttypetypmodcoll(), get_opclass_name(), get_relation_name(), GETSTRUCT(), heap_attisnull(), HeapTupleIsValid, initStringInfo(), IsA, lfirst, list_head(), lnext(), looks_like_function(), NIL, nodeTag, ObjectIdGetDatum(), OidIsValid, PARTITION_STRATEGY_HASH, PARTITION_STRATEGY_LIST, PARTITION_STRATEGY_RANGE, pfree(), quote_identifier(), ReleaseSysCache(), SearchSysCache1(), str, stringToNode(), SysCacheGetAttrNotNull(), TextDatumGetCString, and oidvector::values.
Referenced by pg_get_partkeydef(), and pg_get_partkeydef_columns().
char * pg_get_querydef | ( | Query * | query, |
bool | pretty | ||
) |
Definition at line 1588 of file ruleutils.c.
References buf, GET_PRETTY_FLAGS, get_query_def(), initStringInfo(), NIL, and WRAP_COLUMN_DEFAULT.
Datum pg_get_ruledef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 560 of file ruleutils.c.
References pg_get_ruledef_worker(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, PRETTYFLAG_INDENT, and string_to_text().
Datum pg_get_ruledef_ext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 578 of file ruleutils.c.
References GET_PRETTY_FLAGS, pg_get_ruledef_worker(), PG_GETARG_BOOL, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, and string_to_text().
|
static |
Definition at line 597 of file ruleutils.c.
References generate_unaccent_rules::args, buf, elog, ERROR, initStringInfo(), make_ruledef(), ObjectIdGetDatum(), plan, plan_getrulebyoid, query_getrulebyoid, SPI_connect(), SPI_execute_plan(), SPI_finish(), SPI_keepplan(), SPI_OK_FINISH, SPI_OK_SELECT, SPI_prepare(), SPI_processed, SPI_tuptable, SPITupleTable::tupdesc, and SPITupleTable::vals.
Referenced by pg_get_ruledef(), and pg_get_ruledef_ext().
Datum pg_get_serial_sequence | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2833 of file ruleutils.c.
References AccessShareLock, attnum, BTEqualStrategyNumber, DEPENDENCY_AUTO, DEPENDENCY_INTERNAL, ereport, errcode(), errmsg(), ERROR, generate_qualified_relation_name(), get_attnum(), get_rel_relkind(), GETSTRUCT(), HeapTupleIsValid, Int32GetDatum(), InvalidAttrNumber, InvalidOid, sort-test::key, makeRangeVarFromNameList(), NoLock, ObjectIdGetDatum(), OidIsValid, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, RangeVarGetRelid, RangeVar::relname, ScanKeyInit(), string_to_text(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), text_to_cstring(), and textToQualifiedNameList().
|
static |
Definition at line 1654 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), ARR_DATA_PTR, ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_NDIM, attname, attnum, buf, DatumGetArrayTypeP, deparse_context_for(), deparse_expression_pretty(), elog, ERROR, generate_relation_name(), get_attname(), get_namespace_name_or_temp(), get_relation_name(), GETSTRUCT(), heap_attisnull(), HeapTupleIsValid, i, initStringInfo(), lfirst, list_length(), looks_like_function(), NameStr, NIL, ObjectIdGetDatum(), pfree(), PRETTYFLAG_PAREN, quote_identifier(), quote_qualified_identifier(), ReleaseSysCache(), SearchSysCache1(), str, stringToNode(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
Referenced by pg_get_statisticsobjdef(), pg_get_statisticsobjdef_columns(), and pg_get_statisticsobjdef_string().
Datum pg_get_statisticsobjdef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1608 of file ruleutils.c.
References pg_get_statisticsobj_worker(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, and string_to_text().
Datum pg_get_statisticsobjdef_columns | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1637 of file ruleutils.c.
References pg_get_statisticsobj_worker(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, and string_to_text().
Datum pg_get_statisticsobjdef_expressions | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1838 of file ruleutils.c.
References accumArrayResult(), cstring_to_text(), CurrentMemoryContext, deparse_context_for(), deparse_expression_pretty(), get_relation_name(), GETSTRUCT(), heap_attisnull(), HeapTupleIsValid, lfirst, makeArrayResult(), NIL, ObjectIdGetDatum(), pfree(), PG_GETARG_OID, PG_RETURN_DATUM, PG_RETURN_NULL, PointerGetDatum(), PRETTYFLAG_INDENT, ReleaseSysCache(), SearchSysCache1(), str, stringToNode(), SysCacheGetAttrNotNull(), and TextDatumGetCString.
char * pg_get_statisticsobjdef_string | ( | Oid | statextid | ) |
Definition at line 1627 of file ruleutils.c.
References pg_get_statisticsobj_worker().
Referenced by RememberStatisticsForRebuilding().
Datum pg_get_triggerdef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 871 of file ruleutils.c.
References pg_get_triggerdef_worker(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, and string_to_text().
Datum pg_get_triggerdef_ext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 885 of file ruleutils.c.
References pg_get_triggerdef_worker(), PG_GETARG_BOOL, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, and string_to_text().
|
static |
Definition at line 900 of file ruleutils.c.
References AccessShareLock, deparse_context::appendparents, deparse_namespace::appendrels, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), attname, BTEqualStrategyNumber, deparse_context::buf, buf, deparse_context::colNamesVisible, deparse_namespace::ctes, DatumGetByteaPP, DatumGetName(), elog, ERROR, fastgetattr(), generate_function_name(), generate_qualified_relation_name(), generate_relation_name(), get_attname(), GET_PRETTY_FLAGS, get_rel_relkind(), get_rule_expr(), GETSTRUCT(), HeapTupleIsValid, i, deparse_context::indentLevel, deparse_context::inGroupBy, RangeTblEntry::inh, initStringInfo(), list_make1, list_make2, makeAlias(), makeNode, deparse_context::namespaces, NameStr, NIL, ObjectIdGetDatum(), OidIsValid, deparse_context::prettyFlags, PRETTYINDENT_STD, quote_identifier(), RelationData::rd_att, RangeTblEntry::relid, deparse_context::resultDesc, deparse_namespace::rtable, RTE_RELATION, RangeTblEntry::rtekind, ScanKeyInit(), set_rtable_names(), set_simple_column_names(), simple_quote_literal(), stringToNode(), deparse_namespace::subplans, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), deparse_context::targetList, TextDatumGetCString, value, VARDATA_ANY, deparse_context::varInOrderBy, deparse_context::varprefix, deparse_context::windowClause, WRAP_COLUMN_DEFAULT, and deparse_context::wrapColumn.
Referenced by pg_get_triggerdef(), and pg_get_triggerdef_ext().
Datum pg_get_userbyid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2795 of file ruleutils.c.
References GETSTRUCT(), HeapTupleIsValid, NAMEDATALEN, NameStr, ObjectIdGetDatum(), palloc(), PG_GETARG_OID, PG_RETURN_NAME, ReleaseSysCache(), SearchSysCache1(), and sprintf.
Datum pg_get_viewdef | ( | PG_FUNCTION_ARGS | ) |
Definition at line 678 of file ruleutils.c.
References pg_get_viewdef_worker(), PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, PRETTYFLAG_INDENT, string_to_text(), and WRAP_COLUMN_DEFAULT.
Datum pg_get_viewdef_ext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 697 of file ruleutils.c.
References GET_PRETTY_FLAGS, pg_get_viewdef_worker(), PG_GETARG_BOOL, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, string_to_text(), and WRAP_COLUMN_DEFAULT.
Datum pg_get_viewdef_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 736 of file ruleutils.c.
References makeRangeVarFromNameList(), NoLock, pg_get_viewdef_worker(), PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, PRETTYFLAG_INDENT, RangeVarGetRelid, string_to_text(), textToQualifiedNameList(), and WRAP_COLUMN_DEFAULT.
Datum pg_get_viewdef_name_ext | ( | PG_FUNCTION_ARGS | ) |
Definition at line 761 of file ruleutils.c.
References GET_PRETTY_FLAGS, makeRangeVarFromNameList(), NoLock, pg_get_viewdef_worker(), PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, RangeVarGetRelid, string_to_text(), textToQualifiedNameList(), and WRAP_COLUMN_DEFAULT.
|
static |
Definition at line 789 of file ruleutils.c.
References generate_unaccent_rules::args, buf, CStringGetDatum(), DirectFunctionCall1, elog, ERROR, initStringInfo(), make_viewdef(), namein(), ObjectIdGetDatum(), plan, plan_getviewrule, query_getviewrule, SPI_connect(), SPI_execute_plan(), SPI_finish(), SPI_keepplan(), SPI_OK_FINISH, SPI_OK_SELECT, SPI_prepare(), SPI_processed, SPI_tuptable, SPITupleTable::tupdesc, SPITupleTable::vals, and ViewSelectRuleName.
Referenced by pg_get_viewdef(), pg_get_viewdef_ext(), pg_get_viewdef_name(), pg_get_viewdef_name_ext(), and pg_get_viewdef_wrap().
Datum pg_get_viewdef_wrap | ( | PG_FUNCTION_ARGS | ) |
Definition at line 716 of file ruleutils.c.
References GET_PRETTY_FLAGS, pg_get_viewdef_worker(), PG_GETARG_INT32, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TEXT_P, and string_to_text().
|
static |
Definition at line 5331 of file ruleutils.c.
References deparse_namespace::ancestors, and list_free().
Referenced by get_name_for_var_field(), and get_parameter().
|
static |
Definition at line 5280 of file ruleutils.c.
References deparse_namespace::ancestors, and list_delete_first().
Referenced by get_name_for_var_field(), get_variable(), and resolve_special_varno().
|
static |
Definition at line 3298 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), buf, castNode, deparse_expression(), elog, ERROR, format_type_be(), get_func_arg_info(), GETSTRUCT(), HeapTupleIsValid, i, lfirst, list_head(), list_length(), lnext(), NIL, ObjectIdGetDatum(), pfree(), quote_identifier(), ReleaseSysCache(), SearchSysCache1(), str, stringToNode(), SysCacheGetAttr(), and TextDatumGetCString.
Referenced by pg_get_function_arguments(), pg_get_function_identity_arguments(), pg_get_functiondef(), and print_function_rettype().
|
static |
Definition at line 3260 of file ruleutils.c.
References appendBinaryStringInfo(), appendStringInfoChar(), appendStringInfoString(), buf, StringInfoData::data, format_type_be(), GETSTRUCT(), initStringInfo(), StringInfoData::len, print_function_arguments(), and resetStringInfo().
Referenced by pg_get_function_result(), and pg_get_functiondef().
|
static |
Definition at line 3556 of file ruleutils.c.
References AcquireRewriteLocks(), appendStringInfoChar(), appendStringInfoString(), deparse_namespace::argnames, buf, castNode, deparse_namespace::funcname, get_func_arg_info(), get_query_def(), GETSTRUCT(), IsA, lfirst_node, linitial, list_make1, NameStr, deparse_namespace::numargs, PRETTYFLAG_INDENT, proname, pstrdup(), stringToNode(), SysCacheGetAttrNotNull(), TextDatumGetCString, and WRAP_COLUMN_DEFAULT.
Referenced by pg_get_function_sqlbody(), and pg_get_functiondef().
|
static |
Definition at line 3458 of file ruleutils.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), buf, format_type_be(), get_func_trftypes(), and i.
Referenced by pg_get_functiondef().
|
static |
Definition at line 12989 of file ruleutils.c.
References appendStringInfoChar(), deparse_context::buf, buf, get_rule_expr(), lfirst, list_head(), lnext(), SubscriptingRef::reflowerindexpr, and SubscriptingRef::refupperindexpr.
Referenced by get_rule_expr(), and processIndirection().
|
static |
Definition at line 12911 of file ruleutils.c.
References appendStringInfo(), CoerceToDomain::arg, Assert(), deparse_context::buf, buf, COERCE_IMPLICIT_CAST, elog, ERROR, format_type_be(), get_attname(), get_typ_typrelid(), IsA, linitial, linitial_int, list_length(), FieldStore::newvals, OidIsValid, printSubscripts(), quote_identifier(), and SubscriptingRef::refassgnexpr.
Referenced by get_insert_query_def(), get_merge_query_def(), get_rule_expr(), and get_update_query_targetlist_def().
|
static |
Definition at line 5310 of file ruleutils.c.
References deparse_namespace::ancestors, lfirst, list_cell_number(), list_copy_tail(), plan, and set_deparse_plan().
Referenced by get_name_for_var_field(), and get_parameter().
|
static |
Definition at line 5263 of file ruleutils.c.
References deparse_namespace::ancestors, lcons(), deparse_namespace::plan, plan, and set_deparse_plan().
Referenced by get_name_for_var_field(), get_variable(), and resolve_special_varno().
const char * quote_identifier | ( | const char * | ident | ) |
Definition at line 13019 of file ruleutils.c.
References ident, palloc(), quote_all_identifiers, ScanKeywordCategories, ScanKeywordLookup(), ScanKeywords, and UNRESERVED_KEYWORD.
Referenced by add_cast_to(), appendFunctionName(), ATPrepAlterColumnType(), CheckMyDatabase(), copy_table(), createdb(), CreateSchemaCommand(), decompile_column_index_array(), deparseAnalyzeSql(), deparseColumnRef(), deparseOperatorName(), deparseRelation(), execute_extension_script(), ExplainIndexScanDetails(), ExplainNode(), ExplainTargetRel(), flatten_set_variable_args(), format_operator_extended(), generate_operator_clause(), generate_operator_name(), get_column_alias_list(), get_from_clause_coldeflist(), get_from_clause_item(), get_insert_query_def(), get_json_table(), get_json_table_columns(), get_json_table_nested_columns(), get_merge_query_def(), get_opclass_name(), get_parameter(), get_reloptions(), get_returning_clause(), get_rte_alias(), get_rule_expr(), get_rule_windowclause(), get_rule_windowspec(), get_select_query_def(), get_target_list(), get_update_query_targetlist_def(), get_utility_query_def(), get_variable(), get_windowfunc_expr_helper(), get_with_clause(), get_xmltable(), getObjectIdentityParts(), libpqrcv_alter_slot(), make_ruledef(), NameListToQuotedString(), old_9_6_invalidate_hash_indexes(), pg_get_constraintdef_worker(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), pg_get_triggerdef_worker(), pg_identify_object(), PLy_quote_ident(), postgresExplainForeignScan(), postgresImportForeignSchema(), print_function_arguments(), process_extension_updates(), processIndirection(), quote_ident(), quote_object_name(), quote_qualified_identifier(), regnamespaceout(), regoperout(), regroleout(), ReplicationSlotDropAtPubNode(), sepgsql_attribute_post_create(), sepgsql_database_post_create(), sepgsql_relation_post_create(), sepgsql_schema_post_create(), serialize_deflist(), set_frozenxids(), show_sortorder_options(), show_window_def(), text_format_string_conversion(), tuple_to_stringinfo(), and worker_spi_main().
char * quote_qualified_identifier | ( | const char * | qualifier, |
const char * | ident | ||
) |
Definition at line 13103 of file ruleutils.c.
References appendStringInfo(), appendStringInfoString(), buf, ident, initStringInfo(), and quote_identifier().
Referenced by check_default_text_search_config(), copy_table(), create_pg_locale(), format_procedure_extended(), format_type_extended(), generate_collation_name(), generate_function_name(), generate_qualified_relation_name(), generate_qualified_type_name(), generate_relation_name(), getObjectDescription(), getObjectIdentityParts(), getOpFamilyDescription(), getOpFamilyIdentity(), getRelationDescription(), getRelationIdentity(), pg_decode_change(), pg_decode_truncate(), pg_get_functiondef(), pg_get_statisticsobj_worker(), refresh_by_match_merge(), RefreshMatViewByOid(), regclassout(), regcollationout(), regconfigout(), regdictionaryout(), regprocout(), sepgsql_proc_post_create(), and transformColumnDefinition().
|
static |
Definition at line 9126 of file ruleutils.c.
References str.
Referenced by appendContextKeyword(), get_from_clause(), and get_target_list().
|
static |
Definition at line 7899 of file ruleutils.c.
References deparse_context::appendparents, bms_union(), callback(), check_stack_depth(), elog, ERROR, TargetEntry::expr, get_tle_by_resno(), deparse_namespace::index_tlist, INDEX_VAR, deparse_namespace::inner_plan, deparse_namespace::inner_tlist, INNER_VAR, IsA, list_length(), list_nth(), deparse_context::namespaces, deparse_namespace::outer_plan, deparse_namespace::outer_tlist, OUTER_VAR, deparse_namespace::plan, pop_child_plan(), push_child_plan(), resolve_special_varno(), deparse_namespace::rtable, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by get_agg_expr_helper(), get_variable(), and resolve_special_varno().
Definition at line 3855 of file ruleutils.c.
References deparse_namespace::appendrels, deparse_namespace::ctes, NIL, deparse_namespace::rtable, deparse_namespace::rtable_names, set_rtable_names(), and deparse_namespace::subplans.
Referenced by ExplainPrintPlan().
Definition at line 3825 of file ruleutils.c.
References deparse_namespace::ancestors, Assert(), IsA, linitial, list_length(), plan, deparse_namespace::ret_new_alias, deparse_namespace::ret_old_alias, and set_deparse_plan().
Referenced by show_expression(), show_grouping_sets(), show_memoize_info(), show_plan_tlist(), show_sort_group_keys(), show_tablesample(), show_window_def(), and show_window_keys().
|
static |
Definition at line 4029 of file ruleutils.c.
References deparse_namespace::appendrels, Query::cteList, deparse_namespace::ctes, forboth, has_dangerous_join_using(), Query::jointree, lappend(), lfirst, list_length(), NIL, palloc0(), deparse_namespace::ret_new_alias, deparse_namespace::ret_old_alias, deparse_namespace::rtable, Query::rtable, deparse_namespace::rtable_columns, RTE_JOIN, RangeTblEntry::rtekind, set_join_column_names(), set_relation_column_names(), set_rtable_names(), set_using_names(), deparse_namespace::subplans, and deparse_namespace::unique_using.
Referenced by get_name_for_var_field(), get_query_def(), and make_ruledef().
|
static |
Definition at line 5152 of file ruleutils.c.
References CMD_INSERT, CMD_MERGE, find_recursive_union(), deparse_namespace::index_tlist, deparse_namespace::inner_plan, deparse_namespace::inner_tlist, innerPlan, IsA, linitial, list_nth(), NIL, deparse_namespace::outer_plan, deparse_namespace::outer_tlist, outerPlan, deparse_namespace::plan, plan, deparse_namespace::subplans, and Plan::targetlist.
Referenced by push_ancestor_plan(), push_child_plan(), and set_deparse_context_plan().
|
static |
Definition at line 4578 of file ruleutils.c.
References add_to_names_hash(), Assert(), bms_add_member(), bms_is_member(), build_colinfo_names_hash(), deparse_columns::colnames, deparse_columns_fetch, destroy_colinfo_names_hash(), expand_colnames_array_to(), i, deparse_columns::is_new_col, j, deparse_columns::leftattnos, deparse_columns::leftrti, list_length(), list_nth(), make_colname_unique(), deparse_columns::new_colnames, deparse_columns::num_cols, deparse_columns::num_new_cols, palloc0(), deparse_columns::printaliases, deparse_columns::rightattnos, deparse_columns::rightrti, strVal, and deparse_columns::usingNames.
Referenced by set_deparse_for_query().
|
static |
Definition at line 4375 of file ruleutils.c.
References AccessShareLock, add_to_names_hash(), Assert(), build_colinfo_names_hash(), deparse_columns::colnames, destroy_colinfo_names_hash(), expand_colnames_array_to(), expandRTE(), RangeTblEntry::functions, i, deparse_columns::is_new_col, j, lfirst, list_length(), list_nth(), make_colname_unique(), NameStr, TupleDescData::natts, deparse_columns::new_colnames, NIL, deparse_columns::num_cols, deparse_columns::num_new_cols, palloc(), deparse_columns::printaliases, pstrdup(), relation_close(), relation_open(), RelationGetDescr, RangeTblEntry::relid, RTE_FUNCTION, RTE_RELATION, RTE_TABLEFUNC, RangeTblEntry::rtekind, strVal, TupleDescAttr(), and VAR_RETURNING_DEFAULT.
Referenced by set_deparse_for_query(), and set_simple_column_names().
|
static |
Definition at line 3884 of file ruleutils.c.
References bms_is_member(), CHECK_FOR_INTERRUPTS, NameHashEntry::counter, CurrentMemoryContext, HASHCTL::entrysize, get_rel_name(), HASH_CONTEXT, hash_create(), hash_destroy(), HASH_ELEM, HASH_ENTER, hash_search(), HASH_STRINGS, HASHCTL::hcxt, HASHCTL::keysize, lappend(), lfirst, list_length(), NAMEDATALEN, NIL, palloc(), pg_mbcliplen(), RangeTblEntry::relid, deparse_namespace::rtable, deparse_namespace::rtable_names, RTE_JOIN, RTE_RELATION, RangeTblEntry::rtekind, and sprintf.
Referenced by deparse_context_for(), pg_get_triggerdef_worker(), select_rtable_names_for_explain(), and set_deparse_for_query().
|
static |
Definition at line 4098 of file ruleutils.c.
References forboth, lappend(), lfirst, list_length(), NIL, palloc0(), deparse_namespace::rtable, deparse_namespace::rtable_columns, RTE_JOIN, RangeTblEntry::rtekind, and set_relation_column_names().
Referenced by deparse_context_for(), deparse_context_for_plan_tree(), and pg_get_triggerdef_worker().
|
static |
Definition at line 4210 of file ruleutils.c.
References Assert(), deparse_columns::colnames, deparse_columns_fetch, elog, ERROR, expand_colnames_array_to(), FromExpr::fromlist, i, identify_join_columns(), IsA, j, lappend(), deparse_columns::leftattnos, deparse_columns::leftrti, lfirst, list_copy(), list_length(), list_nth(), make_colname_unique(), nodeTag, deparse_columns::num_cols, deparse_columns::parentUsing, deparse_columns::rightattnos, deparse_columns::rightrti, rt_fetch, deparse_namespace::rtable, set_using_names(), strVal, deparse_namespace::unique_using, deparse_namespace::using_names, and deparse_columns::usingNames.
Referenced by set_deparse_for_query(), and set_using_names().
|
static |
Definition at line 11783 of file ruleutils.c.
References appendStringInfoChar(), buf, SQL_STR_DOUBLE, standard_conforming_strings, and val.
Referenced by get_const_expr(), get_reloptions(), get_rule_expr(), get_utility_query_def(), pg_get_functiondef(), and pg_get_triggerdef_worker().
|
static |
Definition at line 13565 of file ruleutils.c.
References cstring_to_text(), pfree(), and str.
Referenced by pg_get_constraintdef(), pg_get_constraintdef_ext(), pg_get_expr_worker(), pg_get_function_arg_default(), pg_get_function_arguments(), pg_get_function_identity_arguments(), pg_get_function_result(), pg_get_functiondef(), pg_get_indexdef(), pg_get_indexdef_ext(), pg_get_partition_constraintdef(), pg_get_partkeydef(), pg_get_ruledef(), pg_get_ruledef_ext(), pg_get_serial_sequence(), pg_get_statisticsobjdef(), pg_get_statisticsobjdef_columns(), pg_get_triggerdef(), pg_get_triggerdef_ext(), pg_get_viewdef(), pg_get_viewdef_ext(), pg_get_viewdef_name(), pg_get_viewdef_name_ext(), and pg_get_viewdef_wrap().
|
static |
Definition at line 333 of file ruleutils.c.
Referenced by pg_get_ruledef_worker().
|
static |
Definition at line 335 of file ruleutils.c.
Referenced by pg_get_viewdef_worker().
|
static |
Definition at line 334 of file ruleutils.c.
Referenced by pg_get_ruledef_worker().
|
static |
Definition at line 336 of file ruleutils.c.
Referenced by pg_get_viewdef_worker().
bool quote_all_identifiers = false |
Definition at line 339 of file ruleutils.c.
Referenced by main(), quote_identifier(), and setup_connection().