【发布时间】:2014-04-21 07:09:46
【问题描述】:
我在 PostgreSQL 中有一个包含近 400 个函数的数据库。其中许多函数都有 RAISE INFO 用于调试目的。现在我想在所有函数中评论这个 RAISE INFO。为此,我使用以下查询:
UPDATE information_schema.routines SET routine_definition = REPLACE(routine_definition,'RAISE','-- RAISE') WHERE (routine_definition) like '%RAISE%'
但它给了我以下错误:
ERROR: cannot update view "routines"
SQL state: 55000
Detail: Views that do not select from a single table or view are not automatically updatable.
Hint: To enable updating the view, provide an INSTEAD OF UPDATE trigger or an unconditional ON UPDATE DO INSTEAD rule.
我不知道该怎么做。
【问题讨论】:
标签: database postgresql triggers views