final class OwnerTo
    implements AlterCommand
    uses Snapshot
Public API: explicitly declared with @visibility public.

OWNER TO: changes the owner.

Mirrors AT_ChangeOwner with newowner. Source: https://www.postgresql.org/docs/17/sql-altertable.html.

Changing the ownerdoctest
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t OWNER TO CURRENT_USER');
    $statement->toString() // => 'ALTER TABLE t OWNER TO CURRENT_USER'

Properties§

public RoleSpec $owner

Methods§

public function __construct(public RoleSpec $owner)

Parameters

$ownerRoleSpecThe new owner
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives nothing: the role is a catalog name.

Parameters

$derivationDerivation
$environmentEnvironment
public function render(Output $out): void

Writes OWNER TO and the role.

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