0

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.

2
  • Are you sure that the postgis extension is properly loaded? In psql execute \dx to check that it indeed is. Or use select * from pg_extension; from your favourite console. Commented May 9, 2014 at 7:24
  • You are exactly right. It is showing only "plpgsql" installed there. But when i installed it was successfully completed without any error. Commented May 9, 2014 at 7:29

1 Answer 1

4
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.

Sign up to request clarification or add additional context in comments.

2 Comments

Great! It works. Thank you so much for your valuable assistance.
For me in AWS get this : ERROR: Extension "adminpack" is not supported by Amazon RDS Detail: Installing the extension "adminpack" failed, because it is not on the list of extensions supported by Amazon RDS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.