final class AlterConstraint
    implements AlterCommand
    uses Snapshot
Public API: explicitly declared with @visibility public.

ALTER CONSTRAINT: changes the deferral attributes of a constraint.

Mirrors AT_AlterConstraint. The server accepts this only for foreign keys; the conflicts of the attributes are checked by PG-CONSTRAINT-ATTRIBUTES-001. Source: https://www.postgresql.org/docs/17/sql-altertable.html.

Changing the deferral of a constraintdoctest
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t ALTER CONSTRAINT fk DEFERRABLE INITIALLY DEFERRED');
    $statement->toString() // => 'ALTER TABLE t ALTER CONSTRAINT fk DEFERRABLE INITIALLY DEFERRED'

Properties§

public list<ConstraintAttribute> $attributes
public Name $name

Methods§

public function __construct(public Name $name, list<ConstraintAttribute> $attributes)

Parameters

$nameNameThe constraint
$attributeslist<ConstraintAttribute>The attributes in the order written
Calls 2
public function deriveClause(Derivation $derivation, Environment $environment): void

Checks the attributes.

Parameters

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

Writes the action.

Parameters

$outOutput
Calls 3

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Type checks 1