简体   繁体   中英

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?

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.

Following post shows how to implment encryption UDF in Redshift with some data protection best practices. https://techsboot.com/blogs/redshift/encrypt_decrypt_udf_using_pyaes/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM