4

I want to debug or use log for a PgSql stored Procedure. Can any one help me ?

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.