1 Reply Latest reply on Feb 1, 2019 1:52 PM by patrick.byrne.0

    Restrict postgresql's public schema's tables visibility in tableua

    Alok Singh Mahor

      My requirement is to display only one particular table or materialised view when user give db_host, db_port, db_name, db_username, and db_password to tableau.

      Currently tableau is showing all the tables present default public schema. So I tried to create another schema and another role and keeping that perticular table or materilised view in that new schema.

      CREATE SCHEMA alok_schema; 
      CREATE ROLE alok LOGIN PASSWORD 'alok';
      GRANT USAGE ON SCHEMA alok_schema TO alok;
      CREATE MATERIALIZED VIEW alok_schema.mview_alok as SELECT name, location from sometable;
      GRANT SELECT ON alok_schema.mview_alok TO alok;

      I revoked access for this new user on public schema

      REVOKE ALL PRIVILEGES ON SCHEMA public FROM PUBLIC; 
      REVOKE ALL PRIVILEGES ON SCHEMA public FROM alok;

      Now user alok is not able to see tables present in public schema and he can only see table/view present in alok_schema when he try

      psql -h localhost -U alok db_name

      But this behaviour is not reflecting in tableau even for new user alok. In tableau postgresql user alok is still seeing all the tables present in public schema.

      Is there any way I can restrict public schema's table listing in tableau? I want only mview_alok to be visible in tableau which is present in schema alok_schema.