0

How would I set up a view that is for showing a restricted set of data for masking PII? Can a view be created which is available at lesser role access than the source tables? This is for Postgres that can't use any plugins due to need to be platform agnostic.

3
1

How would I set up a view that is for showing a restricted set of data for masking PII?

With create view :)
As part of the select statement within the View, you would generate "masked" values based on (and replacing) the raw data and, probably not including all the columns. Unless you start generate random data, such a View would be deterministic, returning the same, calculated value for each raw value.

Can a view be created which is available at lesser role access than the source tables?

Yes, it can.
The [masked] View should be widely available, the [unmasked] source Table should be [highly] restricted.

And remember that, at some point, somebody will need to be able to see the raw data - including the Data Subject themselves!

2
  • Thanks. I tried it out on my Postgres instance and confirmed this.
    – Martlark
    Nov 18 at 0:25
  • @Martlark you might accept this answer. Nov 18 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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