How to create a temporary function in PostgreSQL?

前端 未结 4 1841
离开以前
离开以前 2020-11-27 15:09

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

4条回答
  •  时光说笑
    2020-11-27 15:40

    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.

提交回复
热议问题