CREATE TABLE
features:
nextval()
defaults) to their canonical SERIAL forms (SMALLSERIAL, SERIAL, BIGSERIAL) in CREATE TABLE statements.
id INTEGER PRIMARY KEY
)email VARCHAR(255) UNIQUE
)user_id INTEGER REFERENCES users(id)
)age INTEGER CHECK (age >= 0)
)CONSTRAINT pk_name PRIMARY KEY (col1, col2)
)CONSTRAINT uk_name UNIQUE (col1, col2)
)CONSTRAINT fk_name FOREIGN KEY (col1, col2) REFERENCES...
)CONSTRAINT chk_name CHECK (col1 <= col2)
)CREATE TABLE IF NOT EXISTS
for safety and idempotencyIN('val1', 'val2')
instead of = ANY (ARRAY[...])
)DROP TABLE IF EXISTS table_name CASCADE;