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

CREATE LANGUAGE without a handler, which the server performs as CREATE EXTENSION of the language name.

Rule: PG-LANGUAGE-002. The grammar turns this form into a CreateExtensionStmt: OR REPLACE becomes IF NOT EXISTS and TRUSTED is ignored. The written keywords are kept so the request renders as written. Source: https://www.postgresql.org/docs/17/sql-createlanguage.html ("CREATE LANGUAGE … without handler … is equivalent to CREATE EXTENSION"). Status: Implemented.

Installing a language by namedoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE OR REPLACE LANGUAGE plperl');
    [$operation->statement->ifNotExists(), $operation->statement->name->value] // => [true, 'plperl']

Properties§

public bool $orReplace
public bool $trusted
public Name $name

Methods§

public function __construct(public bool $orReplace, public bool $trusted, public Name $name)

Parameters

$orReplaceboolWhether OR REPLACE is written
$trustedboolWhether TRUSTED is written; the server ignores it
$nameNameThe language name, which is the extension name
public function ifNotExists(): bool

Tells whether the extension install is skipped when the extension exists, which OR REPLACE requests.

Returns

bool
public function deriveStatement(Derivation $derivation): void

Derives nothing: an extension is not part of a declaration context.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1