Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add PostGIS to PostgreSQL pgAdmin?

I've got PostgreSQL and pgAdmin installed, but I want to add a PostGIS server so I could work on a Geographic Informations System project.

I'm following this tutorial, which assumes PostGIS is set up. In the previous page of the tutorial, it instructs you to download their software package which includes PostgreSQL and pgAdmin. I already have those installed, so I would like to just add PostGIS but I don't see any way to do so.

Any ideas?

pgAdmin screenshot

like image 794
CodyBugstein Avatar asked Jul 27 '14 14:07

CodyBugstein


1 Answers

Connect to the database using a superuser account (most often the user named postgres but in more recent versions the id of the user who installed the application.) Then issue the following SQL commands to enable PostGIS functionality.

 CREATE EXTENSION postgis;  CREATE EXTENSION postgis_topology; 

You can do this from within pgAdmin or via psql -U [superuser] [database] from a command line.

Alternately for the command adverse; as a superuser; from within pgAdmin right click on your database's Extensions and select New Extension. Then in the drop down associated with Name select the postgis* extensions needed.

like image 119
jwd630 Avatar answered Nov 22 '22 01:11

jwd630