pgsql: Rearrange the handling of error context reports.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Rearrange the handling of error context reports.
Дата
Msg-id E1ZYFro-000306-5Z@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Rearrange the handling of error context reports.

Remove the code in plpgsql that suppressed the innermost line of CONTEXT
for messages emitted by RAISE commands.  That was never more than a quick
backwards-compatibility hack, and it's pretty silly in cases where the
RAISE is nested in several levels of function.  What's more, it violated
our design theory that verbosity of error reports should be controlled
on the client side not the server side.

To alleviate the resulting noise increase, introduce a feature in libpq
and psql whereby the CONTEXT field of messages can be suppressed, either
always or only for non-error messages.  Printing CONTEXT for errors only
is now their default behavior.

The actual code changes here are pretty small, but the effects on the
regression test outputs are widespread.  I had to edit some of the
alternative expected outputs by hand; hopefully the buildfarm will soon
find anything I fat-fingered.

In passing, fix up (again) the output line counts in psql's various
help displays.  Add some commentary about how to verify them.

Pavel Stehule, reviewed by Petr Jelínek, Jeevan Chalke, and others

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0426f349effb6bde2061f3398a71db7180c97dd9

Modified Files
--------------
contrib/dblink/expected/dblink.out                 |    2 +
contrib/dblink/sql/dblink.sql                      |    3 +
contrib/hstore_plperl/expected/hstore_plperlu.out  |    7 --
.../hstore_plpython/expected/hstore_plpython.out   |    2 -
contrib/ltree_plpython/expected/ltree_plpython.out |    2 -
contrib/sepgsql/expected/alter.out                 |    5 -
contrib/sepgsql/expected/label.out                 |    2 -
doc/src/sgml/libpq.sgml                            |   40 ++++++
doc/src/sgml/ref/psql-ref.sgml                     |   15 +++
src/bin/psql/command.c                             |    1 +
src/bin/psql/help.c                                |   24 +++-
src/bin/psql/settings.h                            |    1 +
src/bin/psql/startup.c                             |   24 ++++
src/bin/psql/tab-complete.c                        |   12 +-
src/interfaces/libpq/exports.txt                   |    1 +
src/interfaces/libpq/fe-connect.c                  |   13 ++
src/interfaces/libpq/fe-protocol3.c                |   15 ++-
src/interfaces/libpq/libpq-fe.h                    |   11 ++
src/interfaces/libpq/libpq-int.h                   |    1 +
src/pl/plperl/expected/plperl.out                  |    2 -
src/pl/plperl/expected/plperl_elog.out             |    7 --
src/pl/plperl/expected/plperl_elog_1.out           |    7 --
src/pl/plperl/expected/plperl_trigger.out          |   78 ------------
src/pl/plperl/expected/plperlu.out                 |    1 -
src/pl/plpgsql/src/pl_exec.c                       |   10 --
src/pl/plpython/expected/plpython_do.out           |    2 -
src/pl/plpython/expected/plpython_error.out        |    4 -
src/pl/plpython/expected/plpython_error_0.out      |    4 -
src/pl/plpython/expected/plpython_error_5.out      |    4 -
src/pl/plpython/expected/plpython_spi.out          |   11 --
.../plpython/expected/plpython_subtransaction.out  |   13 --
.../expected/plpython_subtransaction_0.out         |    5 -
.../expected/plpython_subtransaction_5.out         |    5 -
src/pl/plpython/expected/plpython_test.out         |    6 -
src/pl/plpython/expected/plpython_trigger.out      |  131 --------------------
src/pl/plpython/expected/plpython_types.out        |   63 ----------
src/pl/plpython/expected/plpython_types_3.out      |   63 ----------
src/test/regress/expected/copy2.out                |    3 -
src/test/regress/expected/event_trigger.out        |   44 ++-----
src/test/regress/expected/plancache.out            |    4 -
src/test/regress/expected/plpgsql.out              |   66 ++++------
src/test/regress/expected/privileges.out           |    1 -
src/test/regress/expected/psql.out                 |   28 +++++
src/test/regress/expected/rangefuncs.out           |    4 -
src/test/regress/expected/triggers.out             |   74 +----------
src/test/regress/expected/xml.out                  |    1 -
src/test/regress/sql/event_trigger.sql             |    2 +-
src/test/regress/sql/psql.sql                      |   23 ++++
48 files changed, 237 insertions(+), 610 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix misc typos.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix CreateTableSpace() so it will compile without HAVE_SYMLINK.