MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / GetTxnTime

Method GetTxnTime

pkg/sql/sem/tree/eval.go:3054–3061  ·  view source on GitHub ↗

GetTxnTime retrieves the current transaction time as per the evaluation context.

(precision time.Duration)

Source from the content-addressed store, hash-verified

3052// GetTxnTime retrieves the current transaction time as per
3053// the evaluation context.
3054func (ctx *EvalContext) GetTxnTime(precision time.Duration) *DTimeTZ {
3055 // TODO(knz): a zero timestamp should never be read, even during
3056 // Prepare. This will need to be addressed.
3057 if !ctx.PrepareOnly && ctx.TxnTimestamp.IsZero() {
3058 panic(errors.AssertionFailedf("zero transaction timestamp in EvalContext"))
3059 }
3060 return NewDTimeTZFromTime(ctx.GetRelativeParseTime().Round(precision))
3061}
3062
3063// GetTxnTimeNoZone retrieves the current transaction time as per
3064// the evaluation context.

Callers

nothing calls this directly

Calls 3

GetRelativeParseTimeMethod · 0.95
NewDTimeTZFromTimeFunction · 0.85
RoundMethod · 0.45

Tested by

no test coverage detected