From 2594cf0e8c04406ffff19b1651c5a406d376657c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 7 Apr 2011 00:11:01 -0400 Subject: 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". --- contrib/sepgsql/hooks.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/sepgsql/hooks.c') diff --git a/contrib/sepgsql/hooks.c b/contrib/sepgsql/hooks.c index 27e85d25b1..5dc8a3ecaa 100644 --- a/contrib/sepgsql/hooks.c +++ b/contrib/sepgsql/hooks.c @@ -394,6 +394,7 @@ _PG_init(void) PGC_SIGHUP, GUC_NOT_IN_SAMPLE, NULL, + NULL, NULL); /* @@ -412,6 +413,7 @@ _PG_init(void) PGC_USERSET, GUC_NOT_IN_SAMPLE, NULL, + NULL, NULL); /* -- cgit v1.2.3