Pergunta

Here i need to store Geometry path into my table. I have tried following procedure but not getting "Geometry" datatype in PostgreSQL 9.3 version.

Step 1: Downloaded PostGIS from link http://download.osgeo.org/postgis/windows/pg93/

Step 2: Installed PostGIS in PostgreSQL 9.3 and

Step 3: Using in my query:

create  table test
(
  col1 text null,
  col2 text null,
  col3 text null,
  geopath geometry not null /* Geometry datatype used */
);

ERROR:  type "geometry" does not exist

Note: My geometry type can be any type, it may be circle or polygon or line or box.

Foi útil?

Solução

CREATE EXTENSION adminpack;
CREATE EXTENSION postgis;

This installs postgis in the current database, with all data types and operators and the adminpack extension that it needs (adminpack is already on your system, most likely). Note that you have to do this for every database that you create, unless you create the extension in one of the template databases (not such a good idea anymore since 9.1).

Note that there is a difference between installing an extension on your file system and making it available in your database.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top