Search code examples
sqlamazon-web-servicesamazon-redshiftdata-masking

How to mask a column in Redshift?


I've a requirement to keep a user table for granting access to an application where there's a password field which has to be masked.

How to go about it?

Example: If you query select * from PG_USER; in Redshift, you'd see, the password column values are shown as *****. How to do exactly that for my custom table?


Solution

  • If there is a column in a table that you do not wish particular users to see, then:

    • Do not grant them permission to use the table
    • Use CREATE VIEW to select all columns you do wish them to be able to view
    • Grant them permission to use the view
    • Tell them to use the view instead of the table (they operate identically)

    Or, create a table without the offending column and grant them permission to use that table.