Hacker News new | ask | show | jobs
by jalino23 998 days ago
how does this work? you have the "real" database and this "api" database makes queries to the real database? how does that work?
1 comments

In postgres, every object (table, index, function, view, etc.) lives in a "schema", which is better thought of as a namespace. I put low-level objects like tables into one or more schemas, then create an "API" schema with views, functions, procedures that operate on tables in other schemas. Then I only grant access to that API schema to the application users.
thank you so much!