pgsql: Adjust behavior of single-user -j mode for better initdb error r

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Adjust behavior of single-user -j mode for better initdb error r
Дата
Msg-id E1a9j4D-0001x7-8W@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Adjust behavior of single-user -j mode for better initdb error reporting.

Previously, -j caused the entire input file to be read in and executed as
a single command string.  That's undesirable, not least because any error
causes the entire file to be regurgitated as the "failing query".  Some
experimentation suggests a better rule: end the command string when we see
a semicolon immediately followed by two newlines, ie, an empty line after
a query.  This serves nicely to break up the existing examples such as
information_schema.sql and system_views.sql.  A limitation is that it's
no longer possible to write such a sequence within a string literal or
multiline comment in a file meant to be read with -j; but there are no
instances of such a problem within the data currently used by initdb.
(If someone does make such a mistake in future, it'll be obvious because
they'll get an unterminated-literal or unterminated-comment syntax error.)
Other than that, there shouldn't be any negative consequences; you're not
forced to end statements that way, it's just a better idea in most cases.

In passing, remove src/include/tcop/tcopdebug.h, which is dead code
because it's not included anywhere, and hasn't been for more than
ten years.  One of the debug-support symbols it purported to describe
has been unreferenced for at least the same amount of time, and the
other is removed by this commit on the grounds that it was useless:
forcing -j mode all the time would have broken initdb.  The lack of
complaints about that, or about the missing inclusion, shows that
no one has tried to use TCOP_DONTUSENEWLINE in many years.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/66d947b9d302f1fd6de3d156e6ec61f52e1dc2cb

Modified Files
--------------
doc/src/sgml/ref/postgres-ref.sgml         |   45 ++++++++++------
src/backend/catalog/information_schema.sql |    8 +++
src/backend/catalog/system_views.sql       |    8 +++
src/backend/snowball/snowball.sql.in       |   20 ++++++-
src/backend/snowball/snowball_func.sql.in  |   19 ++++++-
src/backend/tcop/postgres.c                |   81 ++++++++++++----------------
src/include/tcop/tcopdebug.h               |   44 ---------------
7 files changed, 116 insertions(+), 109 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix improper initialization order for readline.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Use just one standalone-backend session for initdb's post-bootst