Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change schema on connection with RedShift

I have a Tableau application that works above RedShift. I have many set of data tables saved in different schemas. Each schema has exactly the same tables in the same format.

I also have a set of users. Each user should work with his own schema only (I have a table of mappings between users and schemas).

The question is how to make Tableau look on a different schema depending on the current username?

Thanks!

like image 685
diemacht Avatar asked Nov 26 '25 13:11

diemacht


1 Answers

Redshift doesn't have the sort of capacity to set a default schema as one can set a default database in MSSQL, but perhaps you can use the search_path functionality, where when the user logs in, Tableau queries the user/schema map table then sets the search_path to that schema. Any subsequent queries look for tables/views in that schema first. See http://docs.aws.amazon.com/redshift/latest/dg/r_search_path.html for more info on search_path.

like image 117
mike_pdb Avatar answered Nov 28 '25 17:11

mike_pdb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!