final class AlterOperator
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

ALTER OPERATOR operator (types) SET ( attribute = value, ... ): changes attributes of an operator.

Mirrors PostgreSQL's AlterOperatorStmt. Each attribute is read as AlterOperator reads it (PG-ALTER-ATTRIBUTE-001); a value written NONE removes the attribute's function, and PostgreSQL 17 also accepts an attribute without a value. Source: https://www.postgresql.org/docs/17/sql-alteroperator.html.

Reading the changed attributesdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER OPERATOR = (int4, int4) SET (restrict = NONE)');
    $operation->statement->attributes[0]->attribute->name->value // => 'restrict'

Properties§

public non-empty-list<AttributeChange> $attributes
public OperatorSignature $operator

Methods§

public function __construct(
    public OperatorSignature $operator,
    list<AttributeChange> $attributes,
)

Parameters

$operatorOperatorSignatureThe operator
$attributeslist<AttributeChange>The changed attributes, read as ALTER OPERATOR reads them; at least one
Calls 3
public function deriveStatement(Derivation $derivation): void

Derives the operator and the attribute values; a postfix operator, which no longer exists, and the attributes the command refuses are reported.

Parameters

$derivationDerivation
Calls 8
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 1

Test cases 3§

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

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 1