classAlterOperator
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.
$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> $attributespublic OperatorSignature $operatorMethods§
public function __construct(
public OperatorSignature $operator,
list<AttributeChange> $attributes,
)Parameters
$operator | OperatorSignature | The operator |
$attributes | list<AttributeChange> | The changed attributes, read as ALTER OPERATOR reads them; at least one |
Calls 3
- static-call Check::listOf() line 49
- class-const AttributeChange::class() line 49
- static-call Check::input() line 51
public function deriveStatement(Derivation $derivation): voidDerives the operator and the attribute values; a postfix operator, which no longer exists, and the attributes the command refuses are reported.
Parameters
$derivation | Derivation |
Calls 8
- method-call Derivation::environment() line 60
- method-call OperatorSignature::deriveClause() line 61
- class-const OperatorArity::Postfix() line 62
- method-call Derivation::report() line 63
- new RoutineProblem line 63
- class-const RoutineProblemKind::PostfixOperator() line 63
- method-call ChangeChecks::derive() line 68
- new ChangeChecks line 68
public function render(Output $out): voidTest cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.