I have to execute a loop in database. This is only a one time requirement. After executing the function, I am dropping the function now.
Is there any good approach f
If you are using version 9.0, you can do this with the new DO statement:
http://www.postgresql.org/docs/current/static/sql-do.html
With previous versions, you'll need to create the function, call it, and drop it again.