Book Image

Learning Heroku Postgres

By : Patrick Rafael de Oliveira Espake
Book Image

Learning Heroku Postgres

By: Patrick Rafael de Oliveira Espake

Overview of this book

Table of Contents (17 chapters)
Learning Heroku Postgres
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Keyword List
Index

Setting up PostGIS


PostGIS is an extension for creating spatial databases in PostgreSQL. This extension adds support for geographic objects; it allows location queries through SQL.

This is the most popular open source extension offering many features that are rarely found in competing spatial databases such as Oracle Locator/Spatial and SQL Server.

PostGIS is supported on Heroku Postgres in beta mode. For using this extension, you must be using a database in the production tier and it isn't available for plans in the Hobby tier. Besides that, it is only available in the 2.0 version with Postgres v9.2 or in the 2.1 version with Postgres v9.3.

Provisioning

You can install PostGIS as any other extension. First you must connect to psql and then run the statement for installation:

$ heroku pg:psql --app your-app-name
CREATE EXTENSION postgis;

In order to confirm that the installation was successful, you can run the SQL query to check the PostGIS version available:

=> SELECT postgis_version();...