postgresql/src/bin/psql
Tom Lane 0e0776bc99 Rework wrap-width calculation in psql's print_aligned_vertical() function.
This area was rather heavily whacked around in 6513633b9 and follow-on
commits, and it was showing it, because the logic to calculate the
allowable data width in wrapped expanded mode had only the vaguest
relationship to the logic that was actually printing the data.  It was
not very close to being right about the conditions requiring overhead
columns to be added.  Aside from being wrong, it was pretty unreadable
and under-commented.  Rewrite it so it corresponds to what the printing
code actually does.

In passing, remove a couple of dead tests in the printing logic, too.

Per a complaint from Jeff Janes, though this doesn't look much like his
patch because it fixes a number of other corner-case bogosities too.
One such fix that's visible in the regression test results is that
although the code was attempting to enforce a minimum data width of
3 columns, it sometimes left less space than that available.
2015-11-30 17:53:32 -05:00
..
po Translation updates 2015-06-28 23:56:55 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
command.c Improve PQhost() to return useful data for default Unix-socket connections. 2015-11-27 14:13:53 -05:00
command.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
common.c pgindent run for 9.5 2015-05-23 21:35:49 -04:00
common.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
copy.c COPY (INSERT/UPDATE/DELETE .. RETURNING ..) 2015-11-27 19:11:22 +03:00
copy.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
create_help.pl Update copyright for 2015 2015-01-06 11:43:47 -05:00
describe.c ALTER TABLE .. FORCE ROW LEVEL SECURITY 2015-10-04 21:05:08 -04:00
describe.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
help.c Review program help output for wording and formatting 2015-09-16 00:59:28 -04:00
help.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
input.c Fix compiler warning about unused function in non-readline case. 2015-09-28 18:36:38 -04:00
input.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
large_obj.c Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
large_obj.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
mainloop.c Fix documentation of psql's ECHO all mode. 2015-01-31 18:35:13 -05:00
mainloop.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Update copyright for 2015 2015-01-06 11:43:47 -05:00
mbprint.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
mbprint.h Fix indentation of \d footers for non-ASCII cases. 2012-03-07 19:25:59 -05:00
nls.mk Add missing source files to nls.mk 2014-07-15 10:10:42 -04:00
print.c Rework wrap-width calculation in psql's print_aligned_vertical() function. 2015-11-30 17:53:32 -05:00
print.h pgindent run for 9.5 2015-05-23 21:35:49 -04:00
prompt.c Add psql PROMPT variable showing the pid of the connected to backend. 2015-07-07 13:40:44 +02:00
prompt.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
psqlrc.sample Improve FILES section of psql reference page. 2014-01-14 19:27:57 -05:00
psqlscan.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
psqlscan.l Remove a couple other vestigial yylex() declarations. 2015-03-29 13:12:28 -04:00
settings.h Rearrange the handling of error context reports. 2015-09-05 11:58:33 -04:00
startup.c Rearrange the handling of error context reports. 2015-09-05 11:58:33 -04:00
stringutils.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
stringutils.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
tab-complete.c When completing ALTER INDEX .. SET, add an equals sign also. 2015-11-06 22:59:47 -05:00
tab-complete.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
variables.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
variables.h Update copyright for 2015 2015-01-06 11:43:47 -05:00