postgresql/src
Tom Lane 3d332c8f38 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.
2011-10-05 20:44:22 -04:00
..
backend Improve and simplify CREATE EXTENSION's management of GUC variables. 2011-10-05 20:44:22 -04:00
bin Un-break compression of plain-text output format in pg_dump. 2011-09-25 13:59:35 -04:00
include Improve and simplify CREATE EXTENSION's management of GUC variables. 2011-10-05 20:44:22 -04:00
interfaces Stamp 9.1.1. 2011-09-22 17:57:57 -04:00
makefiles Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS. 2011-08-24 15:17:03 -04:00
pl Translation updates for 9.1.0 2011-09-08 23:10:40 +03:00
port Stamp 9.1.1. 2011-09-22 17:57:57 -04:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Fix window functions that sort by expressions involving aggregates. 2011-09-26 23:49:12 -04:00
timezone Fix our mapping of Windows timezones for Central America. 2011-09-23 22:12:36 -04:00
tools Fix MinGW build, broken by my previous patch to add a setlocale() wrapper 2011-09-01 14:04:19 +03:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:27 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:50 -04:00
nls-global.mk Fix makefile logic to not break the build when xgettext is missing 2010-10-14 23:16:46 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00