49#define MAX_CACHED_PATH_LEN 16
115 errmsg(
"postfix operators are not supported"),
120 errmsg(
"operator does not exist: %s",
150 if (oprright ==
NULL)
206 lt_opr = typentry->
lt_opr;
207 eq_opr = typentry->
eq_opr;
208 gt_opr = typentry->
gt_opr;
216 errmsg(
"could not identify an ordering operator for type %s",
218 errhint(
"Use an explicit ordering operator or modify the query.")));
222 errmsg(
"could not identify an equality operator for type %s",
476 errmsg(
"operator requires run-time type coercion: %s",
634 errmsg(
"operator is not unique: %s",
636 errdetail(
"Could not choose a best candidate operator."),
637 errhint(
"You might need to add explicit type casts."),
642 errmsg(
"operator does not exist: %s",
670 return errdetail(
"There is no operator of that name.");
672 return errdetail(
"An operator of that name exists, but it is not in the search_path.");
680 (
void)
errdetail(
"No operator of that name accepts the given argument type.");
681 return errhint(
"You might need to add an explicit type cast.");
685 (
void)
errdetail(
"No operator of that name accepts the given argument types.");
686 return errhint(
"You might need to add explicit type casts.");
721 errmsg(
"postfix operators are not supported")));
745 errmsg(
"operator is only a shell: %s",
788 result->opfuncid =
opform->oprcode;
789 result->opresulttype = rettype;
796 if (result->opretset)
805 return (
Expr *) result;
846 errmsg(
"op ANY/ALL (array) requires array on right side"),
858 errmsg(
"operator is only a shell: %s",
887 errmsg(
"op ANY/ALL (array) requires operator to yield boolean"),
892 errmsg(
"op ANY/ALL (array) requires operator not to return a set"),
912 errmsg(
"could not find array type for data type %s",
925 result->opfuncid =
opform->oprcode;
928 result->
useOr = useOr;
935 return (
Expr *) result;
#define RegProcedureIsValid(p)
#define Assert(condition)
#define MemSet(start, val, len)
#define OidIsValid(objectId)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, int64 nelem, const HASHCTL *info, int flags)
void * hash_seq_search(HASH_SEQ_STATUS *status)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
void CacheRegisterSyscacheCallback(int cacheid, SyscacheCallbackFunction func, Datum arg)
bool get_func_retset(Oid funcid)
Oid get_base_element_type(Oid typid)
Oid getBaseType(Oid typid)
Oid get_array_type(Oid typid)
Oid OpernameGetOprid(List *names, Oid oprleft, Oid oprright)
char * NameListToString(const List *names)
Oid LookupExplicitNamespace(const char *nspname, bool missing_ok)
void DeconstructQualifiedName(const List *names, char **nspname_p, char **objname_p)
FuncCandidateList OpernameGetCandidates(List *names, char oprkind, bool missing_schema_ok, int *fgc_flags)
int fetch_search_path_array(Oid *sarray, int sarray_len)
Oid exprType(const Node *expr)
Oid enforce_generic_type_consistency(const Oid *actual_arg_types, Oid *declared_arg_types, int nargs, Oid rettype, bool allow_poly)
bool IsBinaryCoercible(Oid srctype, Oid targettype)
void make_fn_arguments(ParseState *pstate, List *fargs, Oid *actual_arg_types, Oid *declared_arg_types)
FuncCandidateList func_select_candidate(int nargs, Oid *input_typeids, FuncCandidateList candidates)
void check_srf_call_placement(ParseState *pstate, Node *last_srf, int location)
int func_match_argtypes(int nargs, Oid *input_typeids, FuncCandidateList raw_candidates, FuncCandidateList *candidates)
void cancel_parser_errposition_callback(ParseCallbackState *pcbstate)
int parser_errposition(ParseState *pstate, int location)
void setup_parser_errposition_callback(ParseCallbackState *pcbstate, ParseState *pstate, int location)
static void InvalidateOprCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
static void make_oper_cache_entry(OprCacheKey *key, Oid opr_oid)
static FuncDetailCode oper_select_candidate(int nargs, Oid *input_typeids, FuncCandidateList candidates, Oid *operOid)
Operator left_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
void get_sort_group_operators(Oid argtype, bool needLT, bool needEQ, bool needGT, Oid *ltOpr, Oid *eqOpr, Oid *gtOpr, bool *isHashable)
#define MAX_CACHED_PATH_LEN
static int oper_lookup_failure_details(int fgc_flags, bool is_unary_op)
Expr * make_op(ParseState *pstate, List *opname, Node *ltree, Node *rtree, Node *last_srf, int location)
Oid LookupOperName(ParseState *pstate, List *opername, Oid oprleft, Oid oprright, bool noError, int location)
Expr * make_scalar_array_op(ParseState *pstate, List *opname, bool useOr, Node *ltree, Node *rtree, int location)
Oid oprfuncid(Operator op)
static bool make_oper_cache_key(ParseState *pstate, OprCacheKey *key, List *opname, Oid ltypeId, Oid rtypeId, int location)
static HTAB * OprCacheHash
static void op_error(ParseState *pstate, List *op, Oid arg1, Oid arg2, FuncDetailCode fdresult, int fgc_flags, int location)
Operator oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId, bool noError, int location)
static Oid binary_oper_exact(List *opname, Oid arg1, Oid arg2)
static Oid find_oper_cache_entry(OprCacheKey *key)
const char * op_signature_string(List *op, Oid arg1, Oid arg2)
Oid compatible_oper_opid(List *op, Oid arg1, Oid arg2, bool noError)
Operator compatible_oper(ParseState *pstate, List *op, Oid arg1, Oid arg2, bool noError, int location)
Oid LookupOperWithArgs(ObjectWithArgs *oper, bool noError)
Oid LookupTypeNameOid(ParseState *pstate, const TypeName *typeName, bool missing_ok)
static int list_length(const List *l)
#define linitial_node(type, l)
#define lsecond_node(type, l)
#define list_make2(x1, x2)
FormData_pg_operator * Form_pg_operator
size_t strlcpy(char *dst, const char *src, size_t siz)
static Datum ObjectIdGetDatum(Oid X)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void initStringInfo(StringInfo str)
Oid search_path[MAX_CACHED_PATH_LEN]
char oprname[NAMEDATALEN]
Oid args[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
#define TYPECACHE_HASH_PROC