classIdentityColumns
final class IdentityColumns
Reports an identity column whose type is not smallint, integer or bigint.
Rule: PG-IDENTITY-TYPE-001. The server creates the identity sequence with the column's type, and the sequence accepts only int2, int4 and int8: any other built-in type, an array, a type with modifiers that is not one of the three and an interval with fields are reported ("identity column type must
- be smallint, integer, or bigint", init_params in sequence.c). A type known
by name only, a domain over an integer type included, depends on the catalog and is not reported; an invalid type name is reported where it is written. Source: https://www.postgresql.org/docs/17/sql-createtable.html, https://github.com/postgres/postgres/blob/REL_17_2/src/backend/commands/sequence.c. Status: Implemented.
Methods§
public function check(Derivation $derivation, ?TypeDescriptor $type): voidReports the identity type problem of a column of a declared type, or of no known type when null.
Parameters
$derivation | Derivation | |
$type | ?TypeDescriptor |
Test cases 2
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Alter\Column\AddIdentity::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Alter/Column/AddIdentity.php:63
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ColumnDefinition::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Element/ColumnDefinition.php:80
Calls 7
- function-call
in_arrayline 39 - class-const Builtin::Int2() line 39
- class-const Builtin::Int4() line 39
- class-const Builtin::Int8() line 39
- method-call Derivation::report() line 41
- new DefinitionProblem line 41
- class-const DefinitionRule::IdentityType() line 41
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Alter\Column\AddIdentity::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Alter/Column/AddIdentity.php:63
- new SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ColumnDefinition::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Element/ColumnDefinition.php:80
Method calls 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Alter\Column\AddIdentity::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Alter/Column/AddIdentity.php:63
- method-call SqlSemantics\Platform\PostgreSql\Statement\Table\Element\ColumnDefinition::deriveClause() packages/sql-semantics-postgres/src/Statement/Table/Element/ColumnDefinition.php:80