summaryrefslogtreecommitdiff
path: root/src/include/utils/guc_tables.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-11-11 07:48:54 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-11-11 07:55:10 +0100
commitd2f24df19b7a42a0944a6926a0ca54168dcefe3a (patch)
treefe647c724aaa3a151f704f3958eca53989632ebb /src/include/utils/guc_tables.h
parente510378358540703a13b77090a0021853bae0745 (diff)
Clean up qsort comparison function for GUC entries
guc_var_compare() is invoked from qsort() on an array of struct config_generic, but the function accesses these directly as strings (char *). This relies on the name being the first field, so this works. But we can write this more clearly by using the struct and then accessing the field through the struct. Before the reorganization of the GUC structs (commit a13833c35f9), the old code was probably more convenient, but now we can write this more clearly and correctly. After this change, it is no longer required that the name is the first field in struct config_generic, so remove that comment. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/2c961fa1-14f6-44a2-985c-e30b95654e8d%40eisentraut.org
Diffstat (limited to 'src/include/utils/guc_tables.h')
-rw-r--r--src/include/utils/guc_tables.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/utils/guc_tables.h b/src/include/utils/guc_tables.h
index bbfcc633014..04cc60eb526 100644
--- a/src/include/utils/guc_tables.h
+++ b/src/include/utils/guc_tables.h
@@ -249,7 +249,7 @@ struct config_enum
struct config_generic
{
/* constant fields, must be set correctly in initial value: */
- const char *name; /* name of variable - MUST BE FIRST */
+ const char *name; /* name of variable */
GucContext context; /* context required to set the variable */
enum config_group group; /* to help organize variables by function */
const char *short_desc; /* short desc. of this variable's purpose */