I want to debug or use log for a PgSql stored Procedure. Can any one help me ?
The usual method is to use RAISE NOTICE inside of a PLPGSQL function:
create function test(some_string text) returns void as $$
BEGIN
RAISE NOTICE 'Some string: %', some_string;
END
$$
LANGUAGE PLPGSQL;
# select test('!');
psql: NOTICE: Some string: !
test
------
(1 row)
Whether this message actually shows up in the logs and for the client depends on the settings of log_min_messages and client_min_messages, respectively.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With