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

Reports a relation whose persistence does not suit the schema written on its name.

Rule: PG-CREATION-SCHEMA-001. The server adjusts the persistence of a new table, view, sequence or materialized view to its schema (RangeVarAdjustRelationPersistence, namespace.c): a temporary relation written in a schema that is not a temporary schema is an error ("cannot

  • create temporary relation in non-temporary schema"); an unlogged relation

in pg_temp, the session's temporary schema, is an error ("only temporary

  • relations may be created in temporary schemas"); a permanent relation in

pg_temp becomes temporary. Schemas named pg_temp_N or pg_toast_temp_N are temporary schemas whose owner session the statement does not tell, so they are not reported. The schema itself is assumed to exist; the server reports a missing schema first. Source: https://www.postgresql.org/docs/17/sql-createtable.html, https://github.com/postgres/postgres/blob/REL_17_2/src/backend/catalog/namespace.c. Status: Implemented.

Methods§

public function check(
    Derivation $derivation,
    QualifiedName $written,
    Persistence $persistence,
): void

Reports the persistence problem of a relation created under a written name.

Parameters

$derivationDerivation
$writtenQualifiedName
$persistencePersistence
Test cases 3
Called from 6
Calls 7

Test cases 3§

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

Dedicated tests 3

Relations§

Instantiated in 6
Method calls 6