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". --- src/pl/plperl/plperl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pl/plperl/plperl.c') diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index 9a94b3f0852..35bf72ca30f 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -363,7 +363,7 @@ _PG_init(void) &plperl_use_strict, false, PGC_USERSET, 0, - NULL, NULL); + NULL, NULL, NULL); /* * plperl.on_init is marked PGC_SIGHUP to support the idea that it might @@ -377,7 +377,7 @@ _PG_init(void) &plperl_on_init, NULL, PGC_SIGHUP, 0, - NULL, NULL); + NULL, NULL, NULL); /* * plperl.on_plperl_init is marked PGC_SUSET to avoid issues whereby a @@ -399,7 +399,7 @@ _PG_init(void) &plperl_on_plperl_init, NULL, PGC_SUSET, 0, - NULL, NULL); + NULL, NULL, NULL); DefineCustomStringVariable("plperl.on_plperlu_init", gettext_noop("Perl initialization code to execute once when plperlu is first used."), @@ -407,7 +407,7 @@ _PG_init(void) &plperl_on_plperlu_init, NULL, PGC_SUSET, 0, - NULL, NULL); + NULL, NULL, NULL); EmitWarningsOnPlaceholders("plperl"); -- cgit v1.2.3