Create a basic table with primary key and defaults.
Section: Schemas, Tables, and Core DDL
Create table
sql
sql
CREATE TABLE public.users (
user_id bigserial PRIMARY KEY,
email text NOT NULL UNIQUE,
created_at timestamptz NOT NULL DEFAULT now()
);Explanation
See summary for usage details.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Schemas, Tables, and Core DDL