]> granicus.if.org Git - postgresql/commit
Rearrange the handling of error context reports.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 5 Sep 2015 15:58:20 +0000 (11:58 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 5 Sep 2015 15:58:33 +0000 (11:58 -0400)
commit0426f349effb6bde2061f3398a71db7180c97dd9
tree741fcee27d57266182690fefd31721b8d6546b1e
parentc80b5f66c6faff085e312492be0aa50754e99eb9
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
48 files changed:
contrib/dblink/expected/dblink.out
contrib/dblink/sql/dblink.sql
contrib/hstore_plperl/expected/hstore_plperlu.out
contrib/hstore_plpython/expected/hstore_plpython.out
contrib/ltree_plpython/expected/ltree_plpython.out
contrib/sepgsql/expected/alter.out
contrib/sepgsql/expected/label.out
doc/src/sgml/libpq.sgml
doc/src/sgml/ref/psql-ref.sgml
src/bin/psql/command.c
src/bin/psql/help.c
src/bin/psql/settings.h
src/bin/psql/startup.c
src/bin/psql/tab-complete.c
src/interfaces/libpq/exports.txt
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-protocol3.c
src/interfaces/libpq/libpq-fe.h
src/interfaces/libpq/libpq-int.h
src/pl/plperl/expected/plperl.out
src/pl/plperl/expected/plperl_elog.out
src/pl/plperl/expected/plperl_elog_1.out
src/pl/plperl/expected/plperl_trigger.out
src/pl/plperl/expected/plperlu.out
src/pl/plpgsql/src/pl_exec.c
src/pl/plpython/expected/plpython_do.out
src/pl/plpython/expected/plpython_error.out
src/pl/plpython/expected/plpython_error_0.out
src/pl/plpython/expected/plpython_error_5.out
src/pl/plpython/expected/plpython_spi.out
src/pl/plpython/expected/plpython_subtransaction.out
src/pl/plpython/expected/plpython_subtransaction_0.out
src/pl/plpython/expected/plpython_subtransaction_5.out
src/pl/plpython/expected/plpython_test.out
src/pl/plpython/expected/plpython_trigger.out
src/pl/plpython/expected/plpython_types.out
src/pl/plpython/expected/plpython_types_3.out
src/test/regress/expected/copy2.out
src/test/regress/expected/event_trigger.out
src/test/regress/expected/plancache.out
src/test/regress/expected/plpgsql.out
src/test/regress/expected/privileges.out
src/test/regress/expected/psql.out
src/test/regress/expected/rangefuncs.out
src/test/regress/expected/triggers.out
src/test/regress/expected/xml.out
src/test/regress/sql/event_trigger.sql
src/test/regress/sql/psql.sql