Re: Improvements in psql hooks for variables

Stephen Frost <sfrost@snowman.net>

From: Stephen Frost <sfrost@snowman.net>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: Rahila Syed <rahilasyed90@gmail.com>, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2016-11-21T13:58:24Z
Lists: pgsql-hackers
Daniel,

* Daniel Verite (daniel@manitou-mail.org) wrote:
> "make check" seems OK with that, I hope it doesn't cause any regression
> elsewhere.

You can see what the code coverage of psql is in our current regression
tests by going here:

http://coverage.postgresql.org/src/bin/psql/index.html

It's not exactly a pretty sight and certainly not all callers of
ParseVariableBool() are covered.

I'd strongly suggest you either do sufficient manual testing, or add
regression tests, most likely using the tap test system (you can see an
example of that in src/bin/pg_dump/t and in other 't' directories).

You can generate that report after you make changes yourself using
'make coverage-html'.

Thanks!

Stephen

Commits

  1. Clean up psql's behavior for a few more control variables.

  2. Make psql's \set display variables in alphabetical order.

  3. Improve psql's behavior for \set and \unset of its control variables.

  4. Make psql reject attempts to set special variables to invalid values.