Skip to content

Commit 7ac918a

Browse files
committed
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
1 parent 3853664 commit 7ac918a

File tree

1 file changed

+32
-37
lines changed

1 file changed

+32
-37
lines changed

src/include/utils/guc.h

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -202,44 +202,39 @@ typedef enum
202202
#define GUC_QUALIFIER_SEPARATOR '.'
203203

204204
/*
205-
* bit values in "flags" of a GUC variable
205+
* Bit values in "flags" of a GUC variable. Note that these don't appear
206+
* on disk, so we can reassign their values freely.
206207
*/
207-
#define GUC_LIST_INPUT 0x0001 /* input can be list format */
208-
#define GUC_LIST_QUOTE 0x0002 /* double-quote list elements */
209-
#define GUC_NO_SHOW_ALL 0x0004 /* exclude from SHOW ALL */
210-
#define GUC_NO_RESET 0x400000 /* disallow RESET and SAVE */
211-
#define GUC_NO_RESET_ALL 0x0008 /* exclude from RESET ALL */
212-
#define GUC_REPORT 0x0010 /* auto-report changes to client */
213-
#define GUC_NOT_IN_SAMPLE 0x0020 /* not in postgresql.conf.sample */
214-
#define GUC_DISALLOW_IN_FILE 0x0040 /* can't set in postgresql.conf */
215-
#define GUC_CUSTOM_PLACEHOLDER 0x0080 /* placeholder for custom variable */
216-
#define GUC_SUPERUSER_ONLY 0x0100 /* show only to superusers */
217-
#define GUC_IS_NAME 0x0200 /* limit string to NAMEDATALEN-1 */
218-
#define GUC_NOT_WHILE_SEC_REST 0x0400 /* can't set if security restricted */
219-
#define GUC_DISALLOW_IN_AUTO_FILE 0x0800 /* can't set in
220-
* PG_AUTOCONF_FILENAME */
221-
222-
#define GUC_UNIT_KB 0x1000 /* value is in kilobytes */
223-
#define GUC_UNIT_BLOCKS 0x2000 /* value is in blocks */
224-
#define GUC_UNIT_XBLOCKS 0x3000 /* value is in xlog blocks */
225-
#define GUC_UNIT_MB 0x4000 /* value is in megabytes */
226-
#define GUC_UNIT_BYTE 0x5000 /* value is in bytes */
227-
#define GUC_UNIT_MEMORY 0xF000 /* mask for size-related units */
228-
229-
#define GUC_UNIT_MS 0x10000 /* value is in milliseconds */
230-
#define GUC_UNIT_S 0x20000 /* value is in seconds */
231-
#define GUC_UNIT_MIN 0x30000 /* value is in minutes */
232-
#define GUC_UNIT_TIME 0xF0000 /* mask for time-related units */
233-
234-
#define GUC_EXPLAIN 0x100000 /* include in explain */
235-
236-
/*
237-
* GUC_RUNTIME_COMPUTED is intended for runtime-computed GUCs that are only
238-
* available via 'postgres -C' if the server is not running.
239-
*/
240-
#define GUC_RUNTIME_COMPUTED 0x200000
241-
242-
#define GUC_UNIT (GUC_UNIT_MEMORY | GUC_UNIT_TIME)
208+
#define GUC_LIST_INPUT 0x000001 /* input can be list format */
209+
#define GUC_LIST_QUOTE 0x000002 /* double-quote list elements */
210+
#define GUC_NO_SHOW_ALL 0x000004 /* exclude from SHOW ALL */
211+
#define GUC_NO_RESET 0x000008 /* disallow RESET and SAVE */
212+
#define GUC_NO_RESET_ALL 0x000010 /* exclude from RESET ALL */
213+
#define GUC_EXPLAIN 0x000020 /* include in EXPLAIN */
214+
#define GUC_REPORT 0x000040 /* auto-report changes to client */
215+
#define GUC_NOT_IN_SAMPLE 0x000080 /* not in postgresql.conf.sample */
216+
#define GUC_DISALLOW_IN_FILE 0x000100 /* can't set in postgresql.conf */
217+
#define GUC_CUSTOM_PLACEHOLDER 0x000200 /* placeholder for custom variable */
218+
#define GUC_SUPERUSER_ONLY 0x000400 /* show only to superusers */
219+
#define GUC_IS_NAME 0x000800 /* limit string to NAMEDATALEN-1 */
220+
#define GUC_NOT_WHILE_SEC_REST 0x001000 /* can't set if security restricted */
221+
#define GUC_DISALLOW_IN_AUTO_FILE \
222+
0x002000 /* can't set in PG_AUTOCONF_FILENAME */
223+
#define GUC_RUNTIME_COMPUTED 0x004000 /* delay processing in 'postgres -C' */
224+
225+
#define GUC_UNIT_KB 0x01000000 /* value is in kilobytes */
226+
#define GUC_UNIT_BLOCKS 0x02000000 /* value is in blocks */
227+
#define GUC_UNIT_XBLOCKS 0x03000000 /* value is in xlog blocks */
228+
#define GUC_UNIT_MB 0x04000000 /* value is in megabytes */
229+
#define GUC_UNIT_BYTE 0x05000000 /* value is in bytes */
230+
#define GUC_UNIT_MEMORY 0x0F000000 /* mask for size-related units */
231+
232+
#define GUC_UNIT_MS 0x10000000 /* value is in milliseconds */
233+
#define GUC_UNIT_S 0x20000000 /* value is in seconds */
234+
#define GUC_UNIT_MIN 0x30000000 /* value is in minutes */
235+
#define GUC_UNIT_TIME 0x70000000 /* mask for time-related units */
236+
237+
#define GUC_UNIT (GUC_UNIT_MEMORY | GUC_UNIT_TIME)
243238

244239

245240
/* GUC vars that are actually defined in guc_tables.c, rather than elsewhere */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy