postgresql/src/include
Tom Lane 4c804fbdfb Clean up parsing of synchronous_standby_names GUC variable.
Commit 989be0810d added a flex/bison lexer/parser to interpret
synchronous_standby_names.  It was done in a pretty crufty way, though,
making assorted end-use sites responsible for calling the parser at the
right times.  That was not only vulnerable to errors of omission, but made
it possible that lexer/parser errors occur at very undesirable times,
and created memory leakages even if there was no error.

Instead, perform the parsing once during check_synchronous_standby_names
and let guc.c manage the resulting data.  To do that, we have to flatten
the parsed representation into a single hunk of malloc'd memory, but that
is not very hard.

While at it, work a little harder on making useful error reports for
parsing problems; the previous code felt that "synchronous_standby_names
parser returned 1" was an appropriate user-facing error message.  (To
be fair, it did also log a syntax error message, but separately from the
GUC problem report, which is at best confusing.)  It had some outright
bugs in the face of invalid input, too.

I (tgl) also concluded that we need to restrict unquoted names in
synchronous_standby_names to be just SQL identifiers.  The previous coding
would accept darn near anything, which (1) makes the quoting convention
both nearly-unnecessary and formally ambiguous, (2) makes it very hard to
understand what is a syntax error and what is a creative interpretation of
the input as a standby name, and (3) makes it impossible to further extend
the syntax in future without a compatibility break.  I presume that we're
intending future extensions of the syntax, else this parsing infrastructure
is massive overkill, so (3) is an important objection.  Since we've taken
a compatibility hit for non-identifier names with this change anyway, we
might as well lock things down now and insist that users use double quotes
for standby names that aren't identifiers.

Kyotaro Horiguchi and Tom Lane
2016-04-27 17:55:25 -04:00
..
access Fix memory leak and other bugs in ginPlaceToPage() & subroutines. 2016-04-20 14:25:15 -04:00
bootstrap Update copyright for 2016 2016-01-02 13:33:40 -05:00
catalog Create default roles 2016-04-08 16:56:27 -04:00
commands Support ALTER THING .. DEPENDS ON EXTENSION 2016-04-05 18:38:54 -03:00
common Avoid PGDLLIMPORT for simple local references in frontend programs. 2016-03-23 23:26:44 -04:00
datatype Be more careful about out-of-range dates and timestamps. 2016-03-16 19:09:28 -04:00
executor Rework custom scans to work more like the new extensible node stuff. 2016-03-29 11:28:04 -04:00
fe_utils Support \crosstabview in psql 2016-04-08 20:23:18 -03:00
foreign Don't require a user mapping for FDWs to work. 2016-03-28 21:50:28 -04:00
lib Remove mergeHyperLogLog. 2016-04-27 10:55:32 -04:00
libpq Add authentication parameters compat_realm and upn_usename for SSPI 2016-04-08 20:28:38 +02:00
mb Update copyright for 2016 2016-01-02 13:33:40 -05:00
nodes Fix EXPLAIN VERBOSE output for parallel aggregate. 2016-04-27 07:37:40 -04:00
optimizer Fix costing for parallel aggregation. 2016-04-12 16:25:55 -04:00
parser Support ALTER THING .. DEPENDS ON EXTENSION 2016-04-05 18:38:54 -03:00
port Impose a full barrier in generic-xlc.h atomics functions. 2016-04-26 21:53:58 -04:00
portability Update copyright for 2016 2016-01-02 13:33:40 -05:00
postmaster Allow Pin/UnpinBuffer to operate in a lockfree manner. 2016-04-10 20:12:32 -07:00
regex Suppress compiler warnings about useless comparison of unsigned to zero. 2016-02-15 17:12:16 -05:00
replication Clean up parsing of synchronous_standby_names GUC variable. 2016-04-27 17:55:25 -04:00
rewrite Update copyright for 2016 2016-01-02 13:33:40 -05:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Emit invalidations to standby for transactions without xid. 2016-04-26 20:21:54 -07:00
tcop Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00
tsearch Restore original tsquery operation numbering. 2016-04-08 20:11:30 +03:00
utils PGDLLIMPORT-ify old_snapshot_threshold. 2016-04-21 14:33:34 -04:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Make init_spin_delay() C89 compliant and change stuck spinlock reporting. 2016-04-13 17:00:53 -07:00
fmgr.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
funcapi.h Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00
getaddrinfo.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
getopt_long.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
Makefile Create src/fe_utils/, and move stuff into there from pg_dump's dumputils. 2016-03-24 15:55:57 -04:00
miscadmin.h Use quicksort, not replacement selection, for external sorting. 2016-04-08 02:36:26 -04:00
pg_config.h.in Add BSD authentication method. 2016-04-08 13:52:06 -04:00
pg_config.h.win32 Add BSD authentication method. 2016-04-08 13:52:06 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Further reduce the number of semaphores used under --disable-spinlocks. 2016-04-18 13:33:06 -04:00
pg_getopt.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_trace.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgstat.h Remove trailing commas in enums. 2016-04-14 19:25:16 -07:00
pgtar.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgtime.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
port.h On all Windows platforms, not just Cygwin, use _timezone and _tzname. 2016-03-28 20:59:25 -04:00
postgres.h Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00
postgres_ext.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fe.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
rusagestub.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
windowapi.h Update copyright for 2016 2016-01-02 13:33:40 -05:00