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

Types prefix operator applications.

Rule: PG-PREFIX-TYPING-001. The parser folds - before a numeric constant, parenthesized or not, into a negative constant: it is integer from -2147483648, bigint from -9223372036854775808 and numeric beyond, and never NULL. Otherwise the catalog prefix operators keep a number or interval type for - and +, a number type for @, give double precision for |/ and ||/, keep an integer, bit string or inet type for ~ and tsquery for !!; any other operand or operator depends on a declaration (PG-OPERATOR-TYPING-001). The operators are strict. Termination: constant work. Source: https://www.postgresql.org/docs/17/functions-math.html, https://www.postgresql.org/docs/17/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS-NUMERIC. Status: Implemented.

Methods§

public function prefix(
    AnalysisContext $context,
    OperatorName $operator,
    ScalarFact $operand,
    Scalar $node,
): ScalarFact
public function negative(IntegerConstant|NumericConstant $value): Builtin

Answers the type of a negative numeric constant: integer from -2147483648, bigint from -9223372036854775808, numeric beyond.

Returns

Test cases 1
Called from 1
Calls 6

Test cases 3§

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

Dedicated tests 3

Relations§

Instantiated in 1
Method calls 1