PostgreSQL: Function to truncate all Tables created by Particular User

In this post, I am sharing one PostgreSQL user define function to truncate all Tables which are created by particular X User.

Sometimes, Database administrator or Database Developer creates one user only for test purpose and this TEST user created an N number of test rows or tables which is require drop or truncate.

Using this function you can truncate all tables of a database with the help of Owner and Schema input parameter.

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Leave a Reply

2 Comments on "PostgreSQL: Function to truncate all Tables created by Particular User"

Notify of

Sort by:   newest | oldest | most voted
10 months 13 days ago

Fine wway of explaining, and fastidious post tto get data regarding my presentatuon subject, which i am going to deliver iin college.

6 months 19 days ago

The info is extremely useful.|