pgsql: Remember the source GucContext for each GUC parameter.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remember the source GucContext for each GUC parameter.
Date: 2011-10-04 20:14:10
Message-ID: E1RBBNS-0001wB-Gy@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remember the source GucContext for each GUC parameter.

We used to just remember the GucSource, but saving GucContext too provides
a little more information --- notably, whether a SET was done by a
superuser or regular user. This allows us to rip out the fairly dodgy code
that define_custom_variable used to use to try to infer the context to
re-install a pre-existing setting with. In particular, it now works for
a superuser to SET a extension's SUSET custom variable before loading the
associated extension, because GUC can remember whether the SET was done as
a superuser or not. The plperl regression tests contain an example where
this is useful.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9f5836d224e876399dfdd7d6d4343300dbc2f664

Modified Files
--------------
src/backend/utils/misc/guc-file.l | 18 +++--
src/backend/utils/misc/guc.c | 108 +++++++++++++-----------------
src/include/utils/guc_tables.h | 14 ++--
src/pl/plperl/expected/plperl_init.out | 2 +-
src/pl/plperl/expected/plperl_shared.out | 3 +-
src/pl/plperl/expected/plperlu.out | 2 +-
src/pl/plperl/sql/plperl_init.sql | 2 +-
src/pl/plperl/sql/plperl_shared.sql | 3 +-
src/pl/plperl/sql/plperlu.sql | 2 +-
9 files changed, 73 insertions(+), 81 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-10-04 21:07:15 pgsql: Add sourcefile/sourceline data to EXEC_BACKEND GUC transmission
Previous Message Alex Hunsaker 2011-10-04 17:27:32 Re: Re: [COMMITTERS] pgsql: Force strings passed to and from plperl to be in UTF8 encoding.