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

A request to change the privileges that objects created in the future receive.

Rule: PG-DEFAULT-PRIVILEGES-001. Mirrors AlterDefaultPrivilegesStmt: the limiting clauses in the order written and one GRANT or REVOKE action. Reported (PG-DEFAULT-PRIVILEGES-CHECK-001): a limiting clause given twice, a column list, a privilege that does not apply to the kind of object, IN SCHEMA together with ON SCHEMAS, PUBLIC as a role of FOR ROLE and a grant option for PUBLIC. Source: https://www.postgresql.org/docs/17/sql-alterdefaultprivileges.html. Status: Implemented.

Reading the action of the requestdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DEFAULT PRIVILEGES IN SCHEMA app GRANT SELECT ON TABLES TO PUBLIC');
    [$operation->statement->scopes[0]->option(), $operation->statement->action->objects->value] // => ['schemas', 'TABLES']

Properties§

public list<DefaultScope> $scopes

Methods§

public function __construct(
    list<DefaultScope> $scopes,
    public DefaultGrant|DefaultRevoke $action,
)

Parameters

$scopeslist<DefaultScope>The limiting clauses in the order written
$actionDefaultGrant|DefaultRevokeThe GRANT or REVOKE action
Calls 2
public function deriveStatement(Derivation $derivation): void

Reports the problems of the clauses and of the action.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

Test cases 4§

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 3

Relations§

Instantiated in 1