classTables
final class Tables
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§
Lowers a statement of the family, such as CreateStmt, AlterTableStmt, IndexStmt or ViewStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 13
- method-call IndexRule::statement() line 50
- new IndexRule line 50
- method-call CreateTableRule::statement() line 51
- new CreateTableRule line 51
- method-call CreateTableRule::foreign() line 52
- method-call CreateAsRule::tableAs() line 53
- new CreateAsRule line 53
- method-call CreateAsRule::materializedView() line 54
- method-call CreateAsRule::refresh() line 55
- method-call CreateAsRule::view() line 56
- method-call AlterTableRule::statement() line 57
- new AlterTableRule line 57
- method-call Tables::other() line 58
Lowers the statements of the family other than tables, indexes and views: sequences, triggers, rules, policies, statistics, TRUNCATE.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 18
- method-call SequenceRule::create() line 70
- new SequenceRule line 70
- method-call SequenceRule::alter() line 71
- method-call MaintenanceRule::truncate() line 72
- new MaintenanceRule line 72
- method-call MaintenanceRule::statistics() line 73
- method-call MaintenanceRule::alterStatistics() line 74
- method-call MaintenanceRule::assertion() line 75
- method-call TriggerRule::trigger() line 76
- new TriggerRule line 76
- method-call TriggerRule::eventTrigger() line 77
- method-call TriggerRule::alterEventTrigger() line 78
- method-call RewriteRule::rule() line 79
- new RewriteRule line 79
- method-call PolicyRule::create() line 80
- new PolicyRule line 80
- method-call PolicyRule::alter() line 81
- static-call ImplementationGap::production() line 82
Lowers ColQualList: the constraints and collation written after a column or domain type.
Parameters
$list | Node |
Returns
list<Clause>Throws
ImplementationGap When the production has no ruleCalls 2
- method-call ColumnRule::qualifiers() line 95
- new ColumnRule line 95
public function tableConstraint(Node $constraint): ConstraintLowers TableConstraint.
Parameters
$constraint | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalls 2
- method-call ConstraintRule::tableConstraint() line 105
- new ConstraintRule line 105
public function constraintAttributes(Node $attributes): list<ConstraintAttribute>Lowers ConstraintAttributeSpec: DEFERRABLE, INITIALLY DEFERRED, NOT VALID, NO INHERIT and their opposites, in the order written.
Parameters
$attributes | Node |
Returns
list<ConstraintAttribute>Throws
ImplementationGap When the production has no ruleCalls 2
- method-call ConstraintRule::attributes() line 117
- new ConstraintRule line 117
public function indexParameters(Node $parameters): list<IndexElement>Lowers index_params: the columns and expressions of an index or a conflict target.
Parameters
$parameters | Node |
Returns
list<IndexElement>Calls 2
- method-call IndexRule::indexParameters() line 127
- new IndexRule line 127
public function uniqueNullTreatment(Node $treatment): ?boolLowers opt_unique_null_treatment: true for NULLS DISTINCT, false for NULLS NOT DISTINCT, null when nothing is written.
Parameters
$treatment | Node |
Returns
?boolThrows
ImplementationGap When the production has no ruleCalls 1
- static-call ImplementationGap::production() line 143
Lowers alter_column_default: the expression of SET DEFAULT, or null for DROP DEFAULT.
Parameters
$change | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalls 2
- method-call AlterCommandRule::defaultValue() line 154
- new AlterCommandRule line 154
Lowers OptWhereClause: a predicate written WHERE ( expression ); no clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalls 2
- method-call IndexRule::predicate() line 164
- new IndexRule line 164
Lowers OptTemp: the persistence written between CREATE and the object kind; none is null.
Parameters
$persistence | Node |
Returns
?NodeThrows
ImplementationGap When the production has no ruleCalls 3
- method-call CreateTableRule::persistence() line 174
- new CreateTableRule line 174
- class-const Persistence::Permanent() line 176
Builds CREATE TABLE ... AS EXECUTE from the ExecuteStmt production that writes it and the lowered EXECUTE.
Returns
Throws
ImplementationGap When the production has no ruleCalls 2
- method-call CreateAsRule::tableAsExecute() line 186
- new CreateAsRule line 186
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
TablesTestcalls