Postgresql – Why does PostGIS create an ugly table in the database called “spatial_ref_sys”

postgispostgresql

I need to use PostGIS, and do use it, but it bothers me that it created this ugly "spatial_ref_sys" table in my database, in the main (public) schema, where I keep all my own tables. It looks ugly.

It also has added a trillion "functions", which is not a big problem to me since I don't have any "functions" of my own, or use them, but the same principle stands for this as well.

Why, given that it's an extension/"PG library" of sorts, doesn't it at least use its own schema, as to separate itself from my own stuff? I assume that there is a very good reason, but I can't figure it out.

Best Answer

Why, given that it's an extension/"PG library" of sorts, doesn't it at least use its own schema, as to separate itself from my own stuff?

If you want it to use a separate schema, you can put it there:

create schema postgis;
create extension postgis with schema postgis;

Unfortunately you can't move it after the fact, other than by dropping and re-creating, which could be very messy if you are already using it.