final class Tables
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

The entry point of the table family: tables, sequences, indexes, views, statistics, rules, triggers and policies.

Rule: PG-TABLE-001. Scope: the statements CreateStmt, CreateForeignTableStmt, CreateAsStmt, CreateMatViewStmt, RefreshMatViewStmt, ViewStmt, AlterTableStmt, IndexStmt, CreateSeqStmt, AlterSeqStmt, TruncateStmt, CreateStatsStmt, AlterStatsStmt, CreateAssertionStmt, CreateTrigStmt, CreateEventTrigStmt, AlterEventTrigStmt, RuleStmt, CreatePolicyStmt, AlterPolicyStmt, and the pieces other families share; each is lowered by the rule class named in its arm. Source: https://www.postgresql.org/docs/17/sql-commands.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function statement(Node $statement): Statement
public function other(Node $statement): Statement
public function columnQualifiers(Node $list): list<Clause>

Lowers ColQualList: the constraints and collation written after a column or domain type.

Parameters

$listNode

Returns

list<Clause>

Throws

ImplementationGap When the production has no rule
Calls 2
public function tableConstraint(Node $constraint): Constraint

Lowers TableConstraint.

Parameters

$constraintNode

Returns

Throws

ImplementationGap When the production has no rule
Calls 2
public function constraintAttributes(Node $attributes): list<ConstraintAttribute>

Lowers ConstraintAttributeSpec: DEFERRABLE, INITIALLY DEFERRED, NOT VALID, NO INHERIT and their opposites, in the order written.

Parameters

$attributesNode

Returns

Throws

ImplementationGap When the production has no rule
Calls 2
public function indexParameters(Node $parameters): list<IndexElement>

Lowers index_params: the columns and expressions of an index or a conflict target.

Parameters

$parametersNode

Returns

Calls 2
public function uniqueNullTreatment(Node $treatment): ?bool

Lowers opt_unique_null_treatment: true for NULLS DISTINCT, false for NULLS NOT DISTINCT, null when nothing is written.

Parameters

$treatmentNode

Returns

?bool

Throws

ImplementationGap When the production has no rule
Calls 1
public function columnDefault(Node $change): ?Scalar

Lowers alter_column_default: the expression of SET DEFAULT, or null for DROP DEFAULT.

Parameters

$changeNode

Returns

Throws

ImplementationGap When the production has no rule
Calls 2
public function predicate(Node $clause): ?Scalar

Lowers OptWhereClause: a predicate written WHERE ( expression ); no clause is null.

Parameters

$clauseNode

Returns

Throws

ImplementationGap When the production has no rule
Calls 2
public function persistence(Node $persistence): ?Node

Lowers OptTemp: the persistence written between CREATE and the object kind; none is null.

Parameters

$persistenceNode

Returns

Throws

ImplementationGap When the production has no rule
Calls 3
public function createTableAsExecute(Form $form, Statement $execute): Statement

Builds CREATE TABLE ... AS EXECUTE from the ExecuteStmt production that writes it and the lowered EXECUTE.

Parameters

$formForm
$executeStatement

Returns

Throws

ImplementationGap When the production has no rule
Calls 2

Private surface 1§

Implementation details, listed for orientation only.

private Lowering $lowering

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
Method calls 1
Type declarations 1