Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why shouldn't PostGIS be installed in the PostgreSQL database "postgres"?

The PostGIS installation documentation reads:

PostGIS is an optional extension that must be enabled in each database you want to use it in before you can use it. Installing the software is just the first step. DO NOT INSTALL it in the database called postgres.

We're running PostgreSQL in Docker and only need one database, so we've been using the default database, postgres. My first inclination was to install PostGIS there, but the documentation seems pretty clear that we shouldn't be doing that.

Is there a reason for PostGIS not to be installed on the default database, or is this note meant to deter people from accidentally installing PostGIS in the postgres database when their data is in the foobar database?

Thanks!

like image 599
christianbundy Avatar asked Dec 11 '15 19:12

christianbundy


People also ask

Does PostGIS come with PostgreSQL?

The EnterpriseDb OSX PostgreSQL combination from EnterpriseDB includes generally latest stable minor version of PostGIS.

What is the difference between PostGIS and PostgreSQL?

PostGIS is an open source, freely available spatial database extender for the PostgreSQL Database Management System (a.k.a DBMS). So PostgreSQL (a.k.a. Postgres) is THE database and PostGIS is like an add-on to that database.

When should I use PostGIS?

PostGIS also has a large set of functions that allow you to work with geography and geometry inside sql and indexes to make database tasks efficient. PostGIS can be used to store spatial data, create and store spatial shapes, determine routes, calculate areas and distances.


1 Answers

There is no danger in installing PostGIS into the postgres database. The note is just so users don't confuse themselves, as you suspected.

like image 172
Peter Eisentraut Avatar answered Oct 13 '22 16:10

Peter Eisentraut