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

Method GetTxnTimestamp

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

GetTxnTimestamp retrieves the current transaction timestamp as per the evaluation context. The timestamp is guaranteed to be nonzero.

(precision time.Duration)

Source from the content-addressed store, hash-verified

3027// GetTxnTimestamp retrieves the current transaction timestamp as per
3028// the evaluation context. The timestamp is guaranteed to be nonzero.
3029func (ctx *EvalContext) GetTxnTimestamp(precision time.Duration) *DTimestampTZ {
3030 // TODO(knz): a zero timestamp should never be read, even during
3031 // Prepare. This will need to be addressed.
3032 if !ctx.PrepareOnly && ctx.TxnTimestamp.IsZero() {
3033 panic(errors.AssertionFailedf("zero transaction timestamp in EvalContext"))
3034 }
3035 return MakeDTimestampTZ(ctx.GetRelativeParseTime(), precision)
3036}
3037
3038// GetTxnTimestampNoZone retrieves the current transaction timestamp as per
3039// the evaluation context. The timestamp is guaranteed to be nonzero.

Callers

nothing calls this directly

Calls 2

GetRelativeParseTimeMethod · 0.95
MakeDTimestampTZFunction · 0.85

Tested by

no test coverage detected