Skip to content

Question about schema isolation #3188

Answered by wolfgangwalther
taphill asked this question in Q&A
Discussion options

You must be logged in to vote

Conceptually, this makes perfect sense, but what is the best way to go about implementing this in practice? Views are a new concept to me.
...
Any further guidance or resources would be much appreciated, thank you!

A random collection of tips:

  • Use at least PostgreSQL 15 and always use the security_invoker option for your views. Otherwise it will be really annoying to implement Row Level Security at some point. I use the following pgtap test to make sure we never miss any of the views:
      RETURN NEXT is_empty(
      $$ SELECT relnamespace::regnamespace, relname
           FROM pg_class
          WHERE relkind='v'
                AND relnamespace::regnamespace NOT IN ('pg_catalog', 'information_schema', 'p…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@taphill
Comment options

Answer selected by taphill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants