This unlocks the postgres database on the Tableau Server, allowing full access to all of the tables in the database and not just the views. This gives the Tableau Server administrator visibility into the database. Please note that this is not supported by Tableau.
Get the password for the postgres db
This tip comes from Zen Master Tamas Foldi and you need to use it in order to get the password for the access operation below.
To get the pgsql password use the following command on the Tableau Server you will be accessing:
tabadmin get pgsql.adminpassword
In the blurred-out text above is where you'll get the password for your db.
Access for the postgres db
This hack is VERY DANGEROUS and UNSUPPORTED by Tableau! Unless you are VERY EXPERIENCED you should only access the database tables using Tableau Desktop or other read-only tool! This is not the preferred method of gaining access to the Tableau server database. Use at your OWN risk!
1. Open a command window (DOS prompt) and go to the PostGRES binary directory for your Tableau Server …pgsql\bin directory (most installs will look like C:\Program Files (x86)\Tableau\Tableau Server\8.0\pgsql\bin). The DOS command prompt in the PostGRES binary directory:
2. Now ‘open’ the PostGRESQL command prompt by typing in this:
psql -p 8060 workgroup tblwgadmin
Please note that if you use a different port then you need to change the 8060 value to the value of the port you use.
Here’s what my result looked like:
3. Notice that you need to enter in a password. That's why you got the password mentioned in the beginning Enter in your password and then hit the 'Enter' key. Note that the cursor won't move and you won't see any text to type carefully. I recommend using copy/paste.
4. At the workgroup=# prompt you can now execute commands:
For example, enter this command to change the role of the tableau user to have READ and WRITE access:
alter user tableau superuser;
After the above command executes you’ll see “ALTER ROLE” display and then an empty prompt:
Or in the situation I had, delete a custom view from the database that was no longer needed using the DROP command:
5. That's it. When you're done close the DOS command window. Either CTRL + c or \q (backslash followed by the letter Q in lower case) will exit you from the workgroup=# prompt and put you back into the cmd prompt.
Remember, you’ll now have the ability to write to your database and delete things! This is VERY DANGEROUS and UNSUPPORTED by Tableau! Unless you are an VERY EXPERIENCED you should only access the database tables using Tableau Desktop or other read-only tool! Make sure you backup your database regularly.
*Adapted from my Tabwiki document.