classRoutineMatch
final class RoutineMatch
Selects the pg_catalog function a call certainly resolves to, from the argument types.
Rule: PG-ROUTINE-MATCH-001. With every schema searched (an unqualified name), a function of the user with exactly the argument types beats any function that needs a conversion, wherever it lies on the path, so only an exact match is certain: each argument has exactly the parameter type, and a string constant or NULL meets a text parameter, the preferred type of the string category every candidate is narrowed to. With pg_catalog alone searched (a name qualified with pg_catalog, and the SQL-syntax functions the server calls as pg_catalog.name), the candidates are those whose parameters the arguments reach by implicit casts; when several remain, the ones taking text where an argument is a string constant or NULL are preferred; a single remaining candidate decides the call. Several remaining candidates are left undecided: the server applies further preferences or reports an ambiguity, and this table does not model them. Anything else is left to the routine's declaration. Source: https://www.postgresql.org/docs/17/typeconv-func.html. Termination: one pass over the rows. Status: Implemented.
Methods§
public function find(
string $name,
list<string> $arguments,
bool $catalogOnly,
): array{string, string, string, list<string>}|nullAnswers the row a call of a catalog function resolves to, or null when it is not certain.
Parameters
$name | string | |
$arguments | list<string> | The catalog type names of the arguments |
$catalogOnly | bool | Whether `pg_catalog` alone is searched |
Returns
array{string, string, string, list<string>}|nullTest cases 2
Called from 1
Calls 7
- new Coercions line 40
- method-call Signatures::rows() line 42
- new Signatures line 42
- function-call
countline 43 - method-call Coercions::implicit() line 51
- method-call RoutineMatch::single() line 61
- method-call RoutineMatch::preferred() line 61
public function preferred(
list<array{string, string, string, list<string>}> $candidates,
list<string> $arguments,
): list<array{string, string, string, list<string>}>Keeps the candidates that take text at every position of an argument of type unknown, when there are such candidates.
Parameters
$candidates | list<array{string, string, string, list<string>}> | |
$arguments | list<string> |
Returns
list<array{string, string, string, list<string>}>Test cases 1
public function single(list<array{string, string, string, list<string>}> $candidates): array{string, string, string, list<string>}|nullAnswers the only candidate, or null when there is none or several.
Parameters
$candidates | list<array{string, string, string, list<string>}> |
Returns
array{string, string, string, list<string>}|nullTest cases 1
Called from 1
Calls 1
- function-call
countline 97
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.