如何修复Postgresql-9.6中的json_object错误?

Zabbix具有PostgreSQL数据库监视功能。 Zabbix中有一个不断发生垃圾邮件错误的触发器:

ERROR:  function json_object(text[],text[]) does not exist
LINE 11:    SELECT json_object(array_agg(name),array_agg(setting)) F...
                           ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
SQL state: 42883
Character: 190

找到一个模板,在该模板中注册了此触发器。这是标准的,我试图在Postgres中单独请求一行,结果出现相同的错误。 请求本身:

select json_build_object('extensions',(select array_agg(extname) from (select extname from pg_extension order by extname) as e),'settings',(select json_object(array_agg(name),array_agg(setting)) from (select name,setting from pg_settings where name != 'application_name' order by name) as s));

我要你告诉你出什么问题了。

luofeihuai7713 回答:如何修复Postgresql-9.6中的json_object错误?

自9.4版开始,函数json_object(text[],text[])在PostgreSQL(documentation)中存在。 您确定使用9.4或更高版本吗?您可以通过以下方式进行检查:

SELECT version();
本文链接:https://www.f2er.com/2685582.html

大家都在问