Skip to content

enforce-timestamptz

TIMESTAMP without TIME ZONE — use TIMESTAMPTZ.

Why

Naive timestamps discard offset context and make cross-time-zone comparisons ambiguous.

Fix

Declare persisted instants as TIMESTAMPTZ or TIMESTAMP WITH TIME ZONE.

Examples

Before — flagged Naive timestamp column
supabase/migrations/001_orders.sql
CREATE TABLE orders (created_at TIMESTAMP NOT NULL);
After — preferred Timestamp with time-zone semantics
supabase/migrations/001_orders.sql
CREATE TABLE orders (created_at TIMESTAMPTZ NOT NULL);