mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Add new to_reg* functions for error-free OID lookups.
These functions won't throw an error if the object doesn't exist, or if (for functions and operators) there's more than one matching object. Yugo Nagata and Nozomi Anzai, reviewed by Amit Khandekar, Marti Raudsepp, Amit Kapila, and me.
This commit is contained in:
@ -407,7 +407,7 @@ oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId,
|
||||
FuncCandidateList clist;
|
||||
|
||||
/* Get binary operators of given name */
|
||||
clist = OpernameGetCandidates(opname, 'b');
|
||||
clist = OpernameGetCandidates(opname, 'b', false);
|
||||
|
||||
/* No operators found? Then fail... */
|
||||
if (clist != NULL)
|
||||
@ -553,7 +553,7 @@ right_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
|
||||
FuncCandidateList clist;
|
||||
|
||||
/* Get postfix operators of given name */
|
||||
clist = OpernameGetCandidates(op, 'r');
|
||||
clist = OpernameGetCandidates(op, 'r', false);
|
||||
|
||||
/* No operators found? Then fail... */
|
||||
if (clist != NULL)
|
||||
@ -631,7 +631,7 @@ left_oper(ParseState *pstate, List *op, Oid arg, bool noError, int location)
|
||||
FuncCandidateList clist;
|
||||
|
||||
/* Get prefix operators of given name */
|
||||
clist = OpernameGetCandidates(op, 'l');
|
||||
clist = OpernameGetCandidates(op, 'l', false);
|
||||
|
||||
/* No operators found? Then fail... */
|
||||
if (clist != NULL)
|
||||
|
Reference in New Issue
Block a user