final class DefinitionProblem
    implements Diagnostic
    uses Snapshot
Public API: explicitly declared with @visibility public.

A definition of a table, index, view, sequence, trigger, rule or policy that PostgreSQL rejects.

Reading the problem of a stored generated columndoctest
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLE t (a int, b int GENERATED BY DEFAULT AS (a) STORED)') // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\SemanticException: for a generated column, GENERATED ALWAYS must be specified
Refusing a relation for a rule that names nonedoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\DefinitionProblem(\SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\DefinitionRule::DuplicateColumn, new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('a'), new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('t')) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public Name|null $subject = null
public Name|null $relation = null

Methods§

public function __construct(
    public DefinitionRule $rule,
    public Name|null $subject = null,
    public Name|null $relation = null,
)

Parameters

$ruleDefinitionRuleThe broken rule
$subjectName|nullThe name the problem is about, for the rules that name one
$relationName|nullThe relation of the subject, for the rules that name both
Calls 2
public function message(): string

Describes the broken rule in the words of PostgreSQL.

Returns

string
Test cases 1
Calls 2

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 3

Relations§

Instantiated in 44