This might help you to appropriately query the Tableau Server Postgres database:

Tableau Server stores custom views in the PostgreSQL database, specifically in the repository_data table. The custom_views table can be linked to repository_data to get custom views from the database, using the following SQL script:

This script creates .xml files for each customized view in the database, stored in the folder indicated in the script ('C:/MyFolder/" in the above example). The script above also filters for a specific view, but that is not necessary.

The resulting XML contains all the customizations made on the original view.