The presence of a common column GEOGRAPHY with PostGIS

In PostgreSQL 9 + PostGIS 1.5, is there a way to create a β€œcommon” GEOGRAPHY column? By this I mean a column that will accept POINT, as well as POLYGON, LINESTRING, etc. So far, I have only seen columns such as GEOGRAPHY (POINT, 4326) on the Internet.

If this is not possible, how would you construct (from the point of view of the database) an object that is associated with a random geographic object (point, polygon, whatever)? Should I create 3, 4, 5 different tables for each type of geographic feature that I would like to support? (1 table for POINT objects, 1 table for POLYGON objects, etc.)?

Thanks in advance.

Romny

+4
source share
1 answer

Yes, just do not specify a type constraint in the CREATE TABLE statement.

CREATE TABLE mytable ( geog GEOGRAPHY, id SERIAL PRIMARY KEY ); 
+9
source

All Articles