pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
RAISE INFO and client_min_messages
3+ messages / 2 participants
[nested] [flat]

* RAISE INFO and client_min_messages
@ 2017-03-23 09:03  Pavel Luzanov <p.luzanov@postgrespro.ru>
  0 siblings, 1 reply; 3+ messages in thread

From: Pavel Luzanov @ 2017-03-23 09:03 UTC (permalink / raw)
  To: pgsql-docs

Hello,

When working with RAISE statement in PL/pgSQL, I found a strange 
situation with client_min_messages.

According to the documentation, client_min_messages does not include the 
value 'INFO'.
Column enumval in pg_settings also does not contain this value:

=# select name, enumvals from pg_settings where name = 
'client_min_messages';
         name         | enumvals
---------------------+---------------------------------------------------------------
  client_min_messages | 
{debug5,debug4,debug3,debug2,debug1,log,notice,warning,error}

But when we run RAISE INFO statement in PL/pgSQL, client receive a 
message with any setting of client_min_messages, even most silent 'ERROR':
=# set client_min_messages = 'error';
SET
=# do $$begin raise info 'Hello, World!'; end;$$;
INFO:  Hello, World!
DO

Moreover, this parameter can be set to 'INFO':
=# set client_min_messages = 'info';
SET

In this case the behavior does not changes from default 'NOTICE'.

Do we need to change something in the documentation?


P.S. log_min_messages contains INFO and works accordingly.

-- 

-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: RAISE INFO and client_min_messages
@ 2017-03-23 14:39  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Pavel Luzanov <p.luzanov@postgrespro.ru>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2017-03-23 14:39 UTC (permalink / raw)
  To: Pavel Luzanov <p.luzanov@postgrespro.ru>; +Cc: pgsql-docs

Pavel Luzanov <p.luzanov@postgrespro.ru> writes:
> When working with RAISE statement in PL/pgSQL, I found a strange 
> situation with client_min_messages.

> According to the documentation, client_min_messages does not include the 
> value 'INFO'.

Indeed.  INFO messages cannot be suppressed by client_min_messages.
The reason is that they are emitted by commands like VACUUM VERBOSE,
where (presumably) the entire reason the user said VERBOSE is that
she wanted to see those messages.

I do not recommend using INFO in "RAISE" except in cases similar
to that one.

			regards, tom lane


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: RAISE INFO and client_min_messages
@ 2017-03-23 15:55  Pavel Luzanov <p.luzanov@postgrespro.ru>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Pavel Luzanov @ 2017-03-23 15:55 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

On 23.03.2017 17:39, Tom Lane wrote:
> Pavel Luzanov <p.luzanov@postgrespro.ru> writes:
>> When working with RAISE statement in PL/pgSQL, I found a strange
>> situation with client_min_messages.
>> According to the documentation, client_min_messages does not include the
>> value 'INFO'.
> Indeed.  INFO messages cannot be suppressed by client_min_messages.
> The reason is that they are emitted by commands like VACUUM VERBOSE,
> where (presumably) the entire reason the user said VERBOSE is that
> she wanted to see those messages.
>

Now, the reason for such behavior is clear.

As for me, adding one sentence to the end of current description for 
client_min_messages will make sence:

Controls which message levels are sent to the client. Valid values are 
DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, LOG, NOTICE, WARNING, ERROR, 
FATAL, and PANIC. Each level includes all the levels that follow it. The 
later the level, the fewer messages are sent. The default is NOTICE. 
Note that LOG has a different rank here than in log_min_messages. Also, 
messages with INFO level are sent to the client with any value of this 
parameter.

-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-03-23 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 09:03 RAISE INFO and client_min_messages Pavel Luzanov <p.luzanov@postgrespro.ru>
2017-03-23 14:39 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-03-23 15:55   ` Pavel Luzanov <p.luzanov@postgrespro.ru>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox