I've seen the
gid field/column in a lot of PostGIS tables and questions. It seems to be a unique ID often available (see e.g. In PostGIS is it possible to create a View with a unique ID?)
My questions are:
gid field guaranteed to exist in all PostGIS tables?
If not guaranteed at all times, when are they guaranteed to exist and when are they not?
For example, tt seems to me that tables imported using
shp2pgsql all have the
gid field. But I wanted to know if I can rely on the existence of such a unique id field, which I'd like to use as a primary key.
(I'm using PostgreSQL 9.5+, PostGIS 2.2+)