gpt4 book ai didi

postgresql - plpgsql - pgAdmin 4 不显示 RAISE 消息(例如,通知)

转载 作者:行者123 更新时间:2023-11-29 11:47:03 24 4
gpt4 key购买 nike

在长期使用 pgAdmin III 之后,我最近安装了 pgAdmin 4。我注意到在使用 RAISE NOTICE 运行 plpgsql 函数后,消息下没有显示任何内容。我去了https://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html并尝试做:

set client_min_messages = 'NOTICE';

也尝试设置为不同级别的 DEBUG,但仍然没有任何显示。使用 pgAdmin III 连接时会出现通知,因此我认为两者之间存在一些我没有看到的区别。

万一有人问,我只是尝试了 Postgres 中的一个示例函数来对此进行测试:

CREATE FUNCTION somefunc() RETURNS integer AS $$
<< outerblock >>
DECLARE
quantity integer := 30;
BEGIN
RAISE NOTICE 'Quantity here is %', quantity; -- Prints 30
quantity := 50;
--
-- Create a subblock
--
DECLARE
quantity integer := 80;
BEGIN
RAISE NOTICE 'Quantity here is %', quantity; -- Prints 80
RAISE NOTICE 'Outer quantity here is %', outerblock.quantity; -- Prints 50
END;

RAISE NOTICE 'Quantity here is %', quantity; -- Prints 50

RETURN quantity;
END;
$$ LANGUAGE plpgsql;

在 pgAdmin III 中,出现了预期的通知:

NOTICE: Quantity here is 30 CONTEXT: PL/pgSQL function somefunc() line 6 at RAISE NOTICE: Quantity here is 80 CONTEXT: PL/pgSQL function somefunc() line 14 at RAISE NOTICE: Outer quantity here is 50 CONTEXT: PL/pgSQL function somefunc() line 15 at RAISE NOTICE: Quantity here is 50 CONTEXT: PL/pgSQL function somefunc() line 18 at RAISE

Total query runtime: 14 ms. 1 row retrieved.

提前感谢您的任何建议或答案!

最佳答案

我能正常看到它,你在“消息”选项卡中查看了吗?

引用给定的屏幕截图。

enter image description here

enter image description here

UPDATE

最近,他们修复了一些与在 pgAdmin4 中显示消息相关的错误。所以它将在 pgAdmin4 版本 1.7 中可用。

引用:https://redmine.postgresql.org/issues/2555

关于postgresql - plpgsql - pgAdmin 4 不显示 RAISE 消息(例如,通知),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41991037/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com