A point
consist of two double precision
values. You store the same information, same size on disk and in RAM. But with a slightly different set of constraints.
Two separate columns can be NULL
or not independently. A point can only be NULL as a whole:
- Why does the behavior of array syntax differ from '(?,?)' syntax when updating a point field and that field is NULL?Why does the behavior of array syntax differ from '(?,?)' syntax when updating a point field and that field is NULL?
You can use geometric functions and operators for points. But you can easily construct a point from two numbers on the fly: point(x, y)
. In reverse, you can easily access coordinates of a point
as double precision
numbers: p[0]
, p[1]
(0-based index!)
It's basically a matter of taste and style while you don't use the more sophisticated types geometry
or geography
provided by PostGis.