You can use the data type point
- combines (x,y)
which can be your lat / long. Occupies 16 bytes: 2 float8
numbers internally.
Or make it two columns of type float
(= float8
or double precision
). 8 bytes each.
Or real
(= float4
) if additional precision is not needed. 4 bytes each.
Or even numeric
if you need absolute precision. 2 bytes for each group of 4 digits, plus 3 - 8 bytes overhead.
Read the fine manual about numeric types and geometric types.
The geometry
and geography
data types are provided by the additional module PostGIS and occupy one column in your table. Each occupies 32 bytes for a point. There is some additional overhead like an SRID in there. These types store (long/lat), not (lat/long).
Start reading the PostGIS manual here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…