在CentOS 6.5上安装了postgresql-9.0.15。我有一个plperlu函数,输出INFO信息。我想在测试期间(使用psql进行测试),将其屏蔽,但我甚至似乎无法从pgAdminIII(1.18.1为win2003)查询窗口执行此操作:
SET client_min_messages TO WARNING;
select my_info_outputting_function('lalala')
我运行了这段代码并查看了“消息”选项卡,我的INFO消息就在那里。
(这可能与如何在运行psql脚本时抑制INFO消息类似,但我不想为整个会话禁用INFO消息,只想在某些部分禁用并将最小值设置回NOTICE。)
我以上面的代码片段做错了什么?client_min_messages不适用于pl/perlu函数吗?
更新:经过进一步调查,即使是plpgsql函数也会发生这种情况,而不仅仅是plperlu函数:
create or replace function my_info_outputting_function() returns void as $$
begin
raise INFO 'this should not appear...';
return;
end;
$$ language plpgsql;
SET client_min_messages TO WARNING;
select my_info_outputting_function();
我在pgAdminIII查询窗口中运行了上面的代码片段,结果“this should not appear”出现在消息选项卡中。这是为什么?
更新2: 我也尝试了log_min_messages,结果行为相同。