Data Type Picker

PostgreSQL

Categories

PostgresGUI

Numeric

Use integer for most things, numeric for money

double precision8 bytes

Scientific computation, analytics, geo coordinates.


Range

15 decimal digits precision

Performance

Hardware FPU. ~15 digits precision. Faster than numeric for large datasets.

Comparison

double precision vs numeric: double is faster but approximate. For financial or exact calculations, always use numeric. For analytics and science, double is fine.

SQL Example
CREATE TABLE locations (
  id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  latitude double precision,
  longitude double precision
);
PostgreSQL Numeric Types — integer, bigint, numeric, float | PostgresGUI