PostgreSql own debug messages

Koszyk's profile image Koszyk posted 5 years ago in General Permalink

Is it possible to display debug informations in some maybe separate window? I would like to see messages from my procedures. I mean:

RAISE NOTICE 'Some message %', some_variable

RAISE DEBUG 'Some message %', some_variable

and so on.

ansgar's profile image ansgar posted 5 years ago Permalink

This is not possible with HeidiSQL currently.

Is that "RAISE NOTICE" PostgreSQL syntax? I can execute that as a query without getting a syntax error.

Koszyk's profile image Koszyk posted 5 years ago Permalink

Yes, It's PostgreSql PL/pgSQL synax. Displayed message level is controled by session variable client_min_messages.

ansgar's profile image ansgar posted 5 years ago Permalink

Sorry, a made a typo. I meant I can not execute it without an error:

Syntaxfehler bei »RAISE«
LINE 1: RAISE DEBUG 'Some message %', some_variable
        ^
Koszyk's profile image Koszyk posted 5 years ago Permalink

Understood. You can't run it alone. It is used in function/procedure body. You can try nonymous block f.e.

DO language plpgsql $$
BEGIN
  RAISE NOTICE 'hello, world!';
END
$$;

(taken from) htp... stackoverflow.com / questions / 18828127 / how-to-run-an-ad-hoc-script-in-postgresql

.

Koszyk's profile image Koszyk posted 5 years ago Permalink

It looks like on the attached image.

1 attachment(s):
  • msg
ansgar's profile image ansgar posted 5 years ago Permalink

Ok, think I get an idea about messages in Postgres now. HeidiSQL handles MariaDB/MySQL messages, but not for Postgres currently. These seem to work differently, and there might be a bigger modification required to handle these properly.

Koszyk's profile image Koszyk posted 5 years ago Permalink

It would be great for function debugging.

Please login to leave a reply, or register at first.