Numeric Types +

  • smallint (int2): Stores small integers (-32,768 to 32,767).
  • integer (int4): Stores standard integers (-2,147,483,648 to 2,147,483,647).
  • bigint (int8) : Stores large integers (-9 quintillion to 9 quintillion).
  • decimal (p,s)/numeric (p,s): Exact numeric type with precision (p) and scale (s).
  • real (float4): 4-byte floating-point number (approximate precision).
  • double precision (float8): 8-byte floating-point number (higher precision).
  • serial: Auto-incrementing integer (uses `integer`).
  • bigserial: Auto-incrementing big integer (uses `bigint`).

Character Types +

  • char(n): Fixed-length character string.
  • varchar(n): Variable-length character string (up to `n` characters).
  • text: Variable-length character string (unlimited).

Boolean Type +

  • boolean: Stores `TRUE`, `FALSE`, or `NULL`.

Date/Time Types +

  • date: Stores date (year, month, day).
  • time: Stores time of day (hour, minute, second).
  • time with time zone : Stores time with time zone.
  • timestamp: Stores date and time.
  • interval: Stores a time span (e.g., `1 year 2 months`).
  • timestamp with time zone: Stores date and time with time zone.

UUID Type +

  • uuid: Stores universally unique identifiers (UUID).

JSON Types +

  • json :Stores JSON data as text (no validation).
  • jsonb :Stores JSON data in a binary format (faster, supports indexing).

Array Types+

  • datatype[] : Stores an array of elements (e.g., `integer[]`).

HStore Type+

  • hstore : Stores key-value pairs (like a simple NoSQL structure).

Geometric Types+

  • point : Stores a geometric point `(x, y)`.
  • line : Stores an infinite line.
  • lseg : Stores a line segment.
  • box : Stores a rectangular box.
  • path : Stores a geometric path.
  • polygon : Stores a polygon.
  • circle : Stores a geometric circle.

Network Types+

  • cidr :Stores IPv4 or IPv6 network.
  • inet :Stores IP address.
  • macaddr :Stores MAC address.

Bit String Types+

  • bit(n) :Stores fixed-length bit string.
  • bit varying(n) :Stores variable-length bit string.

XML Type+

  • xml :Stores XML data.

Range Types+

  • int4range :Range of integers.
  • numrange :Range of numeric values.
  • tsrange :Range of timestamps.
  • tstzrange :Range of timestamps with time zones.
  • daterange :Range of dates.

Monetary Type+

  • money :Stores currency values with currency symbols.