Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* guc_tables.c
|
|
|
|
|
*
|
|
|
|
|
* Static tables for the Grand Unified Configuration scheme.
|
|
|
|
|
*
|
|
|
|
|
* Many of these tables are const. However, ConfigureNames[] is not, because
|
|
|
|
|
* the structs in it are actually the live per-variable state data that guc.c
|
|
|
|
|
* manipulates. While many of their fields are intended to be constant, some
|
|
|
|
|
* fields change at runtime.
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2000-2025, PostgreSQL Global Development Group
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
|
|
|
|
*
|
|
|
|
|
* IDENTIFICATION
|
|
|
|
|
* src/backend/utils/misc/guc_tables.c
|
|
|
|
|
*
|
|
|
|
|
*--------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
#include "postgres.h"
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_COPYFILE_H
|
|
|
|
|
#include <copyfile.h>
|
|
|
|
|
#endif
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include <float.h>
|
|
|
|
|
#include <limits.h>
|
|
|
|
|
#ifdef HAVE_SYSLOG
|
|
|
|
|
#include <syslog.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "access/commit_ts.h"
|
|
|
|
|
#include "access/gin.h"
|
Improve performance of subsystems on top of SLRU
More precisely, what we do here is make the SLRU cache sizes
configurable with new GUCs, so that sites with high concurrency and big
ranges of transactions in flight (resp. multixacts/subtransactions) can
benefit from bigger caches. In order for this to work with good
performance, two additional changes are made:
1. the cache is divided in "banks" (to borrow terminology from CPU
caches), and algorithms such as eviction buffer search only affect
one specific bank. This forestalls the problem that linear searching
for a specific buffer across the whole cache takes too long: we only
have to search the specific bank, whose size is small. This work is
authored by Andrey Borodin.
2. Change the locking regime for the SLRU banks, so that each bank uses
a separate LWLock. This allows for increased scalability. This work
is authored by Dilip Kumar. (A part of this was previously committed as
d172b717c6f4.)
Special care is taken so that the algorithms that can potentially
traverse more than one bank release one bank's lock before acquiring the
next. This should happen rarely, but particularly clog.c's group commit
feature needed code adjustment to cope with this. I (Álvaro) also added
lots of comments to make sure the design is sound.
The new GUCs match the names introduced by bcdfa5f2e2f2 in the
pg_stat_slru view.
The default values for these parameters are similar to the previous
sizes of each SLRU. commit_ts, clog and subtrans accept value 0, which
means to adjust by dividing shared_buffers by 512 (so 2MB for every 1GB
of shared_buffers), with a cap of 8MB. (A new slru.c function
SimpleLruAutotuneBuffers() was added to support this.) The cap was
previously 1MB for clog, so for sites with more than 512MB of shared
memory the total memory used increases, which is likely a good tradeoff.
However, other SLRUs (notably multixact ones) retain smaller sizes and
don't support a configured value of 0. These values based on
shared_buffers may need to be revisited, but that's an easy change.
There was some resistance to adding these new GUCs: it would be better
to adjust to memory pressure automatically somehow, for example by
stealing memory from shared_buffers (where the caches can grow and
shrink naturally). However, doing that seems to be a much larger
project and one which has made virtually no progress in several years,
and because this is such a pain point for so many users, here we take
the pragmatic approach.
Author: Andrey Borodin <x4mmm@yandex-team.ru>
Author: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Amul Sul, Gilles Darold, Anastasia Lubennikova,
Ivan Lazarev, Robert Haas, Thomas Munro, Tomas Vondra,
Yura Sokolov, Васильев Дмитрий (Dmitry Vasiliev).
Discussion: https://postgr.es/m/2BEC2B3F-9B61-4C1D-9FB5-5FAB0F05EF86@yandex-team.ru
Discussion: https://postgr.es/m/CAFiTN-vzDvNz=ExGXz6gdyjtzGixKSqs0mKHMmaQ8sOSEFZ33A@mail.gmail.com
2 years ago
|
|
|
#include "access/slru.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "access/toast_compression.h"
|
|
|
|
|
#include "access/twophase.h"
|
|
|
|
|
#include "access/xlog_internal.h"
|
|
|
|
|
#include "access/xlogprefetcher.h"
|
|
|
|
|
#include "access/xlogrecovery.h"
|
|
|
|
|
#include "access/xlogutils.h"
|
Redesign archive modules
A new callback named startup_cb, called shortly after a module is
loaded, is added. This makes possible the initialization of any
additional state data required by a module. This initial state data can
be saved in a ArchiveModuleState, that is now passed down to all the
callbacks that can be defined in a module. With this design, it is
possible to have a per-module state, aimed at opening the door to the
support of more than one archive module.
The initialization of the callbacks is changed so as
_PG_archive_module_init() does not anymore give in input a
ArchiveModuleCallbacks that a module has to fill in with callback
definitions. Instead, a module now needs to return a const
ArchiveModuleCallbacks.
All the structure and callback definitions of archive modules are moved
into their own header, named archive_module.h, from pgarch.h.
Command-based archiving follows the same line, with a new set of files
named shell_archive.{c,h}.
There are a few more items that are under discussion to improve the
design of archive modules, like the fact that basic_archive calls
sigsetjmp() by itself to define its own error handling flow. These will
be adjusted later, the changes done here cover already a good portion
of what has been discussed.
Any modules created for v15 will need to be adjusted to this new
design.
Author: Nathan Bossart
Reviewed-by: Andres Freund
Discussion: https://postgr.es/m/20230130194810.6fztfgbn32e7qarj@awork3.anarazel.de
3 years ago
|
|
|
#include "archive/archive_module.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "catalog/namespace.h"
|
|
|
|
|
#include "catalog/storage.h"
|
|
|
|
|
#include "commands/async.h"
|
|
|
|
|
#include "commands/extension.h"
|
|
|
|
|
#include "commands/event_trigger.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "commands/tablespace.h"
|
|
|
|
|
#include "commands/trigger.h"
|
|
|
|
|
#include "commands/user.h"
|
|
|
|
|
#include "commands/vacuum.h"
|
|
|
|
|
#include "common/file_utils.h"
|
|
|
|
|
#include "common/scram-common.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "jit/jit.h"
|
|
|
|
|
#include "libpq/auth.h"
|
|
|
|
|
#include "libpq/libpq.h"
|
Add support for OAUTHBEARER SASL mechanism
This commit implements OAUTHBEARER, RFC 7628, and OAuth 2.0 Device
Authorization Grants, RFC 8628. In order to use this there is a
new pg_hba auth method called oauth. When speaking to a OAuth-
enabled server, it looks a bit like this:
$ psql 'host=example.org oauth_issuer=... oauth_client_id=...'
Visit https://oauth.example.org/login and enter the code: FPQ2-M4BG
Device authorization is currently the only supported flow so the
OAuth issuer must support that in order for users to authenticate.
Third-party clients may however extend this and provide their own
flows. The built-in device authorization flow is currently not
supported on Windows.
In order for validation to happen server side a new framework for
plugging in OAuth validation modules is added. As validation is
implementation specific, with no default specified in the standard,
PostgreSQL does not ship with one built-in. Each pg_hba entry can
specify a specific validator or be left blank for the validator
installed as default.
This adds a requirement on libcurl for the client side support,
which is optional to build, but the server side has no additional
build requirements. In order to run the tests, Python is required
as this adds a https server written in Python. Tests are gated
behind PG_TEST_EXTRA as they open ports.
This patch has been a multi-year project with many contributors
involved with reviews and in-depth discussions: Michael Paquier,
Heikki Linnakangas, Zhihong Yu, Mahendrakar Srinivasarao, Andrey
Chudnovsky and Stephen Frost to name a few. While Jacob Champion
is the main author there have been some levels of hacking by others.
Daniel Gustafsson contributed the validation module and various bits
and pieces; Thomas Munro wrote the client side support for kqueue.
Author: Jacob Champion <jacob.champion@enterprisedb.com>
Co-authored-by: Daniel Gustafsson <daniel@yesql.se>
Co-authored-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Antonin Houska <ah@cybertec.at>
Reviewed-by: Kashif Zeeshan <kashi.zeeshan@gmail.com>
Discussion: https://postgr.es/m/d1b467a78e0e36ed85a09adf979d04cf124a9d4b.camel@vmware.com
10 months ago
|
|
|
#include "libpq/oauth.h"
|
|
|
|
|
#include "libpq/scram.h"
|
|
|
|
|
#include "nodes/queryjumble.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "optimizer/cost.h"
|
|
|
|
|
#include "optimizer/geqo.h"
|
|
|
|
|
#include "optimizer/optimizer.h"
|
|
|
|
|
#include "optimizer/paths.h"
|
|
|
|
|
#include "optimizer/planmain.h"
|
|
|
|
|
#include "parser/parse_expr.h"
|
|
|
|
|
#include "parser/parser.h"
|
|
|
|
|
#include "pgstat.h"
|
|
|
|
|
#include "postmaster/autovacuum.h"
|
|
|
|
|
#include "postmaster/bgworker_internals.h"
|
|
|
|
|
#include "postmaster/bgwriter.h"
|
|
|
|
|
#include "postmaster/postmaster.h"
|
|
|
|
|
#include "postmaster/startup.h"
|
|
|
|
|
#include "postmaster/syslogger.h"
|
Add a new WAL summarizer process.
When active, this process writes WAL summary files to
$PGDATA/pg_wal/summaries. Each summary file contains information for a
certain range of LSNs on a certain TLI. For each relation, it stores a
"limit block" which is 0 if a relation is created or destroyed within
a certain range of WAL records, or otherwise the shortest length to
which the relation was truncated during that range of WAL records, or
otherwise InvalidBlockNumber. In addition, it stores a list of blocks
which have been modified during that range of WAL records, but
excluding blocks which were removed by truncation after they were
modified and never subsequently modified again.
In other words, it tells us which blocks need to copied in case of an
incremental backup covering that range of WAL records. But this
doesn't yet add the capability to actually perform an incremental
backup; the next patch will do that.
A new parameter summarize_wal enables or disables this new background
process. The background process also automatically deletes summary
files that are older than wal_summarize_keep_time, if that parameter
has a non-zero value and the summarizer is configured to run.
Patch by me, with some design help from Dilip Kumar and Andres Freund.
Reviewed by Matthias van de Meent, Dilip Kumar, Jakub Wartak, Peter
Eisentraut, and Álvaro Herrera.
Discussion: http://postgr.es/m/CA+TgmoYOYZfMCyOXFyC-P+-mdrZqm5pP2N7S-r0z3_402h9rsA@mail.gmail.com
2 years ago
|
|
|
#include "postmaster/walsummarizer.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "postmaster/walwriter.h"
|
|
|
|
|
#include "replication/logicallauncher.h"
|
|
|
|
|
#include "replication/slot.h"
|
Add a new slot sync worker to synchronize logical slots.
By enabling slot synchronization, all the failover logical replication
slots on the primary (assuming configurations are appropriate) are
automatically created on the physical standbys and are synced
periodically. The slot sync worker on the standby server pings the primary
server at regular intervals to get the necessary failover logical slots
information and create/update the slots locally. The slots that no longer
require synchronization are automatically dropped by the worker.
The nap time of the worker is tuned according to the activity on the
primary. The slot sync worker waits for some time before the next
synchronization, with the duration varying based on whether any slots were
updated during the last cycle.
A new parameter sync_replication_slots enables or disables this new
process.
On promotion, the slot sync worker is shut down by the startup process to
drop any temporary slots acquired by the slot sync worker and to prevent
the worker from trying to fetch the failover slots.
A functionality to allow logical walsenders to wait for the physical will
be done in a subsequent commit.
Author: Shveta Malik, Hou Zhijie based on design inputs by Masahiko Sawada and Amit Kapila
Reviewed-by: Masahiko Sawada, Bertrand Drouvot, Peter Smith, Dilip Kumar, Ajin Cherian, Nisha Moond, Kuroda Hayato, Amit Kapila
Discussion: https://postgr.es/m/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com
2 years ago
|
|
|
#include "replication/slotsync.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "replication/syncrep.h"
|
|
|
|
|
#include "storage/aio.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "storage/bufmgr.h"
|
|
|
|
|
#include "storage/bufpage.h"
|
|
|
|
|
#include "storage/copydir.h"
|
|
|
|
|
#include "storage/io_worker.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "storage/large_object.h"
|
|
|
|
|
#include "storage/pg_shmem.h"
|
|
|
|
|
#include "storage/predicate.h"
|
|
|
|
|
#include "storage/procnumber.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "storage/standby.h"
|
|
|
|
|
#include "tcop/backend_startup.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "tcop/tcopprot.h"
|
|
|
|
|
#include "tsearch/ts_cache.h"
|
|
|
|
|
#include "utils/builtins.h"
|
|
|
|
|
#include "utils/bytea.h"
|
|
|
|
|
#include "utils/float.h"
|
|
|
|
|
#include "utils/guc_hooks.h"
|
|
|
|
|
#include "utils/guc_tables.h"
|
|
|
|
|
#include "utils/inval.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "utils/memutils.h"
|
|
|
|
|
#include "utils/pg_locale.h"
|
|
|
|
|
#include "utils/plancache.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "utils/ps_status.h"
|
|
|
|
|
#include "utils/rls.h"
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#include "utils/xml.h"
|
|
|
|
|
|
|
|
|
|
#ifdef TRACE_SYNCSCAN
|
|
|
|
|
#include "access/syncscan.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
/* This value is normally passed in from the Makefile */
|
|
|
|
|
#ifndef PG_KRB_SRVTAB
|
|
|
|
|
#define PG_KRB_SRVTAB ""
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Options for enum values defined in this module.
|
|
|
|
|
*
|
|
|
|
|
* NOTE! Option values may not contain double quotes!
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry bytea_output_options[] = {
|
|
|
|
|
{"escape", BYTEA_OUTPUT_ESCAPE, false},
|
|
|
|
|
{"hex", BYTEA_OUTPUT_HEX, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(bytea_output_options) == (BYTEA_OUTPUT_HEX + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* We have different sets for client and server message level options because
|
|
|
|
|
* they sort slightly different (see "log" level), and because "fatal"/"panic"
|
|
|
|
|
* aren't sensible for client_min_messages.
|
|
|
|
|
*/
|
|
|
|
|
static const struct config_enum_entry client_message_level_options[] = {
|
|
|
|
|
{"debug5", DEBUG5, false},
|
|
|
|
|
{"debug4", DEBUG4, false},
|
|
|
|
|
{"debug3", DEBUG3, false},
|
|
|
|
|
{"debug2", DEBUG2, false},
|
|
|
|
|
{"debug1", DEBUG1, false},
|
|
|
|
|
{"debug", DEBUG2, true},
|
|
|
|
|
{"log", LOG, false},
|
|
|
|
|
{"info", INFO, true},
|
|
|
|
|
{"notice", NOTICE, false},
|
|
|
|
|
{"warning", WARNING, false},
|
|
|
|
|
{"error", ERROR, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry server_message_level_options[] = {
|
|
|
|
|
{"debug5", DEBUG5, false},
|
|
|
|
|
{"debug4", DEBUG4, false},
|
|
|
|
|
{"debug3", DEBUG3, false},
|
|
|
|
|
{"debug2", DEBUG2, false},
|
|
|
|
|
{"debug1", DEBUG1, false},
|
|
|
|
|
{"debug", DEBUG2, true},
|
|
|
|
|
{"info", INFO, false},
|
|
|
|
|
{"notice", NOTICE, false},
|
|
|
|
|
{"warning", WARNING, false},
|
|
|
|
|
{"error", ERROR, false},
|
|
|
|
|
{"log", LOG, false},
|
|
|
|
|
{"fatal", FATAL, false},
|
|
|
|
|
{"panic", PANIC, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry intervalstyle_options[] = {
|
|
|
|
|
{"postgres", INTSTYLE_POSTGRES, false},
|
|
|
|
|
{"postgres_verbose", INTSTYLE_POSTGRES_VERBOSE, false},
|
|
|
|
|
{"sql_standard", INTSTYLE_SQL_STANDARD, false},
|
|
|
|
|
{"iso_8601", INTSTYLE_ISO_8601, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry icu_validation_level_options[] = {
|
|
|
|
|
{"disabled", -1, false},
|
|
|
|
|
{"debug5", DEBUG5, false},
|
|
|
|
|
{"debug4", DEBUG4, false},
|
|
|
|
|
{"debug3", DEBUG3, false},
|
|
|
|
|
{"debug2", DEBUG2, false},
|
|
|
|
|
{"debug1", DEBUG1, false},
|
|
|
|
|
{"debug", DEBUG2, true},
|
|
|
|
|
{"log", LOG, false},
|
|
|
|
|
{"info", INFO, true},
|
|
|
|
|
{"notice", NOTICE, false},
|
|
|
|
|
{"warning", WARNING, false},
|
|
|
|
|
{"error", ERROR, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
StaticAssertDecl(lengthof(intervalstyle_options) == (INTSTYLE_ISO_8601 + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry log_error_verbosity_options[] = {
|
|
|
|
|
{"terse", PGERROR_TERSE, false},
|
|
|
|
|
{"default", PGERROR_DEFAULT, false},
|
|
|
|
|
{"verbose", PGERROR_VERBOSE, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(log_error_verbosity_options) == (PGERROR_VERBOSE + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry log_statement_options[] = {
|
|
|
|
|
{"none", LOGSTMT_NONE, false},
|
|
|
|
|
{"ddl", LOGSTMT_DDL, false},
|
|
|
|
|
{"mod", LOGSTMT_MOD, false},
|
|
|
|
|
{"all", LOGSTMT_ALL, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(log_statement_options) == (LOGSTMT_ALL + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry isolation_level_options[] = {
|
|
|
|
|
{"serializable", XACT_SERIALIZABLE, false},
|
|
|
|
|
{"repeatable read", XACT_REPEATABLE_READ, false},
|
|
|
|
|
{"read committed", XACT_READ_COMMITTED, false},
|
|
|
|
|
{"read uncommitted", XACT_READ_UNCOMMITTED, false},
|
|
|
|
|
{NULL, 0}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry session_replication_role_options[] = {
|
|
|
|
|
{"origin", SESSION_REPLICATION_ROLE_ORIGIN, false},
|
|
|
|
|
{"replica", SESSION_REPLICATION_ROLE_REPLICA, false},
|
|
|
|
|
{"local", SESSION_REPLICATION_ROLE_LOCAL, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(session_replication_role_options) == (SESSION_REPLICATION_ROLE_LOCAL + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry syslog_facility_options[] = {
|
|
|
|
|
#ifdef HAVE_SYSLOG
|
|
|
|
|
{"local0", LOG_LOCAL0, false},
|
|
|
|
|
{"local1", LOG_LOCAL1, false},
|
|
|
|
|
{"local2", LOG_LOCAL2, false},
|
|
|
|
|
{"local3", LOG_LOCAL3, false},
|
|
|
|
|
{"local4", LOG_LOCAL4, false},
|
|
|
|
|
{"local5", LOG_LOCAL5, false},
|
|
|
|
|
{"local6", LOG_LOCAL6, false},
|
|
|
|
|
{"local7", LOG_LOCAL7, false},
|
|
|
|
|
#else
|
|
|
|
|
{"none", 0, false},
|
|
|
|
|
#endif
|
|
|
|
|
{NULL, 0}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry track_function_options[] = {
|
|
|
|
|
{"none", TRACK_FUNC_OFF, false},
|
|
|
|
|
{"pl", TRACK_FUNC_PL, false},
|
|
|
|
|
{"all", TRACK_FUNC_ALL, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(track_function_options) == (TRACK_FUNC_ALL + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry stats_fetch_consistency[] = {
|
|
|
|
|
{"none", PGSTAT_FETCH_CONSISTENCY_NONE, false},
|
|
|
|
|
{"cache", PGSTAT_FETCH_CONSISTENCY_CACHE, false},
|
|
|
|
|
{"snapshot", PGSTAT_FETCH_CONSISTENCY_SNAPSHOT, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(stats_fetch_consistency) == (PGSTAT_FETCH_CONSISTENCY_SNAPSHOT + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry xmlbinary_options[] = {
|
|
|
|
|
{"base64", XMLBINARY_BASE64, false},
|
|
|
|
|
{"hex", XMLBINARY_HEX, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(xmlbinary_options) == (XMLBINARY_HEX + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry xmloption_options[] = {
|
|
|
|
|
{"content", XMLOPTION_CONTENT, false},
|
|
|
|
|
{"document", XMLOPTION_DOCUMENT, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(xmloption_options) == (XMLOPTION_CONTENT + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Although only "on", "off", and "safe_encoding" are documented, we
|
|
|
|
|
* accept all the likely variants of "on" and "off".
|
|
|
|
|
*/
|
|
|
|
|
static const struct config_enum_entry backslash_quote_options[] = {
|
|
|
|
|
{"safe_encoding", BACKSLASH_QUOTE_SAFE_ENCODING, false},
|
|
|
|
|
{"on", BACKSLASH_QUOTE_ON, false},
|
|
|
|
|
{"off", BACKSLASH_QUOTE_OFF, false},
|
|
|
|
|
{"true", BACKSLASH_QUOTE_ON, true},
|
|
|
|
|
{"false", BACKSLASH_QUOTE_OFF, true},
|
|
|
|
|
{"yes", BACKSLASH_QUOTE_ON, true},
|
|
|
|
|
{"no", BACKSLASH_QUOTE_OFF, true},
|
|
|
|
|
{"1", BACKSLASH_QUOTE_ON, true},
|
|
|
|
|
{"0", BACKSLASH_QUOTE_OFF, true},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Although only "on", "off", and "auto" are documented, we accept
|
|
|
|
|
* all the likely variants of "on" and "off".
|
|
|
|
|
*/
|
|
|
|
|
static const struct config_enum_entry compute_query_id_options[] = {
|
|
|
|
|
{"auto", COMPUTE_QUERY_ID_AUTO, false},
|
|
|
|
|
{"regress", COMPUTE_QUERY_ID_REGRESS, false},
|
|
|
|
|
{"on", COMPUTE_QUERY_ID_ON, false},
|
|
|
|
|
{"off", COMPUTE_QUERY_ID_OFF, false},
|
|
|
|
|
{"true", COMPUTE_QUERY_ID_ON, true},
|
|
|
|
|
{"false", COMPUTE_QUERY_ID_OFF, true},
|
|
|
|
|
{"yes", COMPUTE_QUERY_ID_ON, true},
|
|
|
|
|
{"no", COMPUTE_QUERY_ID_OFF, true},
|
|
|
|
|
{"1", COMPUTE_QUERY_ID_ON, true},
|
|
|
|
|
{"0", COMPUTE_QUERY_ID_OFF, true},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Although only "on", "off", and "partition" are documented, we
|
|
|
|
|
* accept all the likely variants of "on" and "off".
|
|
|
|
|
*/
|
|
|
|
|
static const struct config_enum_entry constraint_exclusion_options[] = {
|
|
|
|
|
{"partition", CONSTRAINT_EXCLUSION_PARTITION, false},
|
|
|
|
|
{"on", CONSTRAINT_EXCLUSION_ON, false},
|
|
|
|
|
{"off", CONSTRAINT_EXCLUSION_OFF, false},
|
|
|
|
|
{"true", CONSTRAINT_EXCLUSION_ON, true},
|
|
|
|
|
{"false", CONSTRAINT_EXCLUSION_OFF, true},
|
|
|
|
|
{"yes", CONSTRAINT_EXCLUSION_ON, true},
|
|
|
|
|
{"no", CONSTRAINT_EXCLUSION_OFF, true},
|
|
|
|
|
{"1", CONSTRAINT_EXCLUSION_ON, true},
|
|
|
|
|
{"0", CONSTRAINT_EXCLUSION_OFF, true},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Although only "on", "off", "remote_apply", "remote_write", and "local" are
|
|
|
|
|
* documented, we accept all the likely variants of "on" and "off".
|
|
|
|
|
*/
|
|
|
|
|
static const struct config_enum_entry synchronous_commit_options[] = {
|
|
|
|
|
{"local", SYNCHRONOUS_COMMIT_LOCAL_FLUSH, false},
|
|
|
|
|
{"remote_write", SYNCHRONOUS_COMMIT_REMOTE_WRITE, false},
|
|
|
|
|
{"remote_apply", SYNCHRONOUS_COMMIT_REMOTE_APPLY, false},
|
|
|
|
|
{"on", SYNCHRONOUS_COMMIT_ON, false},
|
|
|
|
|
{"off", SYNCHRONOUS_COMMIT_OFF, false},
|
|
|
|
|
{"true", SYNCHRONOUS_COMMIT_ON, true},
|
|
|
|
|
{"false", SYNCHRONOUS_COMMIT_OFF, true},
|
|
|
|
|
{"yes", SYNCHRONOUS_COMMIT_ON, true},
|
|
|
|
|
{"no", SYNCHRONOUS_COMMIT_OFF, true},
|
|
|
|
|
{"1", SYNCHRONOUS_COMMIT_ON, true},
|
|
|
|
|
{"0", SYNCHRONOUS_COMMIT_OFF, true},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Although only "on", "off", "try" are documented, we accept all the likely
|
|
|
|
|
* variants of "on" and "off".
|
|
|
|
|
*/
|
|
|
|
|
static const struct config_enum_entry huge_pages_options[] = {
|
|
|
|
|
{"off", HUGE_PAGES_OFF, false},
|
|
|
|
|
{"on", HUGE_PAGES_ON, false},
|
|
|
|
|
{"try", HUGE_PAGES_TRY, false},
|
|
|
|
|
{"true", HUGE_PAGES_ON, true},
|
|
|
|
|
{"false", HUGE_PAGES_OFF, true},
|
|
|
|
|
{"yes", HUGE_PAGES_ON, true},
|
|
|
|
|
{"no", HUGE_PAGES_OFF, true},
|
|
|
|
|
{"1", HUGE_PAGES_ON, true},
|
|
|
|
|
{"0", HUGE_PAGES_OFF, true},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
Add GUC parameter "huge_pages_status"
This is useful to show the allocation state of huge pages when setting
up a server with "huge_pages = try", where allocating huge pages would
be attempted but the server would continue its startup sequence even if
the allocation fails. The effective status of huge pages is not easily
visible without OS-level tools (or for instance, a lookup at
/proc/N/smaps), and the environments where Postgres runs may not
authorize that. Like the other GUCs related to huge pages, this works
for Linux and Windows.
This GUC can report as values:
- "on", if huge pages were allocated.
- "off", if huge pages were not allocated.
- "unknown", a special state that could only be seen when using for
example postgres -C because it is only possible to know if the shared
memory allocation worked after we can check for the GUC values, even if
checking a runtime-computed GUC. This value should never be seen when
querying for the GUC on a running server. An assertion is added to
check that.
The discussion has also turned around having a new function to grab this
status, but this would have required more tricks for -DEXEC_BACKEND,
something that GUCs already handle.
Noriyoshi Shinoda has initiated the thread that has led to the result of
this commit.
Author: Justin Pryzby
Reviewed-by: Nathan Bossart, Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/TU4PR8401MB1152EBB0D271F827E2E37A01EECC9@TU4PR8401MB1152.NAMPRD84.PROD.OUTLOOK.COM
2 years ago
|
|
|
static const struct config_enum_entry huge_pages_status_options[] = {
|
|
|
|
|
{"off", HUGE_PAGES_OFF, false},
|
|
|
|
|
{"on", HUGE_PAGES_ON, false},
|
|
|
|
|
{"unknown", HUGE_PAGES_UNKNOWN, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
static const struct config_enum_entry recovery_prefetch_options[] = {
|
|
|
|
|
{"off", RECOVERY_PREFETCH_OFF, false},
|
|
|
|
|
{"on", RECOVERY_PREFETCH_ON, false},
|
|
|
|
|
{"try", RECOVERY_PREFETCH_TRY, false},
|
|
|
|
|
{"true", RECOVERY_PREFETCH_ON, true},
|
|
|
|
|
{"false", RECOVERY_PREFETCH_OFF, true},
|
|
|
|
|
{"yes", RECOVERY_PREFETCH_ON, true},
|
|
|
|
|
{"no", RECOVERY_PREFETCH_OFF, true},
|
|
|
|
|
{"1", RECOVERY_PREFETCH_ON, true},
|
|
|
|
|
{"0", RECOVERY_PREFETCH_OFF, true},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry debug_parallel_query_options[] = {
|
|
|
|
|
{"off", DEBUG_PARALLEL_OFF, false},
|
|
|
|
|
{"on", DEBUG_PARALLEL_ON, false},
|
|
|
|
|
{"regress", DEBUG_PARALLEL_REGRESS, false},
|
|
|
|
|
{"true", DEBUG_PARALLEL_ON, true},
|
|
|
|
|
{"false", DEBUG_PARALLEL_OFF, true},
|
|
|
|
|
{"yes", DEBUG_PARALLEL_ON, true},
|
|
|
|
|
{"no", DEBUG_PARALLEL_OFF, true},
|
|
|
|
|
{"1", DEBUG_PARALLEL_ON, true},
|
|
|
|
|
{"0", DEBUG_PARALLEL_OFF, true},
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry plan_cache_mode_options[] = {
|
|
|
|
|
{"auto", PLAN_CACHE_MODE_AUTO, false},
|
|
|
|
|
{"force_generic_plan", PLAN_CACHE_MODE_FORCE_GENERIC_PLAN, false},
|
|
|
|
|
{"force_custom_plan", PLAN_CACHE_MODE_FORCE_CUSTOM_PLAN, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry password_encryption_options[] = {
|
|
|
|
|
{"md5", PASSWORD_TYPE_MD5, false},
|
|
|
|
|
{"scram-sha-256", PASSWORD_TYPE_SCRAM_SHA_256, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry ssl_protocol_versions_info[] = {
|
|
|
|
|
{"", PG_TLS_ANY, false},
|
|
|
|
|
{"TLSv1", PG_TLS1_VERSION, false},
|
|
|
|
|
{"TLSv1.1", PG_TLS1_1_VERSION, false},
|
|
|
|
|
{"TLSv1.2", PG_TLS1_2_VERSION, false},
|
|
|
|
|
{"TLSv1.3", PG_TLS1_3_VERSION, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry debug_logical_replication_streaming_options[] = {
|
|
|
|
|
{"buffered", DEBUG_LOGICAL_REP_STREAMING_BUFFERED, false},
|
|
|
|
|
{"immediate", DEBUG_LOGICAL_REP_STREAMING_IMMEDIATE, false},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
StaticAssertDecl(lengthof(ssl_protocol_versions_info) == (PG_TLS1_3_VERSION + 2),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry recovery_init_sync_method_options[] = {
|
|
|
|
|
{"fsync", DATA_DIR_SYNC_METHOD_FSYNC, false},
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#ifdef HAVE_SYNCFS
|
|
|
|
|
{"syncfs", DATA_DIR_SYNC_METHOD_SYNCFS, false},
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#endif
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry shared_memory_options[] = {
|
|
|
|
|
#ifndef WIN32
|
|
|
|
|
{"sysv", SHMEM_TYPE_SYSV, false},
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef EXEC_BACKEND
|
|
|
|
|
{"mmap", SHMEM_TYPE_MMAP, false},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
{"windows", SHMEM_TYPE_WINDOWS, false},
|
|
|
|
|
#endif
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry default_toast_compression_options[] = {
|
|
|
|
|
{"pglz", TOAST_PGLZ_COMPRESSION, false},
|
|
|
|
|
#ifdef USE_LZ4
|
|
|
|
|
{"lz4", TOAST_LZ4_COMPRESSION, false},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef USE_ZSTD
|
|
|
|
|
{"zstd", TOAST_ZSTD_COMPRESSION, false},
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
#endif
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry wal_compression_options[] = {
|
|
|
|
|
{"pglz", WAL_COMPRESSION_PGLZ, false},
|
|
|
|
|
#ifdef USE_LZ4
|
|
|
|
|
{"lz4", WAL_COMPRESSION_LZ4, false},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef USE_ZSTD
|
|
|
|
|
{"zstd", WAL_COMPRESSION_ZSTD, false},
|
|
|
|
|
#endif
|
|
|
|
|
{"on", WAL_COMPRESSION_PGLZ, false},
|
|
|
|
|
{"off", WAL_COMPRESSION_NONE, false},
|
|
|
|
|
{"true", WAL_COMPRESSION_PGLZ, true},
|
|
|
|
|
{"false", WAL_COMPRESSION_NONE, true},
|
|
|
|
|
{"yes", WAL_COMPRESSION_PGLZ, true},
|
|
|
|
|
{"no", WAL_COMPRESSION_NONE, true},
|
|
|
|
|
{"1", WAL_COMPRESSION_PGLZ, true},
|
|
|
|
|
{"0", WAL_COMPRESSION_NONE, true},
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct config_enum_entry file_copy_method_options[] = {
|
|
|
|
|
{"copy", FILE_COPY_METHOD_COPY, false},
|
|
|
|
|
#if defined(HAVE_COPYFILE) && defined(COPYFILE_CLONE_FORCE) || defined(HAVE_COPY_FILE_RANGE)
|
|
|
|
|
{"clone", FILE_COPY_METHOD_CLONE, false},
|
|
|
|
|
#endif
|
|
|
|
|
{NULL, 0, false}
|
|
|
|
|
};
|
|
|
|
|
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
/*
|
|
|
|
|
* Options for enum values stored in other modules
|
|
|
|
|
*/
|
|
|
|
|
extern const struct config_enum_entry wal_level_options[];
|
|
|
|
|
extern const struct config_enum_entry archive_mode_options[];
|
|
|
|
|
extern const struct config_enum_entry recovery_target_action_options[];
|
|
|
|
|
extern const struct config_enum_entry wal_sync_method_options[];
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
extern const struct config_enum_entry dynamic_shared_memory_options[];
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* GUC option variables that are exported from this module
|
|
|
|
|
*/
|
|
|
|
|
bool AllowAlterSystem = true;
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
bool log_duration = false;
|
|
|
|
|
bool Debug_print_plan = false;
|
|
|
|
|
bool Debug_print_parse = false;
|
|
|
|
|
bool Debug_print_raw_parse = false;
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
bool Debug_print_rewritten = false;
|
|
|
|
|
bool Debug_pretty_print = true;
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_NODE_TESTS_ENABLED
|
|
|
|
|
bool Debug_copy_parse_plan_trees;
|
|
|
|
|
bool Debug_write_read_parse_plan_trees;
|
|
|
|
|
bool Debug_raw_expression_coverage_test;
|
|
|
|
|
#endif
|
|
|
|
|
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
bool log_parser_stats = false;
|
|
|
|
|
bool log_planner_stats = false;
|
|
|
|
|
bool log_executor_stats = false;
|
|
|
|
|
bool log_statement_stats = false; /* this is sort of all three above
|
|
|
|
|
* together */
|
|
|
|
|
bool log_btree_build_stats = false;
|
|
|
|
|
char *event_source;
|
|
|
|
|
|
|
|
|
|
bool row_security;
|
|
|
|
|
bool check_function_bodies = true;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This GUC exists solely for backward compatibility, check its definition for
|
|
|
|
|
* details.
|
|
|
|
|
*/
|
|
|
|
|
static bool default_with_oids = false;
|
|
|
|
|
|
|
|
|
|
bool current_role_is_superuser;
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
|
|
|
|
|
int log_min_error_statement = ERROR;
|
|
|
|
|
int log_min_messages = WARNING;
|
|
|
|
|
int client_min_messages = NOTICE;
|
|
|
|
|
int log_min_duration_sample = -1;
|
|
|
|
|
int log_min_duration_statement = -1;
|
|
|
|
|
int log_parameter_max_length = -1;
|
|
|
|
|
int log_parameter_max_length_on_error = 0;
|
|
|
|
|
int log_temp_files = -1;
|
|
|
|
|
double log_statement_sample_rate = 1.0;
|
|
|
|
|
double log_xact_sample_rate = 0;
|
|
|
|
|
char *backtrace_functions;
|
|
|
|
|
|
|
|
|
|
int temp_file_limit = -1;
|
|
|
|
|
|
|
|
|
|
int num_temp_buffers = 1024;
|
|
|
|
|
|
|
|
|
|
char *cluster_name = "";
|
|
|
|
|
char *ConfigFileName;
|
|
|
|
|
char *HbaFileName;
|
|
|
|
|
char *IdentFileName;
|
|
|
|
|
char *external_pid_file;
|
|
|
|
|
|
|
|
|
|
char *application_name;
|
|
|
|
|
|
|
|
|
|
int tcp_keepalives_idle;
|
|
|
|
|
int tcp_keepalives_interval;
|
|
|
|
|
int tcp_keepalives_count;
|
|
|
|
|
int tcp_user_timeout;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* SSL renegotiation was been removed in PostgreSQL 9.5, but we tolerate it
|
|
|
|
|
* being set to zero (meaning never renegotiate) for backward compatibility.
|
|
|
|
|
* This avoids breaking compatibility with clients that have never supported
|
|
|
|
|
* renegotiation and therefore always try to zero it.
|
|
|
|
|
*/
|
|
|
|
|
static int ssl_renegotiation_limit;
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This really belongs in pg_shmem.c, but is defined here so that it doesn't
|
|
|
|
|
* need to be duplicated in all the different implementations of pg_shmem.c.
|
|
|
|
|
*/
|
|
|
|
|
int huge_pages = HUGE_PAGES_TRY;
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
int huge_page_size;
|
|
|
|
|
int huge_pages_status = HUGE_PAGES_UNKNOWN;
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* These variables are all dummies that don't do anything, except in some
|
|
|
|
|
* cases provide the value for SHOW to display. The real state is elsewhere
|
|
|
|
|
* and is kept in sync by assign_hooks.
|
|
|
|
|
*/
|
|
|
|
|
static char *syslog_ident_str;
|
|
|
|
|
static double phony_random_seed;
|
|
|
|
|
static char *client_encoding_string;
|
|
|
|
|
static char *datestyle_string;
|
|
|
|
|
static char *server_encoding_string;
|
|
|
|
|
static char *server_version_string;
|
|
|
|
|
static int server_version_num;
|
|
|
|
|
static char *debug_io_direct_string;
|
|
|
|
|
static char *restrict_nonsystem_relation_kind_string;
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_SYSLOG
|
|
|
|
|
#define DEFAULT_SYSLOG_FACILITY LOG_LOCAL0
|
|
|
|
|
#else
|
|
|
|
|
#define DEFAULT_SYSLOG_FACILITY 0
|
|
|
|
|
#endif
|
|
|
|
|
static int syslog_facility = DEFAULT_SYSLOG_FACILITY;
|
|
|
|
|
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
static char *timezone_string;
|
|
|
|
|
static char *log_timezone_string;
|
|
|
|
|
static char *timezone_abbreviations_string;
|
|
|
|
|
static char *data_directory;
|
|
|
|
|
static char *session_authorization_string;
|
|
|
|
|
static int max_function_args;
|
|
|
|
|
static int max_index_keys;
|
|
|
|
|
static int max_identifier_length;
|
|
|
|
|
static int block_size;
|
|
|
|
|
static int segment_size;
|
|
|
|
|
static int shared_memory_size_mb;
|
|
|
|
|
static int shared_memory_size_in_huge_pages;
|
|
|
|
|
static int wal_block_size;
|
Introduce num_os_semaphores GUC.
The documentation for System V IPC parameters provides complicated
formulas to determine the appropriate values for SEMMNI and SEMMNS.
Furthermore, these formulas have often been wrong because folks
forget to update them (e.g., when adding a new auxiliary process).
This commit introduces a new runtime-computed GUC named
num_os_semaphores that reports the number of semaphores needed for
the configured number of allowed connections, worker processes,
etc. This new GUC allows us to simplify the formulas in the
documentation, and it should help prevent future inaccuracies.
Like the other runtime-computed GUCs, users can view it with
"postgres -C" before starting the server, which is useful for
preconfiguring the necessary operating system resources.
Reviewed-by: Tom Lane, Sami Imseih, Andres Freund, Robert Haas
Discussion: https://postgr.es/m/20240517164452.GA1914161%40nathanxps13
1 year ago
|
|
|
static int num_os_semaphores;
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
static bool data_checksums;
|
|
|
|
|
static bool integer_datetimes;
|
|
|
|
|
|
|
|
|
|
#ifdef USE_ASSERT_CHECKING
|
|
|
|
|
#define DEFAULT_ASSERT_ENABLED true
|
|
|
|
|
#else
|
|
|
|
|
#define DEFAULT_ASSERT_ENABLED false
|
|
|
|
|
#endif
|
|
|
|
|
static bool assert_enabled = DEFAULT_ASSERT_ENABLED;
|
|
|
|
|
|
|
|
|
|
#ifdef EXEC_BACKEND
|
|
|
|
|
#define EXEC_BACKEND_ENABLED true
|
|
|
|
|
#else
|
|
|
|
|
#define EXEC_BACKEND_ENABLED false
|
|
|
|
|
#endif
|
|
|
|
|
static bool exec_backend_enabled = EXEC_BACKEND_ENABLED;
|
|
|
|
|
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
static char *recovery_target_timeline_string;
|
|
|
|
|
static char *recovery_target_string;
|
|
|
|
|
static char *recovery_target_xid_string;
|
|
|
|
|
static char *recovery_target_name_string;
|
|
|
|
|
static char *recovery_target_lsn_string;
|
|
|
|
|
|
|
|
|
|
/* should be static, but commands/variable.c needs to get at this */
|
|
|
|
|
char *role_string;
|
|
|
|
|
|
|
|
|
|
/* should be static, but guc.c needs to get at this */
|
|
|
|
|
bool in_hot_standby_guc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Displayable names for context types (enum GucContext)
|
|
|
|
|
*
|
|
|
|
|
* Note: these strings are deliberately not localized.
|
|
|
|
|
*/
|
|
|
|
|
const char *const GucContext_Names[] =
|
|
|
|
|
{
|
|
|
|
|
[PGC_INTERNAL] = "internal",
|
|
|
|
|
[PGC_POSTMASTER] = "postmaster",
|
|
|
|
|
[PGC_SIGHUP] = "sighup",
|
|
|
|
|
[PGC_SU_BACKEND] = "superuser-backend",
|
|
|
|
|
[PGC_BACKEND] = "backend",
|
|
|
|
|
[PGC_SUSET] = "superuser",
|
|
|
|
|
[PGC_USERSET] = "user",
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(GucContext_Names) == (PGC_USERSET + 1),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Displayable names for source types (enum GucSource)
|
|
|
|
|
*
|
|
|
|
|
* Note: these strings are deliberately not localized.
|
|
|
|
|
*/
|
|
|
|
|
const char *const GucSource_Names[] =
|
|
|
|
|
{
|
|
|
|
|
[PGC_S_DEFAULT] = "default",
|
|
|
|
|
[PGC_S_DYNAMIC_DEFAULT] = "default",
|
|
|
|
|
[PGC_S_ENV_VAR] = "environment variable",
|
|
|
|
|
[PGC_S_FILE] = "configuration file",
|
|
|
|
|
[PGC_S_ARGV] = "command line",
|
|
|
|
|
[PGC_S_GLOBAL] = "global",
|
|
|
|
|
[PGC_S_DATABASE] = "database",
|
|
|
|
|
[PGC_S_USER] = "user",
|
|
|
|
|
[PGC_S_DATABASE_USER] = "database user",
|
|
|
|
|
[PGC_S_CLIENT] = "client",
|
|
|
|
|
[PGC_S_OVERRIDE] = "override",
|
|
|
|
|
[PGC_S_INTERACTIVE] = "interactive",
|
|
|
|
|
[PGC_S_TEST] = "test",
|
|
|
|
|
[PGC_S_SESSION] = "session",
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(GucSource_Names) == (PGC_S_SESSION + 1),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Displayable names for the groupings defined in enum config_group
|
|
|
|
|
*/
|
|
|
|
|
const char *const config_group_names[] =
|
|
|
|
|
{
|
|
|
|
|
[UNGROUPED] = gettext_noop("Ungrouped"),
|
|
|
|
|
[FILE_LOCATIONS] = gettext_noop("File Locations"),
|
|
|
|
|
[CONN_AUTH_SETTINGS] = gettext_noop("Connections and Authentication / Connection Settings"),
|
|
|
|
|
[CONN_AUTH_TCP] = gettext_noop("Connections and Authentication / TCP Settings"),
|
|
|
|
|
[CONN_AUTH_AUTH] = gettext_noop("Connections and Authentication / Authentication"),
|
|
|
|
|
[CONN_AUTH_SSL] = gettext_noop("Connections and Authentication / SSL"),
|
|
|
|
|
[RESOURCES_MEM] = gettext_noop("Resource Usage / Memory"),
|
|
|
|
|
[RESOURCES_DISK] = gettext_noop("Resource Usage / Disk"),
|
|
|
|
|
[RESOURCES_KERNEL] = gettext_noop("Resource Usage / Kernel Resources"),
|
|
|
|
|
[RESOURCES_BGWRITER] = gettext_noop("Resource Usage / Background Writer"),
|
|
|
|
|
[RESOURCES_IO] = gettext_noop("Resource Usage / I/O"),
|
|
|
|
|
[RESOURCES_WORKER_PROCESSES] = gettext_noop("Resource Usage / Worker Processes"),
|
|
|
|
|
[WAL_SETTINGS] = gettext_noop("Write-Ahead Log / Settings"),
|
|
|
|
|
[WAL_CHECKPOINTS] = gettext_noop("Write-Ahead Log / Checkpoints"),
|
|
|
|
|
[WAL_ARCHIVING] = gettext_noop("Write-Ahead Log / Archiving"),
|
|
|
|
|
[WAL_RECOVERY] = gettext_noop("Write-Ahead Log / Recovery"),
|
|
|
|
|
[WAL_ARCHIVE_RECOVERY] = gettext_noop("Write-Ahead Log / Archive Recovery"),
|
|
|
|
|
[WAL_RECOVERY_TARGET] = gettext_noop("Write-Ahead Log / Recovery Target"),
|
|
|
|
|
[WAL_SUMMARIZATION] = gettext_noop("Write-Ahead Log / Summarization"),
|
|
|
|
|
[REPLICATION_SENDING] = gettext_noop("Replication / Sending Servers"),
|
|
|
|
|
[REPLICATION_PRIMARY] = gettext_noop("Replication / Primary Server"),
|
|
|
|
|
[REPLICATION_STANDBY] = gettext_noop("Replication / Standby Servers"),
|
|
|
|
|
[REPLICATION_SUBSCRIBERS] = gettext_noop("Replication / Subscribers"),
|
|
|
|
|
[QUERY_TUNING_METHOD] = gettext_noop("Query Tuning / Planner Method Configuration"),
|
|
|
|
|
[QUERY_TUNING_COST] = gettext_noop("Query Tuning / Planner Cost Constants"),
|
|
|
|
|
[QUERY_TUNING_GEQO] = gettext_noop("Query Tuning / Genetic Query Optimizer"),
|
|
|
|
|
[QUERY_TUNING_OTHER] = gettext_noop("Query Tuning / Other Planner Options"),
|
|
|
|
|
[LOGGING_WHERE] = gettext_noop("Reporting and Logging / Where to Log"),
|
|
|
|
|
[LOGGING_WHEN] = gettext_noop("Reporting and Logging / When to Log"),
|
|
|
|
|
[LOGGING_WHAT] = gettext_noop("Reporting and Logging / What to Log"),
|
|
|
|
|
[PROCESS_TITLE] = gettext_noop("Reporting and Logging / Process Title"),
|
|
|
|
|
[STATS_MONITORING] = gettext_noop("Statistics / Monitoring"),
|
|
|
|
|
[STATS_CUMULATIVE] = gettext_noop("Statistics / Cumulative Query and Index Statistics"),
|
|
|
|
|
[VACUUM_AUTOVACUUM] = gettext_noop("Vacuuming / Automatic Vacuuming"),
|
|
|
|
|
[VACUUM_COST_DELAY] = gettext_noop("Vacuuming / Cost-Based Vacuum Delay"),
|
|
|
|
|
[VACUUM_DEFAULT] = gettext_noop("Vacuuming / Default Behavior"),
|
|
|
|
|
[VACUUM_FREEZING] = gettext_noop("Vacuuming / Freezing"),
|
|
|
|
|
[CLIENT_CONN_STATEMENT] = gettext_noop("Client Connection Defaults / Statement Behavior"),
|
|
|
|
|
[CLIENT_CONN_LOCALE] = gettext_noop("Client Connection Defaults / Locale and Formatting"),
|
|
|
|
|
[CLIENT_CONN_PRELOAD] = gettext_noop("Client Connection Defaults / Shared Library Preloading"),
|
|
|
|
|
[CLIENT_CONN_OTHER] = gettext_noop("Client Connection Defaults / Other Defaults"),
|
|
|
|
|
[LOCK_MANAGEMENT] = gettext_noop("Lock Management"),
|
|
|
|
|
[COMPAT_OPTIONS_PREVIOUS] = gettext_noop("Version and Platform Compatibility / Previous PostgreSQL Versions"),
|
|
|
|
|
[COMPAT_OPTIONS_OTHER] = gettext_noop("Version and Platform Compatibility / Other Platforms and Clients"),
|
|
|
|
|
[ERROR_HANDLING_OPTIONS] = gettext_noop("Error Handling"),
|
|
|
|
|
[PRESET_OPTIONS] = gettext_noop("Preset Options"),
|
|
|
|
|
[CUSTOM_OPTIONS] = gettext_noop("Customized Options"),
|
|
|
|
|
[DEVELOPER_OPTIONS] = gettext_noop("Developer Options"),
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(config_group_names) == (DEVELOPER_OPTIONS + 1),
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Displayable names for GUC variable types (enum config_type)
|
|
|
|
|
*
|
|
|
|
|
* Note: these strings are deliberately not localized.
|
|
|
|
|
*/
|
|
|
|
|
const char *const config_type_names[] =
|
|
|
|
|
{
|
|
|
|
|
[PGC_BOOL] = "bool",
|
|
|
|
|
[PGC_INT] = "integer",
|
|
|
|
|
[PGC_REAL] = "real",
|
|
|
|
|
[PGC_STRING] = "string",
|
|
|
|
|
[PGC_ENUM] = "enum",
|
Split up guc.c for better build speed and ease of maintenance.
guc.c has grown to be one of our largest .c files, making it
a bottleneck for compilation. It's also acquired a bunch of
knowledge that'd be better kept elsewhere, because of our not
very good habit of putting variable-specific check hooks here.
Hence, split it up along these lines:
* guc.c itself retains just the core GUC housekeeping mechanisms.
* New file guc_funcs.c contains the SET/SHOW interfaces and some
SQL-accessible functions for GUC manipulation.
* New file guc_tables.c contains the data arrays that define the
built-in GUC variables, along with some already-exported constant
tables.
* GUC check/assign/show hook functions are moved to the variable's
home module, whenever that's clearly identifiable. A few hard-
to-classify hooks ended up in commands/variable.c, which was
already a home for miscellaneous GUC hook functions.
To avoid cluttering a lot more header files with #include "guc.h",
I also invented a new header file utils/guc_hooks.h and put all
the GUC hook functions' declarations there, regardless of their
originating module. That allowed removal of #include "guc.h"
from some existing headers. The fallout from that (hopefully
all caught here) demonstrates clearly why such inclusions are
best minimized: there are a lot of files that, for example,
were getting array.h at two or more levels of remove, despite
not having any connection at all to GUCs in themselves.
There is some very minor code beautification here, such as
renaming a couple of inconsistently-named hook functions
and improving some comments. But mostly this just moves
code from point A to point B and deals with the ensuing
needs for #include adjustments and exporting a few functions
that previously weren't exported.
Patch by me, per a suggestion from Andres Freund; thanks also
to Michael Paquier for the idea to invent guc_funcs.c.
Discussion: https://postgr.es/m/587607.1662836699@sss.pgh.pa.us
3 years ago
|
|
|
};
|
|
|
|
|
|
|
|
|
|
StaticAssertDecl(lengthof(config_type_names) == (PGC_ENUM + 1),
|
|
|
|
|
"array length mismatch");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "utils/guc_tables.inc.c"
|