#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_cast.h"
#include "catalog/pg_class.h"
#include "catalog/pg_inherits.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "parser/parse_coerce.h"
#include "parser/parse_relation.h"
#include "parser/parse_type.h"
#include "utils/builtins.h"
#include "utils/datum.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
Go to the source code of this file.
Definition at line 838 of file parse_coerce.c.
References CoerceViaIO::arg, ArrayCoerceExpr::arg, generate_unaccent_rules::args, Assert(), BoolGetDatum(), coerce_to_target_type(), COERCION_EXPLICIT, COERCION_PATH_ARRAYCOERCE, COERCION_PATH_COERCEVIAIO, COERCION_PATH_FUNC, ArrayCoerceExpr::elemexpr, elog, ERROR, exprType(), exprTypmod(), get_element_type(), getBaseTypeAndTypmod(), GETSTRUCT(), HeapTupleIsValid, Int32GetDatum(), InvalidOid, lappend(), list_make1, FuncExpr::location, CoerceViaIO::location, ArrayCoerceExpr::location, makeConst(), makeFuncExpr(), makeNode, ObjectIdGetDatum(), OidIsValid, ReleaseSysCache(), CoerceViaIO::resulttype, ArrayCoerceExpr::resulttype, SearchSysCache1(), and CaseTestExpr::typeId.
Referenced by coerce_type(), and coerce_type_typmod().
Definition at line 558 of file parse_coerce.c.
References check_generic_type_consistency(), COERCION_PATH_NONE, find_coercion_pathway(), i, is_complex_array(), ISCOMPLEX, typeInheritsFrom(), and typeIsOfTypedTable().
Referenced by ATAddForeignKeyConstraint(), coerce_to_common_type(), coerce_to_target_type(), func_match_argtypes(), func_select_candidate(), jsonb_subscript_transform(), select_common_type(), select_common_type_from_oids(), transformFrameOffset(), verify_common_type(), and verify_common_type_from_oids().
Definition at line 1738 of file parse_coerce.c.
References Assert(), FUNC_MAX_ARGS, get_element_type(), get_multirange_range(), get_range_subtype(), getBaseType(), InvalidOid, j, OidIsValid, select_common_type_from_oids(), type_is_array_domain, type_is_enum(), and verify_common_type_from_oids().
Referenced by can_coerce_type().
Definition at line 2953 of file parse_coerce.c.
References _, i, and pstrdup().
Referenced by AggregateCreate(), and ProcedureCreate().
Definition at line 2876 of file parse_coerce.c.
References _, format_type_be(), i, and psprintf().
Referenced by AggregateCreate(), and ProcedureCreate().
Definition at line 1272 of file parse_coerce.c.
References COERCE_IMPLICIT_CAST, coerce_to_domain(), COERCION_IMPLICIT, getBaseTypeAndTypmod(), and makeConst().
Referenced by expand_insert_targetlist(), ReplaceVarFromTargetList(), rewriteTargetListIU(), and rewriteValuesRTE().
Definition at line 1011 of file parse_coerce.c.
References arg, generate_unaccent_rules::args, RowExpr::args, COERCE_IMPLICIT_CAST, coerce_to_domain(), coerce_to_target_type(), ereport, errcode(), errdetail(), errmsg(), ERROR, expandNSItemVars(), exprType(), format_type_be(), getBaseTypeAndTypmod(), GetNSItemByRangeTablePosn(), i, InvalidAttrNumber, InvalidOid, IsA, lappend(), lfirst, list_head(), lnext(), RowExpr::location, lookup_rowtype_tupdesc(), makeNode, makeNullConst(), TupleDescData::natts, NIL, parser_coercion_errposition(), ReleaseTupleDesc, and TupleDescAttr().
Referenced by coerce_type().
Definition at line 1160 of file parse_coerce.c.
References COERCE_IMPLICIT_CAST, coerce_to_target_type(), COERCION_ASSIGNMENT, ereport, errcode(), errmsg(), ERROR, expression_returns_set(), exprLocation(), exprType(), format_type_be(), and parser_errposition().
Referenced by cookConstraint(), DoCopy(), domainAddCheckConstraint(), transformAExprIn(), transformBooleanTest(), transformBoolExpr(), transformCaseExpr(), transformJoinUsingClause(), transformWhereClause(), and transformXmlExpr().
Definition at line 1573 of file parse_coerce.c.
References can_coerce_type(), COERCE_IMPLICIT_CAST, coerce_type(), COERCION_IMPLICIT, ereport, errcode(), errmsg(), ERROR, exprLocation(), exprType(), format_type_be(), and parser_errposition().
Referenced by analyzeCTE(), generate_setop_tlist(), transformAExprIn(), transformArrayExpr(), transformCaseExpr(), transformCoalesceExpr(), transformMinMaxExpr(), transformSetOperationTree(), and transformValuesClause().
Definition at line 676 of file parse_coerce.c.
References arg, CoerceToDomain::arg, Assert(), COERCE_IMPLICIT_CAST, coerce_type_typmod(), hide_coercion_node(), CoerceToDomain::location, makeNode, OidIsValid, and CoerceToDomain::resulttype.
Referenced by coerce_null_to_domain(), coerce_record_to_complex(), coerce_type(), and transformAssignmentIndirection().
Definition at line 1256 of file parse_coerce.c.
References coerce_to_specific_type_typmod().
Referenced by coerceJsonFuncExpr(), interpret_function_parameter_list(), transformFrameOffset(), transformJsonScalarExpr(), transformJsonValueExpr(), transformLimitClause(), transformRangeTableFunc(), transformRangeTableSample(), transformXmlExpr(), and transformXmlSerialize().
Definition at line 1207 of file parse_coerce.c.
References COERCE_IMPLICIT_CAST, coerce_to_target_type(), COERCION_ASSIGNMENT, ereport, errcode(), errmsg(), ERROR, expression_returns_set(), exprLocation(), exprType(), format_type_be(), and parser_errposition().
Referenced by coerce_to_specific_type(), and transformRangeTableFunc().
Definition at line 79 of file parse_coerce.c.
References arg, CollateExpr::arg, can_coerce_type(), coerce_type(), coerce_type_typmod(), CollateExpr::collOid, IsA, CollateExpr::location, makeNode, and type_is_collatable().
Referenced by array_subscript_transform(), ATExecAddColumn(), ATExecAlterColumnType(), ATPrepAlterColumnType(), build_coercion_expression(), build_column_default(), coerce_fn_result_column(), coerce_record_to_complex(), coerce_to_boolean(), coerce_to_specific_type_typmod(), coerceJsonFuncExpr(), cookDefault(), EvaluateParams(), get_cast_hashentry(), hstore_subscript_transform(), transformArrayExpr(), transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), transformJsonBehavior(), transformJsonFuncExpr(), transformJsonParseArg(), transformJsonValueExpr(), transformPartitionBoundValue(), transformPLAssignStmtTarget(), transformTypeCast(), and transformXmlSerialize().
Definition at line 158 of file parse_coerce.c.
References ConvertRowtypeExpr::arg, CollateExpr::arg, build_coercion_expression(), cancel_parser_errposition_callback(), COERCE_IMPLICIT_CAST, coerce_record_to_complex(), coerce_to_domain(), coerce_type(), COERCION_PATH_NONE, COERCION_PATH_RELABELTYPE, CollateExpr::collOid, Const::consttype, DatumGetCString(), datumIsEqual(), elog, ERROR, find_coercion_pathway(), format_type_be(), getBaseType(), getBaseTypeAndTypmod(), InvalidOid, is_complex_array(), IsA, ISCOMPLEX, RelabelType::location, ConvertRowtypeExpr::location, CollateExpr::location, makeNode, makeRelabelType(), ParseState::p_coerce_param_hook, PG_DETOAST_DATUM, PointerGetDatum(), ReleaseSysCache(), ConvertRowtypeExpr::resulttype, setup_parser_errposition_callback(), stringTypeDatum(), type_is_collatable(), typeByVal(), typeidType(), typeInheritsFrom(), typeIsOfTypedTable(), typeLen(), typeTypeCollation(), typeTypeName(), and WARNING.
Referenced by addTargetToGroupList(), addTargetToSortList(), buildMergedJoinVar(), coerce_to_common_type(), coerce_to_target_type(), coerce_type(), jsonb_subscript_transform(), make_fn_arguments(), ParseFuncOrColumn(), resolveTargetListUnknowns(), transformArrayExpr(), and unify_hypothetical_args().
Definition at line 752 of file parse_coerce.c.
References applyRelabelType(), build_coercion_expression(), COERCION_PATH_NONE, exprCollation(), exprTypmod(), find_typmod_coercion_function(), and hide_coercion_node().
Referenced by coerce_to_domain(), and coerce_to_target_type().
Definition at line 2132 of file parse_coerce.c.
References Assert(), ereport, errcode(), errdetail(), errmsg(), errmsg_internal(), ERROR, format_type_be(), FUNC_MAX_ARGS, get_array_type(), get_element_type(), get_multirange_range(), get_range_multirange(), get_range_subtype(), getBaseType(), InvalidOid, j, OidIsValid, select_common_type_from_oids(), type_is_array_domain, type_is_enum(), and verify_common_type_from_oids().
Referenced by lookup_agg_function(), make_op(), make_scalar_array_op(), ParseFuncOrColumn(), recheck_cast_function_args(), and resolve_aggregate_transtype().
Definition at line 3154 of file parse_coerce.c.
References COERCION_ASSIGNMENT, COERCION_EXPLICIT, COERCION_IMPLICIT, COERCION_PATH_ARRAYCOERCE, COERCION_PATH_COERCEVIAIO, COERCION_PATH_FUNC, COERCION_PATH_NONE, COERCION_PATH_RELABELTYPE, COERCION_PLPGSQL, elog, ERROR, find_coercion_pathway(), get_element_type(), getBaseType(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), OidIsValid, ReleaseSysCache(), SearchSysCache2(), and TypeCategory().
Referenced by can_coerce_type(), coerce_type(), find_coercion_pathway(), findFkeyCast(), func_get_detail(), json_categorize_type(), and ri_HashCompareOp().
Definition at line 3317 of file parse_coerce.c.
References COERCION_PATH_ARRAYCOERCE, COERCION_PATH_FUNC, COERCION_PATH_NONE, GETSTRUCT(), HeapTupleIsValid, InvalidOid, ObjectIdGetDatum(), OidIsValid, ReleaseSysCache(), SearchSysCache2(), and typeidType().
Referenced by coerce_type_typmod().
Definition at line 810 of file parse_coerce.c.
References COERCE_IMPLICIT_CAST, elog, ERROR, IsA, and nodeTag.
Referenced by coerce_to_domain(), and coerce_type_typmod().
Definition at line 3367 of file parse_coerce.c.
References get_element_type(), ISCOMPLEX, and OidIsValid.
Referenced by can_coerce_type(), coerce_type(), and IsBinaryCoercibleWithCast().
Definition at line 3031 of file parse_coerce.c.
References IsBinaryCoercibleWithCast().
Referenced by AggregateCreate(), binary_coercible(), check_amproc_signature(), compatible_oper(), ExecInitAgg(), findRangeSubOpclass(), GetDefaultOpClass(), initialize_peragg(), lookup_agg_function(), ResolveOpClass(), ri_HashCompareOp(), satisfies_hash_partition(), spgGetCache(), ts_stat_sql(), tsvector_update_trigger(), and tupledesc_match().
Definition at line 3046 of file parse_coerce.c.
References getBaseType(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, is_complex_array(), ISCOMPLEX, ObjectIdGetDatum(), OidIsValid, ReleaseSysCache(), SearchSysCache2(), type_is_array, type_is_enum(), type_is_multirange(), and type_is_range().
Referenced by CreateCast(), and IsBinaryCoercible().
Definition at line 2996 of file parse_coerce.c.
References get_type_category_preferred(), and type.
Referenced by func_select_candidate(), and GetDefaultOpClass().
Definition at line 1313 of file parse_coerce.c.
References exprLocation(), and parser_errposition().
Referenced by coerce_record_to_complex(), coerceJsonFuncExpr(), and transformTypeCast().
Definition at line 1343 of file parse_coerce.c.
References Assert(), can_coerce_type(), COERCION_IMPLICIT, ereport, errcode(), errmsg(), ERROR, exprLocation(), exprType(), for_each_cell, format_type_be(), get_type_category_preferred(), getBaseType(), InvalidOid, lfirst, linitial, list_second_cell(), NIL, and parser_errposition().
Referenced by analyzeCTE(), buildMergedJoinVar(), transformAExprIn(), transformArrayExpr(), transformCaseExpr(), transformCoalesceExpr(), transformMinMaxExpr(), transformSetOperationTree(), transformValuesClause(), and unify_hypothetical_args().
Definition at line 1479 of file parse_coerce.c.
References Assert(), can_coerce_type(), COERCION_IMPLICIT, ereport, errcode(), errmsg(), ERROR, format_type_be(), get_type_category_preferred(), getBaseType(), i, and InvalidOid.
Referenced by check_generic_type_consistency(), and enforce_generic_type_consistency().
Definition at line 1645 of file parse_coerce.c.
References exprType(), exprTypmod(), and lfirst.
Referenced by analyzeCTE(), buildMergedJoinVar(), transformSetOperationTree(), transformValuesClause(), and unify_hypothetical_args().
Definition at line 2977 of file parse_coerce.c.
References Assert(), get_type_category_preferred(), and type.
Referenced by find_coercion_pathway(), func_get_detail(), func_select_candidate(), GetDefaultOpClass(), and transformJsonBehavior().
Definition at line 3381 of file parse_coerce.c.
References elog, ERROR, GETSTRUCT(), HeapTupleIsValid, ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache1(), and typeOrDomainTypeRelid().
Referenced by can_coerce_type(), and coerce_type().
Definition at line 1607 of file parse_coerce.c.
References can_coerce_type(), COERCION_IMPLICIT, exprType(), and lfirst.
Referenced by transformAExprIn().
Definition at line 1627 of file parse_coerce.c.
References can_coerce_type(), COERCION_IMPLICIT, and i.
Referenced by check_generic_type_consistency(), and enforce_generic_type_consistency().