I am writing some PostgreSQL code where I have a function which is used multiple times in a single query with different input values. Inside the function I create some tables and use them.

What is the correct way to handle those tables? should I drop them at the end of the function (right before the RETURN), or should I use temp tables?

closed as off-topic by whyzar, xunilk, pLumo, BERA, nmtoken Feb 15 '18 at 11:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.