Both ensure uniqueness, but with key differences:
PRIMARY KEY:
UNIQUE:
CREATE TABLE users (
id SERIAL PRIMARY KEY, -- Cannot be NULL
email VARCHAR(255) UNIQUE, -- Can have one NULL
username VARCHAR(50) UNIQUE -- Multiple unique constraints allowed
);