summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-10-05 20:44:22 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-10-05 20:44:22 -0400
commit3d332c8f38ced56fc7e867cce1d2b1c85dc5c064 (patch)
tree29c7437cac99c43b85f84a75d2892125d6de166e /src/bin
parent99576e01a18ba3558aac20ef1715f1627ec70939 (diff)
downloadpostgresql-3d332c8f38ced56fc7e867cce1d2b1c85dc5c064.tar.gz
Improve and simplify CREATE EXTENSION's management of GUC variables.
CREATE EXTENSION needs to transiently set search_path, as well as client_min_messages and log_min_messages. We were doing this by the expedient of saving the current string value of each variable, doing a SET LOCAL, and then doing another SET LOCAL with the previous value at the end of the command. This is a bit expensive though, and it also fails badly if there is anything funny about the existing search_path value, as seen in a recent report from Roger Niederland. Fortunately, there's a much better way, which is to piggyback on the GUC infrastructure previously developed for functions with SET options. We just open a new GUC nesting level, do our assignments with GUC_ACTION_SAVE, and then close the nesting level when done. This automatically restores the prior settings without a re-parsing pass, so (in principle anyway) there can't be an error. And guc.c still takes care of cleanup in event of an error abort. The CREATE EXTENSION code for this was modeled on some much older code in ri_triggers.c, which I also changed to use the better method, even though there wasn't really much risk of failure there. Also improve the comments in guc.c to reflect this additional usage.
Diffstat (limited to 'src/bin')
0 files changed, 0 insertions, 0 deletions