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

A request to give every object the given roles own to another role.

Rule: PG-OWNED-REASSIGN-001. Mirrors ReassignOwnedStmt: the old owners and the new owner. Which objects the roles own is known when the statement runs, so no relation is resolved. Reported: PUBLIC, which is not a role, as an old or the new owner. Source: https://www.postgresql.org/docs/17/sql-reassign-owned.html. Status: Implemented.

Reading the new ownerdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('REASSIGN OWNED BY joe, ann TO boss');
    [count($operation->statement->owners), $operation->statement->newOwner->name?->value] // => [2, 'boss']

Properties§

public non-empty-list<RoleSpec> $owners
public RoleSpec $newOwner

Methods§

public function __construct(list<RoleSpec> $owners, public RoleSpec $newOwner)

Parameters

$ownerslist<RoleSpec>The old owners in the order written, at least one
$newOwnerRoleSpecThe role that receives the objects
Calls 2
public function deriveStatement(Derivation $derivation): void

Reports PUBLIC among the old owners or as the new owner.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 1

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 1