WITHOUT is not an ANSI-standard keyword but several SQL dialects reserve it for feature switches. The two most common forms are:1. SQLite – WITHOUT ROWID: Creates a table that does not include the implicit 64-bit rowid column. The primary key is stored in the b-tree root, reducing size and improving some lookups. Only tables that define a PRIMARY KEY can use it.2. PostgreSQL – WITHOUT TIME ZONE: Declares a TIMESTAMP or TIME that stores no time-zone information. Values are kept exactly as written without conversion.Other, less frequent uses include WITHOUT OIDS (deprecated PostgreSQL) and materialized views created WITHOUT DATA. Because semantics differ by engine, always consult the dialect documentation.Caveats:- NOT portable – every engine interprets WITHOUT differently or ignores it.- In SQLite, dropping a WITHOUT ROWID table and recreating it with ROWID requires full data reload.- SQLite still needs a PRIMARY KEY that is UNIQUE and NOT NULL to use WITHOUT ROWID.- In PostgreSQL, arithmetic between WITH TIME ZONE and WITHOUT TIME ZONE values can yield surprising results if the session time zone is changed.
ROWID, PRIMARY KEY, TIMESTAMP WITH TIME ZONE, MATERIALIZED VIEW WITHOUT DATA, OIDS
SQLite 3.8.2, PostgreSQL 7.3
WITH TIME ZONE stores the moment in absolute UTC and converts for display, while WITHOUT TIME ZONE stores the literal text unchanged. Use WITH when you track absolute points in time; use WITHOUT for local or display-only timestamps.
Mostly on tables where the primary key is frequently used for lookups and inserts are modest. For write-heavy tables with many secondary indexes, the benefit may be marginal compared to classic rowid tables.
SQLite does not support ALTER TABLE for this switch. You must create a new table with the desired setting, copy data over, and rename.
No. Some engines treat it as fully reserved, others allow it as an identifier, and many ignore it unless paired with a specific phrase like WITHOUT ROWID.