我在 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.
我不知道该怎么做。
最佳答案
你想要pg_proc.prosrc ,尽管我会担心用您的方法也会改变其他 RAISE 语句。
关于database - 无法在 PostgreSQL 中更新 View "routines",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23192648/