Hello N P,
Whenever I am looking for a how to contruct a query in Tableau for connecting to the workgroups db( PostgreSQL inside of Tableau Server). I reference Ravi Mistry's workbook on Tableau Public: Tableau Public
Additionally, when working with the PostgreSQL Workgroup DB, using Tableau allows you to create views without having to write the SQL.
Hope this helps!
Nilesh, what is the broader context for what you're trying to do?