Skip to content

Instantly share code, notes, and snippets.

@jsor
Created December 9, 2011 15:49
Show Gist options
  • Save jsor/1452052 to your computer and use it in GitHub Desktop.
Save jsor/1452052 to your computer and use it in GitHub Desktop.
CREATE TABLE geo (id INT NOT NULL, PRIMARY KEY(id));
SELECT AddGeometryColumn('geo', 'point', -1, 'POINT', 2);
SELECT AddGeometryColumn('geo', 'linestring', -1, 'LINESTRING', 2);
SELECT AddGeometryColumn('geo', 'polygon', -1, 'POLYGON', 2);
SELECT AddGeometryColumn('geo', 'multipoint', -1, 'MULTIPOINT', 2);
SELECT AddGeometryColumn('geo', 'multilinestring', -1, 'MULTILINESTRING', 2);
SELECT AddGeometryColumn('geo', 'multipolygon', -1, 'MULTIPOLYGON', 2);
SELECT AddGeometryColumn('geo', 'geometrycollection', -1, 'GEOMETRYCOLLECTION', 2);
CREATE SEQUENCE geo_id_seq INCREMENT BY 1 MINVALUE 1 START 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment