Skip to content

Instantly share code, notes, and snippets.

@marekjelen
Created August 1, 2012 19:29
Show Gist options
  • Save marekjelen/3229952 to your computer and use it in GitHub Desktop.
Save marekjelen/3229952 to your computer and use it in GitHub Desktop.
Table
CREATE TABLE pois
(
id serial NOT NULL,
name text NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
"position" geography(Point,4326),
CONSTRAINT pois_pkey PRIMARY KEY (id ),
CONSTRAINT pois_name_key UNIQUE (name )
)
WITH (
OIDS=FALSE
);
CREATE INDEX position_gix
ON pois
USING gist
("position" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment