How to disable displaying of a NOTICE context?

Started by Dmitry Koterovabout 19 years ago4 messagesgeneral
Jump to latest
#1Dmitry Koterov
dmitry@koterov.ru

Hello.

With debug purposes I use RAISE NOTICE ... inside my stored
functions/triggers. But there is a little problem: if I run this
function/trigger inside psql command-line client (e.g.), it shows not only a
notice text, but also a caller context (started with "CONTEXT" substring)
which looks quite huge and ugly.

Is there any way to disable CONTEXT displaying with still enabled NOTICEs
text?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dmitry Koterov (#1)
Re: How to disable displaying of a NOTICE context?

"Dmitry Koterov" <dmitry@koterov.ru> writes:

Is there any way to disable CONTEXT displaying with still enabled NOTICEs
text?

You could do "\set VERBOSITY terse"

regards, tom lane

#3Dmitry Koterov
dmitry@koterov.ru
In reply to: Tom Lane (#2)
Re: How to disable displaying of a NOTICE context?

Thanks!

With RAISE NOTICE "terse" mode works great, CONTEXT is not shown.

But does "terse" also disable CONTEXT displaying on fatal errors inside a
stored function? If it does, it is not so useful as it could be, because I
don't think that fatal error context hiding is a good idea... No
documentation about it at all.

Show quoted text

On 3/13/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:

"Dmitry Koterov" <dmitry@koterov.ru> writes:

Is there any way to disable CONTEXT displaying with still enabled

NOTICEs

text?

You could do "\set VERBOSITY terse"

regards, tom lane

#4Bruce Momjian
bruce@momjian.us
In reply to: Dmitry Koterov (#3)
Re: How to disable displaying of a NOTICE context?

Dmitry Koterov wrote:

Thanks!

With RAISE NOTICE "terse" mode works great, CONTEXT is not shown.

But does "terse" also disable CONTEXT displaying on fatal errors inside a
stored function? If it does, it is not so useful as it could be, because I
don't think that fatal error context hiding is a good idea... No
documentation about it at all.

I think you need to set it to 'terse', use RAISE, then reset it.

---------------------------------------------------------------------------

On 3/13/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:

"Dmitry Koterov" <dmitry@koterov.ru> writes:

Is there any way to disable CONTEXT displaying with still enabled

NOTICEs

text?

You could do "\set VERBOSITY terse"

regards, tom lane

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +