Renumber GUC flags for a bit more sanity.

Push the units fields over to the left so that all the single-bit
flags can be together.  I considered rearranging the single-bit
flags to try to group flags with similar purposes, but eventually
decided that that involved too many judgment calls.

Discussion: https://postgr.es/m/17385-9ee529fb091f0ce5@postgresql.org
This commit is contained in:
Tom Lane 2022-09-27 11:51:06 -04:00
parent 3853664265
commit 7ac918ada0

View File

@ -202,44 +202,39 @@ typedef enum
#define GUC_QUALIFIER_SEPARATOR '.'
/*
* bit values in "flags" of a GUC variable
* Bit values in "flags" of a GUC variable. Note that these don't appear
* on disk, so we can reassign their values freely.
*/
#define GUC_LIST_INPUT 0x0001 /* input can be list format */
#define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */
#define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */
#define GUC_NO_RESET 0x400000 /* disallow RESET and SAVE */
#define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */
#define GUC_REPORT 0x0010 /* auto-report changes to client */
#define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */
#define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */
#define GUC_CUSTOM_PLACEHOLDER 0x0080 /* placeholder for custom variable */
#define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */
#define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */
#define GUC_NOT_WHILE_SEC_REST 0x0400 /* can't set if security restricted */
#define GUC_DISALLOW_IN_AUTO_FILE 0x0800 /* can't set in
* PG_AUTOCONF_FILENAME */
#define GUC_LIST_INPUT 0x000001 /* input can be list format */
#define GUC_LIST_QUOTE 0x000002 /* double-quote list elements */
#define GUC_NO_SHOW_ALL 0x000004 /* exclude from SHOW ALL */
#define GUC_NO_RESET 0x000008 /* disallow RESET and SAVE */
#define GUC_NO_RESET_ALL 0x000010 /* exclude from RESET ALL */
#define GUC_EXPLAIN 0x000020 /* include in EXPLAIN */
#define GUC_REPORT 0x000040 /* auto-report changes to client */
#define GUC_NOT_IN_SAMPLE 0x000080 /* not in postgresql.conf.sample */
#define GUC_DISALLOW_IN_FILE 0x000100 /* can't set in postgresql.conf */
#define GUC_CUSTOM_PLACEHOLDER 0x000200 /* placeholder for custom variable */
#define GUC_SUPERUSER_ONLY 0x000400 /* show only to superusers */
#define GUC_IS_NAME 0x000800 /* limit string to NAMEDATALEN-1 */
#define GUC_NOT_WHILE_SEC_REST 0x001000 /* can't set if security restricted */
#define GUC_DISALLOW_IN_AUTO_FILE \
0x002000 /* can't set in PG_AUTOCONF_FILENAME */
#define GUC_RUNTIME_COMPUTED 0x004000 /* delay processing in 'postgres -C' */
#define GUC_UNIT_KB 0x1000 /* value is in kilobytes */
#define GUC_UNIT_BLOCKS 0x2000 /* value is in blocks */
#define GUC_UNIT_XBLOCKS 0x3000 /* value is in xlog blocks */
#define GUC_UNIT_MB 0x4000 /* value is in megabytes */
#define GUC_UNIT_BYTE 0x5000 /* value is in bytes */
#define GUC_UNIT_MEMORY 0xF000 /* mask for size-related units */
#define GUC_UNIT_KB 0x01000000 /* value is in kilobytes */
#define GUC_UNIT_BLOCKS 0x02000000 /* value is in blocks */
#define GUC_UNIT_XBLOCKS 0x03000000 /* value is in xlog blocks */
#define GUC_UNIT_MB 0x04000000 /* value is in megabytes */
#define GUC_UNIT_BYTE 0x05000000 /* value is in bytes */
#define GUC_UNIT_MEMORY 0x0F000000 /* mask for size-related units */
#define GUC_UNIT_MS 0x10000 /* value is in milliseconds */
#define GUC_UNIT_S 0x20000 /* value is in seconds */
#define GUC_UNIT_MIN 0x30000 /* value is in minutes */
#define GUC_UNIT_TIME 0xF0000 /* mask for time-related units */
#define GUC_UNIT_MS 0x10000000 /* value is in milliseconds */
#define GUC_UNIT_S 0x20000000 /* value is in seconds */
#define GUC_UNIT_MIN 0x30000000 /* value is in minutes */
#define GUC_UNIT_TIME 0x70000000 /* mask for time-related units */
#define GUC_EXPLAIN 0x100000 /* include in explain */
/*
* GUC_RUNTIME_COMPUTED is intended for runtime-computed GUCs that are only
* available via 'postgres -C' if the server is not running.
*/
#define GUC_RUNTIME_COMPUTED 0x200000
#define GUC_UNIT (GUC_UNIT_MEMORY | GUC_UNIT_TIME)
#define GUC_UNIT (GUC_UNIT_MEMORY | GUC_UNIT_TIME)
/* GUC vars that are actually defined in guc_tables.c, rather than elsewhere */