final class Subscripting
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Types the steps of an indirection applied to a value.

Rule: PG-SUBSCRIPT-001. A run of subscripts on an array yields its element type, and the array type itself when a step of the run is a slice; a subscript of jsonb yields jsonb and of point a double precision coordinate; another catalog type has no subscripting. A field selection reads the field of a composite value; a field it lacks and a value that is not composite are reported. .* ends an indirection and stands for the whole value; written before another step it is improper, as it is after a dotted relation name. A value of a type that depends on declarations makes every step depend on them. A subscript can be out of range, so its result can be NULL; a field is NULL when its value or the composite is. Termination: one pass over the steps. Source: https://www.postgresql.org/docs/17/arrays.html#ARRAYS-ACCESSING, https://www.postgresql.org/docs/17/datatype-json.html#JSONB-SUBSCRIPTING, https://www.postgresql.org/docs/17/rowtypes.html#ROWTYPES-ACCESSING. Status: Implemented.

Methods§

public function apply(
    Derivation $derivation,
    ScalarFact $base,
    non-empty-list<IndirectionStep> $steps,
    bool $star,
): ScalarFact
public function subscript(
    Derivation $derivation,
    Known $type,
    non-empty-list<IndirectionStep> $run,
): TypeFact
public function problem(Derivation $derivation, Diagnostic $problem): ScalarFact

Test cases 5§

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

Dedicated tests 5

Relations§

Instantiated in 1
Method calls 1