From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rationalize handling of single and double quotes in bootstrap da
Date: Tue, 17 Apr 2018 23:53:56 +0000
Message-ID: <E1f8aQ8-0002OR-CZ@gemulon.postgresql.org> (raw)
Rationalize handling of single and double quotes in bootstrap data.
Change things around so that proper quoting of values interpolated into
the BKI data by initdb is the responsibility of initdb, not something
we half-heartedly handle by putting double quotes into the raw BKI data.
(Note: experimentation shows that it still doesn't work to put a double
quote into the initial superuser username, but that's the fault of
inadequate quoting while interpolating the name into SQL scripts;
the BKI aspect of it works fine now.)
Having done that, we can remove the special-case handling of values
that look like "something" from genbki.pl, and instead teach it to
escape double --- and single --- quotes properly. This removes the
nowhere-documented need to treat those specially in the BKI source
data; whatever you write will be passed through unchanged into the
inserted data value, modulo Perl's rules about single-quoted strings.
Add documentation explaining the (pre-existing) handling of backslashes
in the BKI data.
Per an earlier discussion with John Naylor.
Discussion: https://postgr.es/m/CAJVSVGUNao=-Q2-vAN3PYcdF5tnL5JAHwGwzZGuYHtq+Mk_9ng@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/55d26ff638f063fbccf57843f2c27f9795895a5c
Modified Files
--------------
doc/src/sgml/bki.sgml | 29 +++++++----------
src/backend/catalog/genbki.pl | 13 ++++++--
src/bin/initdb/initdb.c | 63 ++++++++++++++++++++++++++++++++++---
src/include/catalog/pg_authid.dat | 5 +--
src/include/catalog/pg_database.dat | 5 +--
src/include/catalog/pg_proc.dat | 12 +++----
6 files changed, 89 insertions(+), 38 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: Rationalize handling of single and double quotes in bootstrap da
In-Reply-To: <E1f8aQ8-0002OR-CZ@gemulon.postgresql.org>
References: <E1f8aQ8-0002OR-CZ@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