Re: [BUGS] Bug #928: server_min_messages (log_min_messages - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [BUGS] Bug #928: server_min_messages (log_min_messages
Date
Msg-id 200305270358.h4R3wR617878@candle.pha.pa.us
Whole thread Raw
In response to Re: [BUGS] Bug #928: server_min_messages (log_min_messages in CVS)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] Bug #928: server_min_messages (log_min_messages in CVS)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I reviewed all the user-settable GUC variables and generated the
> > following patch --- there were quite a few other setting that should be
> > super-user only.
>
> Where in the world did you get the idea that debug settings should be
> SUSET?  The log_xxx settings probably should be, but I don't agree with

Do you think that is an appropriate way to respond to a patch?

> the rest of these changes ...

The reason I changed the debug_ ones is that those go directly to the
server log file, not to the client.  If you are worried about filling up
the server log files, those debug outputs could really fill things up
quickly.  If something is going only to the server logs, does it make
sense for non-super users to be able to change it?

However, I now remember that you can set client_min_messages to DEBUG5
and see those debug messages.  If we want to still allow debug_* display
to the client by non-super users, we have to give up the idea of
preventing server log filling.  Of course, even with debug_ prevented,
it is still possible to fill up the log file, so probably restricting
the debug_* isn't worth it.

New patch attached, that does just the log_ ones.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/utils/misc/guc.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/utils/misc/guc.c,v
retrieving revision 1.124
diff -c -c -r1.124 guc.c
*** src/backend/utils/misc/guc.c    14 May 2003 03:26:02 -0000    1.124
--- src/backend/utils/misc/guc.c    27 May 2003 03:46:27 -0000
***************
*** 400,410 ****
  #endif

      {
!         {"log_statement", PGC_USERSET}, &log_statement,
          false, NULL, NULL
      },
      {
!         {"log_duration", PGC_USERSET}, &log_duration,
          false, NULL, NULL
      },
      {
--- 400,410 ----
  #endif

      {
!         {"log_statement", PGC_SUSET}, &log_statement,
          false, NULL, NULL
      },
      {
!         {"log_duration", PGC_SUSET}, &log_duration,
          false, NULL, NULL
      },
      {
***************
*** 425,443 ****
      },

      {
!         {"log_parser_stats", PGC_USERSET}, &log_parser_stats,
          false, NULL, NULL
      },
      {
!         {"log_planner_stats", PGC_USERSET}, &log_planner_stats,
          false, NULL, NULL
      },
      {
!         {"log_executor_stats", PGC_USERSET}, &log_executor_stats,
          false, NULL, NULL
      },
      {
!         {"log_statement_stats", PGC_USERSET}, &log_statement_stats,
          false, NULL, NULL
      },
  #ifdef BTREE_BUILD_STATS
--- 425,443 ----
      },

      {
!         {"log_parser_stats", PGC_SUSET}, &log_parser_stats,
          false, NULL, NULL
      },
      {
!         {"log_planner_stats", PGC_SUSET}, &log_planner_stats,
          false, NULL, NULL
      },
      {
!         {"log_executor_stats", PGC_SUSET}, &log_executor_stats,
          false, NULL, NULL
      },
      {
!         {"log_statement_stats", PGC_SUSET}, &log_statement_stats,
          false, NULL, NULL
      },
  #ifdef BTREE_BUILD_STATS
***************
*** 791,797 ****
      },

      {
!         {"log_min_error_statement", PGC_USERSET}, &log_min_error_statement_str,
          "panic", assign_min_error_statement, NULL
      },

--- 791,797 ----
      },

      {
!         {"log_min_error_statement", PGC_SUSET}, &log_min_error_statement_str,
          "panic", assign_min_error_statement, NULL
      },

***************
*** 878,884 ****
      },

      {
!         {"log_min_messages", PGC_USERSET}, &log_min_messages_str,
          "notice", assign_log_min_messages, NULL
      },

--- 878,884 ----
      },

      {
!         {"log_min_messages", PGC_SUSET}, &log_min_messages_str,
          "notice", assign_log_min_messages, NULL
      },


pgsql-patches by date:

Previous
From: Rod Taylor
Date:
Subject: Sequence usage patch
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] Bug #928: server_min_messages (log_min_messages in CVS)