classGrantedRelations
final class GrantedRelations
Resolves a relation named by GRANT or REVOKE and checks the column privileges on it.
Rule: PG-GRANT-RELATION-001. The name is resolved along the schema search path (CORE-TABLE-LOOKUP-001); a grant sees no common table. A declared relation contributes one slot per declared column and is open when its column list is incomplete; an undeclared or conditionally resolved name contributes an open shape naming the missing declaration; conflicting declarations are a diagnostic. GRANT ... ON TABLE also accepts a sequence, and a context declares no sequences, so a name that no declared relation has is not certainly wrong: it is recorded as an undeclared relation, never as a missing table. A column of a column privilege that a declared, complete relation certainly lacks is reported. Termination: one lookup, then one pass over finite lists. Source: https://www.postgresql.org/docs/17/sql-grant.html, https://www.postgresql.org/docs/17/ddl-priv.html, https://www.postgresql.org/docs/release/8.2.0/ (sequences in GRANT ON TABLE). Status: Implemented.
Methods§
public function derive(
Derivation $derivation,
RelationReference $relation,
list<Privilege> $privileges,
): RelationFactResolves the relation, records its facts on the reference and reports the columns it certainly lacks.
Parameters
$derivation | Derivation | |
$relation | RelationReference | |
$privileges | list<Privilege> | The privileges of the statement |
Returns
Called from 1
Calls 12
- method-call Derivation::table() line 50
- method-call Derivation::environment() line 50
- new UndeclaredTable line 52
- new UndeclaredRelation line 52
- new RowShape line 54
- new OutputSlot line 58
- method-call DeclaredTyping::fact() line 58
- new DeclaredTyping line 58
- new IncompleteMembers line 60
- method-call GrantedRelations::columns() line 61
- method-call Derivation::target() line 66
- new RelationFact line 66
public function columns(
Derivation $derivation,
RelationReference $relation,
DeclaredTable $resolution,
list<Privilege> $privileges,
): voidReports the columns of column privileges that a declared, complete relation lacks.
Parameters
$derivation | Derivation | |
$relation | RelationReference | |
$resolution | DeclaredTable | |
$privileges | list<Privilege> |
Called from 1
Calls 2
- method-call Derivation::report() line 82
- new MissingColumn line 82
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
GrantedRelationsTestcalls