final class Targets
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

Resolves the relation a definition or command names, and builds the scope its expressions see.

Rule: PG-TABLE-TARGET-001. The name resolves by CORE-TABLE-LOOKUP-001 along the search path (the temporary schema and pg_catalog first). A declared relation contributes one slot per declared column, in order, each referring to the declaration, and an open shape when its column list is incomplete; an undeclared or conditionally resolved name contributes an open shape that names the missing declaration; a missing or conflicting name contributes an empty shape and is a diagnostic, except that a missing relation of a statement written with IF EXISTS is no error ("a notice is

  • issued instead"). The implicit columns

of a declaration (the system columns) are found by name only. The scope of a definition's expressions has that relation as its only visible relation, named by the relation name. Source: https://www.postgresql.org/docs/17/ddl-schemas.html#DDL-SCHEMAS-PATH, https://www.postgresql.org/docs/17/ddl-system-columns.html. Termination: one pass over the columns. Status: Implemented.

Methods§

public function resolve(Derivation $derivation, QualifiedName $name): RelationFact

Resolves the name of an existing relation and answers its facts.

Parameters

$derivationDerivation
$nameQualifiedName
Test cases 2
Called from 26
Calls 5
public function existing(
    Derivation $derivation,
    QualifiedName $name,
    bool $ifExists,
): RelationFact

Resolves the relation of a statement that may be written with IF EXISTS.

With IF EXISTS a relation that does not exist is not an error: the server issues a notice and skips the statement. The actions then have no relation to be checked against, so the shape is open on the declaration of the named relation and nothing is reported.

Parameters

$derivationDerivation
$nameQualifiedName
$ifExistsbool
Test cases 1
Called from 2
Calls 4
public function scope(
    Derivation $derivation,
    Relation $relation,
    QualifiedName $name,
    RowShape $shape,
    list<ImplicitSlot> $implicit = [],
    Name|null $alias = null,
): Environment

Test cases 5§

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

Dedicated tests 4
Other tests reaching this symbol 1

Relations§

Instantiated in 30
Method calls 39