RE: [EXT] Re: log_min_messages = warning - Mailing list pgsql-general

From Dirschel, Steve
Subject RE: [EXT] Re: log_min_messages = warning
Date
Msg-id DM6PR03MB43324EBE72A141DA36825271FA7E9@DM6PR03MB4332.namprd03.prod.outlook.com
Whole thread Raw
In response to Re: [EXT] Re: log_min_messages = warning  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [EXT] Re: log_min_messages = warning
List pgsql-general
>>>> We recently upgraded from postgres 12.8 to 14.3.  We are running 
>>>> Aurora Postgres on AWS.

>Aurora Postgres != Postgres.  This doesn't seem like something they'd change, but we can't rule that out entirely.

>>> Try:
>>> select setting, source, sourcefile, pending_restart from pg_settings 
>>> where name = 'log_min_messages';

>> shgroup02s=> select setting, source, sourcefile, pending_restart from 
>> pg_settings where name = 'log_min_messages';  setting | source  | 
>> sourcefile | pending_restart
>> ---------+---------+------------+-----------------
>>  warning | default |            | f
>> (1 row)

>OK, so log_min_messages has the expected value in your interactive session, and yet evidently not in the sessions
runningthese RAISE NOTICE commands.  Maybe you have done ALTER USER SET or ALTER DATABASE SET commands that'd change it
in>those sessions?  You could look in the pg_db_role_setting catalog to answer that definitively.
 

>            regards, tom lane

We have opened a case with AWS on this issue as well since it is Aurora but I decided to reach out to the community as
well. 
 

We have pg_cron (which is kicking off the procedures that are executing the code that is causing these NOTICE messages
toget written to the log file) setup with cron.database_name = shgroup02s.  That database is oid 16436.  
 

shgroup02s=> select * from pg_db_role_setting ;
 setdatabase | setrole |
                                         setconfig
 


-------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
       16401 |       0 | {auto_explain.log_min_duration=-1}
       16401 |      10 | {log_min_messages=panic}
       16436 |       0 | {TimeZone=America/Chicago}
           0 |      10 |
{TimeZone=utc,log_statement=all,log_min_error_statement=debug5,log_min_messages=panic,exit_on_error=0,statement_timeout=0,role=rdsadmin,auto_explain.log_min_duration=-1,temp_file_limit=
-1,"search_path=pg_catalog, public",pg_hint_plan.enable_hint=off,default_transaction_read_only=off}
(4 rows)

If I login to the shgroup02s database as postgres user (using psql) and interactively call a procedure that cron calls
whichcauses the RAISE NOTICE commands to be written to the log they do NOT get written to the log when I call the
procedure. The messages will be displayed on my screen but I don't see them getting written to the log.   I see cron
hasa setting-  cron.log_min_messages which is set to warning so it doesn't seem to come from that.
 

Regards
Steve

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: Feature proposal: immutable/sealed partitions (and maybe tables, too)
Next
From: Tom Lane
Date:
Subject: Re: [EXT] Re: log_min_messages = warning