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

ATTACH PARTITION: makes a table a partition of the altered partitioned table.

Mirrors AT_AttachPartition with a PartitionCmd. The partition is resolved and is the relation fact of its node; the bound values see no column. Source: https://www.postgresql.org/docs/17/sql-altertable.html.

Attaching a partitiondoctest
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE p ATTACH PARTITION p1 FOR VALUES IN (1)');
    $statement->toString() // => 'ALTER TABLE p ATTACH PARTITION p1 FOR VALUES IN (1)'

Properties§

public ParentTable $partition

Methods§

public function __construct(public ParentTable $partition, public PartitionBound $bound)

Parameters

$partitionParentTableThe table that becomes a partition
$boundPartitionBoundIts bound
public function deriveClause(Derivation $derivation, Environment $environment): void

Resolves the partition and derives the bound.

Parameters

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

Writes the action.

Parameters

$outOutput
Calls 1

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 2