classCreateLanguageExtension
final class CreateLanguageExtension
implements Statement
uses Snapshot
@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.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE OR REPLACE LANGUAGE plperl');
[$operation->statement->ifNotExists(), $operation->statement->name->value] // => [true, 'plperl']Properties§
public bool $orReplacepublic bool $trustedpublic Name $nameMethods§
public function __construct(public bool $orReplace, public bool $trusted, public Name $name)Parameters
$orReplace | bool | Whether OR REPLACE is written |
$trusted | bool | Whether TRUSTED is written; the server ignores it |
$name | Name | The language name, which is the extension name |
public function ifNotExists(): boolTells whether the extension install is skipped when the extension exists, which OR REPLACE requests.
Returns
boolpublic function deriveStatement(Derivation $derivation): voidDerives nothing: an extension is not part of a declaration context.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 61
- class-const NameUse::Column() line 68
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.