From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make postgres.bki use the same literal-string syntax as postgres
Date: Sun, 04 Oct 2020 20:10:04 +0000
Message-ID: <E1kPAKa-0003Mx-Tn@gemulon.postgresql.org> (raw)
Make postgres.bki use the same literal-string syntax as postgresql.conf.
The BKI file's string quoting conventions were previously quite weird,
perhaps as a result of repurposing a function built to scan
single-quoted strings to scan double-quoted ones. Change to use the
same rules as we use in GUC files, allowing some simplifications in
genbki.pl and initdb.c.
While at it, completely remove the backend's scanstr() function, which
was essentially a duplicate of the string dequoting code in guc-file.l.
Instead export that one (under a less generic name than it had) and let
bootscanner.l use it. Now we can clarify that scansup.c exists only to
support the main lexer. We could alternatively have removed GUC_scanstr,
but this way seems better since the previous arrangement could mislead
a reader into thinking that scanstr() had something to do with the main
lexer's handling of string literals. Maybe it did once, but if so it
was a long time ago.
This patch does not bump catversion, since the initially-installed
catalog contents don't change. Note however that successful initdb
after applying this patch will require up-to-date postgres.bki as well
as postgres and initdb executables.
In passing, remove a bunch of very-long-obsolete #include's in
bootparse.y and bootscanner.l.
John Naylor
Discussion: https://postgr.es/m/CACPNZCtDpd18T0KATTmCggO2GdVC4ow86ypiq5ENff1VnauL8g@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/97b61448262eae5e1b4a631aeac63b11d902a474
Modified Files
--------------
doc/src/sgml/bki.sgml | 10 ++--
src/backend/bootstrap/bootparse.y | 19 --------
src/backend/bootstrap/bootscanner.l | 29 ++---------
src/backend/catalog/genbki.pl | 6 +--
src/backend/parser/scansup.c | 95 +------------------------------------
src/backend/utils/misc/guc-file.l | 14 +++---
src/bin/initdb/initdb.c | 34 +++----------
src/include/parser/scansup.h | 5 +-
src/include/utils/guc.h | 1 +
9 files changed, 31 insertions(+), 182 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Make postgres.bki use the same literal-string syntax as postgres
In-Reply-To: <E1kPAKa-0003Mx-Tn@gemulon.postgresql.org>
References: <E1kPAKa-0003Mx-Tn@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox