Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to PostgreSQL and PostGIS.

Recently, I created a PostGIS 2.0.3 database on a PostgreSQL 9.1 database server using pgAdmin. The "PostGIS" extension was found installed in "Extensions". Al spatial functions were added to the "public" schema. That's fine.

Now I want to store all my data into a new scheme called "gc". However, how can I make all spatial function installed in that "gc" schema? There is no single function in the schema. However, when I tried to import/new a feature class from ESRI ArcCatalog 10.1 to this schema, it worked! The feature class could be imported and displayed in QGIS.

Could anyone give me any tip or idea about it?

Thanks in advance!

share|improve this question
Just noticed: already dealt with at… – Martin F Feb 21 '14 at 3:47
up vote 8 down vote accepted

When you spatially-enable a PostGIS database, the relevant functions, SRS table, and views are placed in the public schema, as you state. That does not mean that all or any of your own spatial tables need to be in the same public schema. PostGIS will still work on all spatial data in the "new" schemas.

In fact, I usually place my application-specific tables in a separate schema. That way, if you need to do a major version upgrade to PostGIS, you can keep your application-specific table backups and restores as a separate procedure from the one that replaces the spatial tools.

So, I think you're doing well. Finally, in case you didn't do it already, it's a good idea to add the new schema to the search path:

ALTER DATABASE my_db SET search_path = gc, public;

share|improve this answer
Thanks Martin. Does it mean I am able to use spatial functions on tables in a custom schema other than "public"? – alextc Feb 21 '14 at 3:38
How do you add data to another schema, ie. not public? Adding data with eg. shp2psql to test.table still puts data in public? – knutole Jul 3 '15 at 9:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.