classAttachPartition
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.
$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 $partitionpublic PartitionBound $boundMethods§
public function __construct(public ParentTable $partition, public PartitionBound $bound)Parameters
$partition | ParentTable | The table that becomes a partition |
$bound | PartitionBound | Its bound |
public function deriveClause(Derivation $derivation, Environment $environment): voidResolves the partition and derives the bound.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 4
- method-call Derivation::target() line 44
- method-call Targets::resolve() line 44
- new Targets line 44
- method-call PartitionBound::deriveClause() line 45
public function render(Output $out): voidTest 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
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Command\AlterKinds::relationWide() packages/sql-semantics-postgres/src/Rules/Table/Command/AlterKinds.php:187
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Command\Alterations::admits() packages/sql-semantics-postgres/src/Rules/Table/Command/Alterations.php:164