mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Revise the API for GUC variable assign hooks.
The previous functions of assign hooks are now split between check hooks and assign hooks, where the former can fail but the latter shouldn't. Aside from being conceptually clearer, this approach exposes the "canonicalized" form of the variable value to guc.c without having to do an actual assignment. And that lets us fix the problem recently noted by Bernd Helmle that the auto-tune patch for wal_buffers resulted in bogus log messages about "parameter "wal_buffers" cannot be changed without restarting the server". There may be some speed advantage too, because this design lets hook functions avoid re-parsing variable values when restoring a previous state after a rollback (they can store a pre-parsed representation of the value instead). This patch also resolves a longstanding annoyance about custom error messages from variable assign hooks: they should modify, not appear separately from, guc.c's own message about "invalid parameter value".
This commit is contained in:
@ -13,31 +13,28 @@
|
||||
#include "utils/guc.h"
|
||||
|
||||
|
||||
extern const char *assign_datestyle(const char *value,
|
||||
bool doit, GucSource source);
|
||||
extern const char *assign_timezone(const char *value,
|
||||
bool doit, GucSource source);
|
||||
extern bool check_datestyle(char **newval, void **extra, GucSource source);
|
||||
extern void assign_datestyle(const char *newval, void *extra);
|
||||
extern bool check_timezone(char **newval, void **extra, GucSource source);
|
||||
extern void assign_timezone(const char *newval, void *extra);
|
||||
extern const char *show_timezone(void);
|
||||
extern const char *assign_log_timezone(const char *value,
|
||||
bool doit, GucSource source);
|
||||
extern bool check_log_timezone(char **newval, void **extra, GucSource source);
|
||||
extern void assign_log_timezone(const char *newval, void *extra);
|
||||
extern const char *show_log_timezone(void);
|
||||
extern bool assign_transaction_read_only(bool value,
|
||||
bool doit, GucSource source);
|
||||
extern const char *assign_XactIsoLevel(const char *value,
|
||||
bool doit, GucSource source);
|
||||
extern bool check_transaction_read_only(bool *newval, void **extra, GucSource source);
|
||||
extern bool check_XactIsoLevel(char **newval, void **extra, GucSource source);
|
||||
extern void assign_XactIsoLevel(const char *newval, void *extra);
|
||||
extern const char *show_XactIsoLevel(void);
|
||||
extern bool assign_transaction_deferrable(bool newval, bool doit,
|
||||
GucSource source);
|
||||
extern bool assign_random_seed(double value,
|
||||
bool doit, GucSource source);
|
||||
extern bool check_transaction_deferrable(bool *newval, void **extra, GucSource source);
|
||||
extern bool check_random_seed(double *newval, void **extra, GucSource source);
|
||||
extern void assign_random_seed(double newval, void *extra);
|
||||
extern const char *show_random_seed(void);
|
||||
extern const char *assign_client_encoding(const char *value,
|
||||
bool doit, GucSource source);
|
||||
extern const char *assign_role(const char *value,
|
||||
bool doit, GucSource source);
|
||||
extern bool check_client_encoding(char **newval, void **extra, GucSource source);
|
||||
extern void assign_client_encoding(const char *newval, void *extra);
|
||||
extern bool check_session_authorization(char **newval, void **extra, GucSource source);
|
||||
extern void assign_session_authorization(const char *newval, void *extra);
|
||||
extern bool check_role(char **newval, void **extra, GucSource source);
|
||||
extern void assign_role(const char *newval, void *extra);
|
||||
extern const char *show_role(void);
|
||||
extern const char *assign_session_authorization(const char *value,
|
||||
bool doit, GucSource source);
|
||||
extern const char *show_session_authorization(void);
|
||||
|
||||
#endif /* VARIABLE_H */
|
||||
|
Reference in New Issue
Block a user