On this page
  1. CURRENT TIMESTAMP
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

CURRENT TIMESTAMP

Prev: `LOWER` | Up: functions | Next: design_patterns
Rel: functions, Aggregations, CTEs & Window Functions
Ref: PostgreSQL — SQL Commands
Tags: #public #databases #sql #functions #tier/core


Syntax & Overview

DEFAULT CURRENT_TIMESTAMP

Returns current UTC timestamp (SQLite) or transaction-start TIMESTAMPTZ (PostgreSQL).

Notes & Best Practices

Example

CREATE TABLE events (
  id INTEGER PRIMARY KEY,
  recorded_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

Linked from

Related notes