classMoveAll
final class MoveAll
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.ALTER ... ALL IN TABLESPACE ... SET TABLESPACE: moves every table, index or materialized view of a tablespace.
Mirrors PostgreSQL's AlterTableMoveAllStmt (orig_tablespacename, objtype, roles, new_tablespacename, nowait). Source: https://www.postgresql.org/docs/17/sql-altertable.html.
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE ALL IN TABLESPACE a OWNED BY u1, u2 SET TABLESPACE b NOWAIT');
$statement->toString() // => 'ALTER TABLE ALL IN TABLESPACE a OWNED BY u1, u2 SET TABLESPACE b NOWAIT'Properties§
public list<RoleSpec> $ownerspublic AlterTarget $targetpublic Name $frompublic Name $topublic bool $nowait = falseMethods§
public function __construct(
public AlterTarget $target,
public Name $from,
public Name $to,
list<RoleSpec> $owners = [],
public bool $nowait = false,
)Parameters
$target | AlterTarget | The kind of relation: tables, indexes or materialized views |
$from | Name | The tablespace the relations are in |
$to | Name | The tablespace they move to |
$owners | list<RoleSpec> | The owners whose relations move; none means all |
$nowait | bool | Whether NOWAIT is written |
Calls 7
- static-call Check::listOf() line 50
- class-const RoleSpec::class() line 50
- static-call Check::input() line 51
- function-call
in_arrayline 51 - class-const AlterTarget::Table() line 51
- class-const AlterTarget::Index() line 51
- class-const AlterTarget::MaterializedView() line 51
public function deriveStatement(Derivation $derivation): voidDerives nothing: the statement names catalog objects only.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 66
- method-call AlterTarget::keywords() line 66
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
MoveAllTestcalls