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

A SET written with keywords of its own: CATALOG, SCHEMA, NAMES, ROLE, SESSION AUTHORIZATION, XML OPTION or TRANSACTION SNAPSHOT.

Rule: PG-SET-004. Mirrors the keyword forms of PostgreSQL's VariableSetStmt. CATALOG, SCHEMA and TRANSACTION SNAPSHOT take a string; ROLE takes a word or a string; SESSION AUTHORIZATION takes a word, a string or DEFAULT; NAMES takes a string, DEFAULT or nothing, the last two both restoring the default encoding; XML OPTION takes DOCUMENT or CONTENT. Diagnostic: SET CATALOG is rejected by the server while parsing. Source: https://www.postgresql.org/docs/17/sql-set.html, https://www.postgresql.org/docs/17/sql-set-role.html, https://www.postgresql.org/docs/17/sql-set-session-authorization.html, https://www.postgresql.org/docs/17/sql-set-transaction.html. Status: Implemented.

Reading SET SESSION AUTHORIZATION DEFAULTdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SET SESSION AUTHORIZATION DEFAULT');
    [$operation->statement->setting, $operation->statement->default, $operation->statement->value] // => [\SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\SpecialSetting::SessionAuthorization, true, null]
Refusing a schema that is not a stringdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\SetSpecialSetting(\SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\SpecialSetting::Schema, null) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public SpecialSetting $setting
public bool $default = false
public bool $local = false

Methods§

public function __construct(
    public SpecialSetting $setting,
    public StringConstant|Word|XmlOption|null $value,
    public bool $default = false,
    public bool $local = false,
)

Parameters

$settingSpecialSettingThe setting
$valueStringConstant|Word|XmlOption|nullThe value; null when DEFAULT or nothing is written
$defaultboolWhether DEFAULT is written in place of a value
$localboolWhether the change lasts for the current transaction only
Calls 8
public function deriveStatement(Derivation $derivation): void

Reports SET CATALOG, which the server refuses.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 3

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 10
Type declarations 1