Not Clear with your question here.Are you trying to truncate the data in postgresql database?
postgresql deals with tableau server data not with the database of the dashboard that you are trying to build.
if you are trying to do DML operations in the relational database then you can do that in the stored procedure.
It all depends on the way you are building the stored procedure.
Ideally you should not be dropping tables from postgresql database.
hope i am clear.
Many thanks for the reply.
I am using the Live connection and firing Tableau Custom SQL on the Postgres DB. I can use a Postgres Function but I don't see any function listed in the data source. All I see are Tables only! None of my functions are listed in there.
I have a few massive tables with billions of rows. So what I do is, I migrate the required rows from these tables into Temp table and then Join these temp tables instead of joining the raw/original Postgre tables which are in OLTP. Hence I need to use DDL statements on Temp tables for each data pulling request. Also need to have Live connection only as I need real time reporting.
Hope this will help you understand the situation and suggest a better way out.
You can use the native database functions directly in tableau using a concept called pass through functions.
*** other ways of handling billions of records
you can create tableau extracts and use TDE instead of live connection.
live connection should not be used when there is huge volumes of data please use tableau extracts.