Thread: Missing INFO on client_min_messages

Missing INFO on client_min_messages

From
Marcos Pegoraro
Date:
If I try to set client_min_messages with a wrong value it raises an error and its hint is 
"Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error."

Why is not INFO option on this hint ?

regards
Marcos

Re: Missing INFO on client_min_messages

From
"David G. Johnston"
Date:
On Sunday, November 24, 2024, Marcos Pegoraro <marcos@f10.com.br> wrote:
If I try to set client_min_messages with a wrong value it raises an error and its hint is 
"Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error."

Why is not INFO option on this hint ?

The definition of info is:
Provides information implicitly requested by the user

Requested information by the client should not be allowed to be suppressed by the client.

David J.

Re: Missing INFO on client_min_messages

From
Tom Lane
Date:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Sunday, November 24, 2024, Marcos Pegoraro <marcos@f10.com.br> wrote:
>> If I try to set client_min_messages with a wrong value it raises an error
>> and its hint is
>> "Available values: debug5, debug4, debug3, debug2, debug1, log, notice,
>> warning, error."
>> Why is not INFO option on this hint ?

> The definition of info is:
> Provides information implicitly requested by the user
> Requested information by the client should not be allowed to be suppressed
> by the client.

Yeah.  You can set it to INFO if you like, but the behavior is not
different from setting it to NOTICE.  So apparently we decided long
ago that showing INFO as a possible option was more confusing than
not showing it.

            regards, tom lane



Re: Missing INFO on client_min_messages

From
Marcos Pegoraro
Date:
Em dom., 24 de nov. de 2024 às 13:57, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
Yeah.  You can set it to INFO if you like, but the behavior is not
different from setting it to NOTICE. 

No, I don't think they have the same behavior.
If you set client_min_messages to Error then notice will not be sent, info will will be sent anyway

postgres=# set client_min_messages = Notice;
SET
postgres=# do $$begin raise INFO 'Sending to client INFO';end;$$;
INFO:  Sending to client INFO
DO
postgres=# do $$begin raise NOTICE 'Sending to client NOTICE';end;$$;
NOTICE:  Sending to client Notice
DO

postgres=# set client_min_messages = error;
SET
postgres=# do $$begin raise INFO 'Sending to client INFO';end;$$;
INFO:  Sending to client INFO
DO
postgres=# do $$begin raise NOTICE 'Sending to client NOTICE';end;$$;
DO


regards
Marcos