classReassignOwned
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.
$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> $ownerspublic RoleSpec $newOwnerMethods§
Parameters
Calls 2
- static-call Check::listOf() line 44
- class-const RoleSpec::class() line 44
public function deriveStatement(Derivation $derivation): voidReports PUBLIC among the old owners or as the new owner.
Parameters
$derivation | Derivation |
Calls 2
- method-call RoleChecks::existing() line 52
- new RoleChecks line 52
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.