final class SetSchema
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

ALTER kind object SET SCHEMA schema: moves an object to another schema.

Mirrors PostgreSQL's AlterObjectSchemaStmt. A moved relation is resolved; the move changes no declaration of the context. Source: https://www.postgresql.org/docs/17/sql-altertable.html, https://www.postgresql.org/docs/17/sql-alterfunction.html.

Reading the new schemadoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER EXTENSION hstore SET SCHEMA util');
    $operation->statement->schema->value // => 'util'

Properties§

public ObjectKind $kind
public Name $schema
public bool $ifExists = false

Methods§

public function __construct(
    public ObjectKind $kind,
    public ObjectReference $object,
    public Name $schema,
    public bool $ifExists = false,
)

Parameters

$kindObjectKindThe kind of the object
$objectObjectReferenceThe object, named as SET SCHEMA names objects of the kind
$schemaNameThe new schema
$ifExistsboolWhether IF EXISTS is written; for relations only
Calls 6
public function deriveStatement(Derivation $derivation): void

Derives the object.

Parameters

$derivationDerivation
Calls 4
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 5

Test cases 4§

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

Dedicated tests 3
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type declarations 1