pg_parser_continue_on_error_v2b_delta.patch
application/octet-stream
Filename: pg_parser_continue_on_error_v2b_delta.patch
Type: application/octet-stream
Part: 1
*** a/src/backend/utils/misc/guc-file.l
--- b/src/backend/utils/misc/guc-file.l
***************
*** 110,132 **** ProcessConfigFile(GucContext context)
*tail;
char *cvc = NULL;
struct config_string *cvc_struct;
! int i;
bool OK = true;
! Assert(context == PGC_POSTMASTER || context == PGC_SIGHUP);
!
! if (context == PGC_SIGHUP)
! {
! /*
! * To avoid cluttering the log, only the postmaster bleats loudly
! * about problems with the config file.
! */
! elevel = IsUnderPostmaster ? DEBUG2 : LOG;
! }
! else
! elevel = LOG;
!
! /* Parse the file into a list of option names and values */
head = tail = NULL;
if (!ParseConfigFile(ConfigFileName, NULL, 0, elevel, &head, &tail))
--- 110,134 ----
*tail;
char *cvc = NULL;
struct config_string *cvc_struct;
! int i;
bool OK = true;
! /* Config files are only processes on startup (by the postmaster)
! * and on SIGHUP (by the postmaster and backends)
! */
! Assert((context == PGC_POSTMASTER && !IsUnderPostmaster) ||
! context == PGC_SIGHUP);
! /*
! * To avoid cluttering the log, only the postmaster bleats loudly
! * about problems with the config file.
! */
! elevel = IsUnderPostmaster ? DEBUG2 : LOG;
!
! /* Parse the file into a list of option names and values.
! * We continue even if we hit a parse errors because we
! * also want to report invalid value in the parts we
! * could parse
! */
head = tail = NULL;
if (!ParseConfigFile(ConfigFileName, NULL, 0, elevel, &head, &tail))
***************
*** 592,598 **** ParseConfigFp(FILE *fp, const char *config_file, int depth, int elevel,
/* skip over parse_error if we made it this far without errors */
continue;
! parse_error:
if (token == GUC_EOL || token == 0)
ereport(elevel,
(errcode(ERRCODE_SYNTAX_ERROR),
--- 594,600 ----
/* skip over parse_error if we made it this far without errors */
continue;
! parse_error:
if (token == GUC_EOL || token == 0)
ereport(elevel,
(errcode(ERRCODE_SYNTAX_ERROR),
***************
*** 605,611 **** ParseConfigFp(FILE *fp, const char *config_file, int depth, int elevel,
config_file, ConfigFileLineno, yytext)));
errorcount++;
/* fast forward till the next EOL/EOF */
! while (token && token != GUC_EOL)
token = yylex();
/* break out of loop on EOF */
--- 607,613 ----
config_file, ConfigFileLineno, yytext)));
errorcount++;
/* fast forward till the next EOL/EOF */
! while (token != 0 && token != GUC_EOL)
token = yylex();
/* break out of loop on EOF */
*** a/src/backend/utils/misc/guc.c
--- b/src/backend/utils/misc/guc.c
***************
*** 5055,5061 **** config_enum_get_options(struct config_enum * record, const char *prefix,
*
* If there is an error (non-existing option, invalid value) then an
* ereport(ERROR) is thrown *unless* this is called in a context where we
! * don't want to ereport (currently, startup or SIGHUP config file reread).
* In that case we write a suitable error message via ereport(LOG) and
* return false. This is working around the deficiencies in the ereport
* mechanism, so don't blame me. In all other cases, the function
--- 5055,5061 ----
*
* If there is an error (non-existing option, invalid value) then an
* ereport(ERROR) is thrown *unless* this is called in a context where we
! * don't want to ereport (currently, settings defaults and cfg file reading).
* In that case we write a suitable error message via ereport(LOG) and
* return false. This is working around the deficiencies in the ereport
* mechanism, so don't blame me. In all other cases, the function