flamewheel
flamewheel

Reputation: 121

plpgsql - pgAdmin 4 doesn't show RAISE messages (ex., NOTICE)

I recently installed pgAdmin 4 after using pgAdmin III for a long time. I noticed that nothing was showing up under Messages after running a plpgsql function with RAISE NOTICE. I went to https://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html and tried doing:

set client_min_messages = 'NOTICE';

Also tried setting to various levels of DEBUG, but still nothing showed up. The NOTICEs will appear when connected using pgAdmin III, so I figured there's just some difference between the two that I'm not seeing.

In case somebody asks, I just tried one of the example functions from Postgres to test this out:

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;

In pgAdmin III, the expected notices are raised:

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.

Thanks in advance for any suggestions or answers!

Upvotes: 4

Views: 9843

Answers (1)

Murtuza Z
Murtuza Z

Reputation: 6017

I am able to see it Properly, Did you check in "Messages" Tab ?

Refer given screenshots.

enter image description here

enter image description here

UPDATE

Recently, They fixed some bug related to displaying messages in pgAdmin4. So it would be available in pgAdmin4 version 1.7.

Ref: https://redmine.postgresql.org/issues/2555

Upvotes: 4

Related Questions