final class RoutineMatch
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

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>}|null

Answers the row a call of a catalog function resolves to, or null when it is not certain.

Parameters

$namestring
$argumentslist<string>The catalog type names of the arguments
$catalogOnlyboolWhether `pg_catalog` alone is searched

Returns

array{string, string, string, list<string>}|null
Test cases 2
Called from 1
Calls 7
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

$candidateslist<array{string, string, string, list<string>}>
$argumentslist<string>

Returns

list<array{string, string, string, list<string>}>
Test cases 1
Called from 1
public function single(list<array{string, string, string, list<string>}> $candidates): array{string, string, string, list<string>}|null

Answers the only candidate, or null when there is none or several.

Parameters

$candidateslist<array{string, string, string, list<string>}>

Returns

array{string, string, string, list<string>}|null
Test cases 1
Called from 1
Calls 1

Test cases 4§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4

Relations§

Instantiated in 1
Method calls 1