final class AtLocal
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A time converted to or from the session time zone: a AT LOCAL (PostgreSQL 17).

The parser reads it as a call of pg_catalog.timezone(a).

Rule: PG-AT-LOCAL-001. Facts: those of PG-AT-TIME-ZONE-001 with a text zone; the value depends on the session's TimeZone setting, not its type. The operand must keep its place (PG-PRECEDENCE-001). Source: https://www.postgresql.org/docs/17/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT. Status: Implemented.

Converting to the session time zonedoctest
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("SELECT '2024-01-01 00:00'::timestamp AT LOCAL", [])->field(0)->type->descriptor->name() // => 'timestamp with time zone'

Properties§

public Scalar $operand

Methods§

public function __construct(public Scalar $operand)

Parameters

$operandScalarThe time value
Calls 4
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand and the converted type.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 6
public function render(Output $out): void

Writes the value and AT LOCAL.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 3§

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

Dedicated tests 3

Relations§

Instantiated in 1
Type checks 1