]> granicus.if.org Git - postgresql/commit
Revise the API for GUC variable assign hooks.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Apr 2011 04:11:01 +0000 (00:11 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Apr 2011 04:12:02 +0000 (00:12 -0400)
commit2594cf0e8c04406ffff19b1651c5a406d376657c
tree8ced737d26b54f4499a8029d8cad0ab42fc83ba3
parent5d0e462366f4521e37744fdb42fed3c6819a3374
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".
35 files changed:
contrib/auth_delay/auth_delay.c
contrib/auto_explain/auto_explain.c
contrib/pg_stat_statements/pg_stat_statements.c
contrib/sepgsql/hooks.c
src/backend/access/transam/xlog.c
src/backend/catalog/namespace.c
src/backend/commands/tablespace.c
src/backend/commands/variable.c
src/backend/nls.mk
src/backend/replication/syncrep.c
src/backend/tcop/postgres.c
src/backend/utils/adt/datetime.c
src/backend/utils/adt/pg_locale.c
src/backend/utils/cache/ts_cache.c
src/backend/utils/error/elog.c
src/backend/utils/mb/mbutils.c
src/backend/utils/misc/README
src/backend/utils/misc/guc-file.l
src/backend/utils/misc/guc.c
src/backend/utils/misc/tzparser.c
src/include/commands/variable.h
src/include/mb/pg_wchar.h
src/include/replication/syncrep.h
src/include/tcop/tcopprot.h
src/include/tsearch/ts_cache.h
src/include/utils/datetime.h
src/include/utils/elog.h
src/include/utils/guc.h
src/include/utils/guc_tables.h
src/include/utils/pg_locale.h
src/include/utils/tzparser.h
src/pl/plperl/plperl.c
src/pl/plpgsql/src/pl_handler.c
src/test/regress/expected/guc.out
src/timezone/pgtz.c