pgsql: Add infrastructure to save and restore GUC values.

Started by Robert Haasover 11 years ago4 messagescomitters
Jump to latest
#1Robert Haas
robertmhaas@gmail.com

Add infrastructure to save and restore GUC values.

This is further infrastructure for parallelism.

Amit Khandekar, Noah Misch, Robert Haas

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f5d9698a8400972bd604069a3f15ca33e535ea6e

Modified Files
--------------
contrib/dblink/dblink.c | 2 +-
contrib/postgres_fdw/postgres_fdw.c | 6 +-
src/backend/commands/extension.c | 6 +-
src/backend/utils/adt/ri_triggers.c | 2 +-
src/backend/utils/misc/guc-file.l | 4 +-
src/backend/utils/misc/guc.c | 461 ++++++++++++++++++++++++++++++++---
src/include/utils/guc.h | 8 +-
7 files changed, 446 insertions(+), 43 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Robert Haas (#1)
Re: pgsql: Add infrastructure to save and restore GUC values.

On 11/25/2014 12:17 AM, Robert Haas wrote:

Add infrastructure to save and restore GUC values.

This is further infrastructure for parallelism.

Amit Khandekar, Noah Misch, Robert Haas

guc.c: In function ‘EstimateGUCStateSpace’:
guc.c:8506:7: warning: ‘valsize’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
Size valsize;
^
guc.c: In function ‘SerializeGUCState’:
guc.c:8762:56: warning: ‘i_role’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
serialize_variable(&curptr, &bytes_left, guc_variables[i_role]);
^
- Heikki

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Heikki Linnakangas (#2)
Re: pgsql: Add infrastructure to save and restore GUC values.

Heikki Linnakangas <hlinnakangas@vmware.com> writes:

On 11/25/2014 12:17 AM, Robert Haas wrote:

Add infrastructure to save and restore GUC values.

guc.c: In function ‘EstimateGUCStateSpace’:
guc.c:8506:7: warning: ‘valsize’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
Size valsize;
^
guc.c: In function ‘SerializeGUCState’:
guc.c:8762:56: warning: ‘i_role’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
serialize_variable(&curptr, &bytes_left, guc_variables[i_role]);
^

I fixed the latter (my compiler was unhappy about it though not about
the former). I'm not sure whether Robert would prefer to fix
the former by adding a useless initialization or by adding a default:
to the switch. Personally I'd lean towards the initialization, though,
as a default: would suppress warnings about errors-of-omission if we
ever add more switch cases.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#4Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#3)
Re: pgsql: Add infrastructure to save and restore GUC values.

On Tue, Nov 25, 2014 at 3:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Heikki Linnakangas <hlinnakangas@vmware.com> writes:

On 11/25/2014 12:17 AM, Robert Haas wrote:

Add infrastructure to save and restore GUC values.

guc.c: In function ‘EstimateGUCStateSpace’:
guc.c:8506:7: warning: ‘valsize’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
Size valsize;
^
guc.c: In function ‘SerializeGUCState’:
guc.c:8762:56: warning: ‘i_role’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
serialize_variable(&curptr, &bytes_left, guc_variables[i_role]);
^

I fixed the latter (my compiler was unhappy about it though not about
the former). I'm not sure whether Robert would prefer to fix
the former by adding a useless initialization or by adding a default:
to the switch. Personally I'd lean towards the initialization, though,
as a default: would suppress warnings about errors-of-omission if we
ever add more switch cases.

Done.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers