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

An element of CREATE SCHEMA as the server reads it: created in the new schema, with that schema searched first.

Rule: PG-SCHEMA-ELEMENT-001. Scope: the schema_stmt elements of CreateSchemaStmt. The server sets the search path to the new schema followed by the previous path while it runs the elements ("the

  • subcommands are treated essentially the same as separate commands issued
  • after creating the schema, except that ... the search path is ... the new
  • schema first"), so an unqualified name in an element finds an object of

the new schema before any other; the temporary schema and pg_catalog stay implicit before it. An unqualified object the element creates is declared in the new schema. The server does not run the elements in the order written: transformCreateSchemaStmtElements (parse_utilcmd.c) runs the sequences first, then the tables, views, indexes, triggers and grants, each group in the order written; an element sees the relations the elements run before it create. This value is a working value of one derivation: it stands for the element while the derivation runs under the other search settings and is not part of the published statement. Source: https://www.postgresql.org/docs/17/sql-createschema.html. Termination: one pass over the search path. Status: Implemented.

Constants§

public const STEPS = [\SqlSemantics\Platform\PostgreSql\Statement\Table\Sequence\CreateSequence::cla…

The step each kind of element runs in; any other element (GRANT) runs last.

Methods§

public function __construct(private Statement $element, private Name $schema)

Parameters

$elementStatementThe element
$schemaNameThe schema being created
public function step(): int
public function context(AnalysisContext $outer, list<Table> $provided = []): AnalysisContext

Answers the context the elements of a new schema are read in: the same declarations and those the statement already provided, with the schema searched before the written path.

Parameters

$outerAnalysisContext
$providedlist<Table>The relations the statement declared before this element
Test cases 2
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives the element as a member of the schema; a statement that creates nothing in it is derived as it is.

Parameters

$derivationDerivation
Test cases 2
Calls 2
public function render(Output $out): void

Writes the element.

Parameters

$outOutput
Test cases 1
Calls 1

Private surface 2§

Implementation details, listed for orientation only.

private Statement $element
private Name $schema

Test cases 6§

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

Dedicated tests 6

Relations§

Instantiated in 1
Method calls 1
Type declarations 1