PostGIS Schema Qualifier – Best Practices

postgispostgresql

There are a number of cases where the EXTENSION for postGIS is created iwth a schema qualifier.

CREATE SCHEMA postgis;
CREATE EXTENSION PostGIS WITH SCHEMA postgis;

why is that? what are the tradeoffs in using the schema?

Best Answer

A schema is like a namespace in programming. It lets you have different things with the same name.

For example, you might have a function foo() in your public schema. If PostGIS has a function foo() as well, that wouldn't work without name qualification.