我的 database.yml 开发部分如下所示:
发展:
adapter: postgis
encoding: unicode
database: openData_development
pool: 5
username: postgres
password: test1234
schema_search_path: "public,postgis"
script_dir: C:\Program Files (x86)\PostgreSQL\9.2\share\contrib\postgis-2.0
rake db:create 工作,创建了 openData_development 模式。但我不能使用postgis ...
如果我想创建一个像这样的表:
CREATE TABLE bezirks (
id integer NOT NULL,
name character varying(255),
beznr integer,
district_code integer,
main_id integer NOT NULL,
latlon geometry,
CONSTRAINT enforce_dims_latlon CHECK ((st_ndims(latlon) = 2)),
CONSTRAINT enforce_geotype_latlon CHECK (((geometrytype(latlon) = 'MULTIPOLYGON'::text) OR (latlon IS NULL))),
CONSTRAINT enforce_srid_latlon CHECK ((st_srid(latlon) = 4326))
);
我得到错误:
ERROR: Type »geometry« doesnt exist
LINE 27: latlon geometry,