diff options
author | Tom Lane | 2011-04-07 04:11:01 +0000 |
---|---|---|
committer | Tom Lane | 2011-04-07 04:12:02 +0000 |
commit | 2594cf0e8c04406ffff19b1651c5a406d376657c (patch) | |
tree | 8ced737d26b54f4499a8029d8cad0ab42fc83ba3 /src/test | |
parent | 5d0e462366f4521e37744fdb42fed3c6819a3374 (diff) |
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".
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/expected/guc.out | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/regress/expected/guc.out b/src/test/regress/expected/guc.out index a0e24e84cbf..98671a2bcdf 100644 --- a/src/test/regress/expected/guc.out +++ b/src/test/regress/expected/guc.out @@ -622,7 +622,8 @@ alter function report_guc(text) set search_path = no_such_schema; NOTICE: schema "no_such_schema" does not exist -- with error occurring here select report_guc('work_mem'), current_setting('work_mem'); -ERROR: schema "no_such_schema" does not exist +ERROR: invalid value for parameter "search_path": "no_such_schema" +DETAIL: schema "no_such_schema" does not exist alter function report_guc(text) reset search_path set work_mem = '2MB'; select report_guc('work_mem'), current_setting('work_mem'); report_guc | current_setting |