🐘 PostgreSQL
Beginner
What are the basic data types in PostgreSQL?
Answer
PostgreSQL has a rich type system. Numeric: integer (INT4), bigint (INT8), smallint, numeric(p,s)/decimal (exact), real (float4), double precision (float8), serial/bigserial (auto-increment). Text: varchar(n), char(n), text (unlimited). Boolean: boolean (true/false). Date/Time: date, time, timestamp, timestamptz (with timezone — recommended), interval. Unique to Postgres: uuid, json/jsonb, array, hstore, inet/cidr (network addresses), tsvector (full-text search). Use text over varchar — they perform identically in Postgres.