PostgreSql own debug messages

Koszyk posted 3 months ago in General

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 posted 3 months ago

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 posted 3 months ago

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

ansgar posted 3 months ago

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 posted 3 months ago

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

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

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


Koszyk posted 3 months ago

It looks like on the attached image.

1 attachment(s):
  • msg
ansgar posted 3 months ago

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 posted 2 months ago

It would be great for function debugging.

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