Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7619847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:47:34+00:00 2026-05-31T03:47:34+00:00

I don’t want to throw all my table definitions into the same public schema

  • 0

I don’t want to throw all my table definitions into the same public schema as the PostGIS definitions that get created with the standard PostGIS installation process (http://postgis.refractions.net/docs/ch02.html).

Does anyone have any suggestions for how to keep things organized into separate schemas when using PostGIS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:47:36+00:00Added an answer on May 31, 2026 at 3:47 am

    As I just answered on your related preceding question I recommend not to use the public schema for your objects at all. Reserve it for extensions like PostGis and use one or more separate schemas for your objects.

    The public schema is in no way different than any other schema in your database. PostgreSQL does not need it at all. It just happens to be the default schema where many extensions put their stuff. So put your stuff somewhere else and set the search_path where you need it.

    Then you can also create corresponding users with a matching preset search_path. The basic setup could look something like this:

    CREATE ROLE sales;
    ALTER ROLE sales SET search_path=sales, public; -- postgis functions in public?
    COMMENT ON ROLE sales IS 'Sales app uses this user to connect.';
    
    CREATE ROLE sales_admin;
    ALTER ROLE sales_admin SET search_path=sales, public;
    COMMENT ON ROLE sales_admin IS 'Owns objects in schema sales.';
    
    CREATE SCHEMA sales;
    GRANT ALL ON SCHEMA sales TO sales_admin;
    GRANT USAGE ON SCHEMA sales TO sales;
    COMMENT ON SCHEMA sales IS 'All objects for my sales app here.'
    

    You’ll also be interested in DEFAULT PRIVILEGES for users or schemas. More under this closely related question:
    Grant all on a specific schema in the db to a group role in PostgreSQL

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't have much to say, just can get into the event handler. XAML: <Grid>
Don't these two mean the same thing, first get the value and then increment?
Don't get me wrong, I want them to get saved. But I always thought
don't know if this is possible.. I'm using sqlite3 schema: CREATE TABLE docs (id
Don't you hate it when you have class Foobar { public: Something& getSomething(int index)
I don't want PHP errors to display /html, but I want them to display
Don't know if I worded the question right, but basically what I want to
Don't know how to explain it better but i'm trying to get a response
Don't think that I'm mad, I understand how php works! That being said. I
Don't ask me how but I managed to get accidentally the following remote branches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.