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 4274428
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:50:44+00:00 2026-05-21T07:50:44+00:00

I’m one of those that recently decided to migrate from MySQL to PostgreSQL and

  • 0

I’m one of those that recently decided to migrate from MySQL to PostgreSQL and with it a lot of old habits are being torn apart. However there is functionality from MySQL I would like to preserve in PostgreSQL.

So… topics:

  1. User should have ability to create tables under a restricted namespace.
  2. Tables of one user should not be visible to other users by default (both data, structure, stored procedures and whatnot).
  3. Optionally the user should be given the right to GRANT permissions to other users.
  4. Default permission to new users is to have no permission (read nothing, write even less)
  5. Maintain compatibility with applications that are not schema aware.

Point 1:

Under MySQL the solution in place was to allow the user to create databases under the criteria ‘username_%’. Under PostgreSQL I thought of having one database per user such that they can create as many schemas as they want. However there is the limitation of not being able to do joins across databases, only across schemas on the same database.

The possibility of having all as PostgreSQL schemas under the same database is not completely discarded. But then it suffers from the next point…

Point 2:

After reading this question I was inclined to think that the only way to make data completely private was to use different databases. Still I can’t seem to figure out how to do it and on the other hand it conflicts with the ability to do the joins mentioned in the previous point.

Point 3:

Is this even possible or do you need the ‘Create roles’ privilege and create a new role for the given table/schema.

Point 4:

Again, is this possible? From what I read it feels like I’m fighting the default ‘public’ behavior, but still I would like to have the users seeing nothing unless an admin gives them access to the information.

Point 5:

Some of the programs I use with MySQL, on which I have no direct control of the actions they perform on the database, are not schema aware. This means they simply ignore the schema layer. For this PostgreSQL provides the ‘public’ schema as default. However this is still a bit awkward in some cases.

It also means that by default I need one independent database per software/tool or else I need to trick the system by setting search_path to some predefined schema on a per user (role) basis.


So those are the options/solutions I’ve found so far. I’m fine with having to use the search_path for point 5 and sacrificing joins between tables/schemas in different databases for the sake of privacy (points 1 and 2), but I would still like to know what is the best solution to the above problems and what are the best ways to put them in practice.

With that said, I’m all ears.

PS: Links to information on how to accomplish the mentioned above are also welcome.

  • 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-21T07:50:44+00:00Added an answer on May 21, 2026 at 7:50 am

    The solution we ended up taking is the following:

    Point 1:

    One database per user. User can create as many tables and schema as he wants. Joins across databases are not possible. The alternative is to retrieve subsets and manage the results on the client, obviously not the most efficient way.

    Point 2:

    This can be accomplished by defining a specific ownership and permission for a given database and removing the default “public” behavior. With this, only users that belong to allowed groups or are the owner itself can access the content.

    Note: PostgreSQL uses multiple level permissions which means that even if the database is owned by someone, tables can be owned by someone else.

    Point 3:

    Can be done with WITH GRANT OPTION.

    Point 4:

    There is no automated way to do this. The only way to ensure this is by restricting “public” access to all existing databases.

    Point 5:

    Using search_path on a per user basis is the only way to do it, using multiple users to access different schema (when needed). There is obviously the issue that a schema unaware application cannot “reach” other schema if no user with appropriate search_path exists.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I have a text area in my form which accepts all possible characters from

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.