Thread: Quiet "CONTEXT"?

Quiet "CONTEXT"?

From
Mike Toews
Date:
Hi all,

I'm in the process of debugging some PL/pgSQL functions. I have function
A which calls function B (e.g. on Line 22). The debugging info I'm
interested in is in function B, but I call function A (since there are
other C, D, F functions called from A). However, what I see is really
distracting:

INFO:  First message from B
CONTEXT:  SQL statement "SELECT b( $1 ,  $2  ||  $3 ,  $4 )"
PL/pgSQL function "a" line 22 at SQL statement
NOTICE:  Second message from B
CONTEXT:  SQL statement "SELECT b( $1 ,  $2  ||  $3 ,  $4 )"
PL/pgSQL function "a" line 22 at SQL statement
NOTICE:  Third message from B
CONTEXT:  SQL statement "SELECT b( $1 ,  $2  ||  $3 ,  $4 )"
PL/pgSQL function "a" line 22 at SQL statement

whereas I'd like to see the output as if I performed function B
directly, i.e.:
INFO:  First message from B
NOTICE:  Second message from B
NOTICE:  Third message from B

My question is if there is any way to quiet the context messages (i.e.,
reduce the verbosity)? Could this be done by setting a parameter?

Thanks in advance.

-Mike

Re: Quiet "CONTEXT"?

From
Tom Lane
Date:
Mike Toews <mwtoews@sfu.ca> writes:
> My question is if there is any way to quiet the context messages (i.e.,
> reduce the verbosity)? Could this be done by setting a parameter?

In psql, "\set VERBOSITY terse" might approximate what you want.

            regards, tom lane

Re: Quiet "CONTEXT"?

From
Mike Toews
Date:
Tom Lane wrote:
> In psql, "\set VERBOSITY terse" might approximate what you want.
>

This works perfectly in psql (exactly what I wanted). However, I'm most
comfortable using PgAdminIII, and I've tried adding "SET VERBOSITY TO
terse;" to either the first command or within the PL/pgSQL function and
get the same error:

    unrecognized configuration parameter "verbosity"

Is the feature described above unique only to psql? or how can I modify
either the function or PgAdminIII session to achieve the same behaviour?

Thanks again!

-Mike

Re: Quiet "CONTEXT"?

From
Tom Lane
Date:
Mike Toews <mwtoews@sfu.ca> writes:
> Tom Lane wrote:
>> In psql, "\set VERBOSITY terse" might approximate what you want.

> Is the feature described above unique only to psql?

In that form it's psql-specific.  I dunno whether pgAdmin has something
comparable ... you might try asking on their mailing list.

            regards, tom lane

Re: Quiet "CONTEXT"?

From
Alvaro Herrera
Date:
Mike Toews wrote:

> This works perfectly in psql (exactly what I wanted). However, I'm most
> comfortable using PgAdminIII, and I've tried adding "SET VERBOSITY TO
> terse;" to either the first command or within the PL/pgSQL function and
> get the same error:
>
>    unrecognized configuration parameter "verbosity"
>
> Is the feature described above unique only to psql? or how can I modify
> either the function or PgAdminIII session to achieve the same behaviour?

Error reports are always sent by the server to client in full.  It's up
to the client to do interesting things to them; psql is able to display
it in full, or only the most interesting bits, by changing the
"verbosity", which is what \set does.  This does not change anything in
the server.  This means that if you want pgAdmin to display less of the
message, it's something that pgAdmin must be told to do.  Perhaps having
a less verbose mode is just not implemented, or maybe it's a preference
option you can change.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support