aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-11-22 05:20:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-11-22 05:20:41 +0000
commit1753337cf5d0aa5ba04b29ded65b824d9cf12c00 (patch)
treeadefbd23fd367d32f374e9ef9188b4ef37d47820 /src/bin/psql/command.c
parent93d3bac5648bddfe195a9cecc45ef0a2da5e85a8 (diff)
downloadpostgresql-1753337cf5d0aa5ba04b29ded65b824d9cf12c00.tar.gz
postgresql-1753337cf5d0aa5ba04b29ded65b824d9cf12c00.zip
Improve psql's tabular display of wrapped-around data by inserting markers
in the formerly-always-blank columns just to left and right of the data. Different marking is used for a line break caused by a newline in the data than for a straight wraparound. A newline break is signaled by a "+" in the right margin column in ASCII mode, or a carriage return arrow in UNICODE mode. Wraparound is signaled by a dot in the right margin as well as the following left margin in ASCII mode, or an ellipsis symbol in the same places in UNICODE mode. "\pset linestyle old-ascii" is added to make the previous behavior available if anyone really wants it. In passing, this commit also cleans up a few regression test files that had unintended spacing differences from the current actual output. Roger Leigh, reviewed by Gabrielle Roth and other members of PDXPUG.
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 6ce10caa2b8..5a356b9b5ee 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.210 2009/10/13 21:04:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.211 2009/11/22 05:20:41 tgl Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@@ -1795,11 +1795,13 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
;
else if (pg_strncasecmp("ascii", value, vallen) == 0)
popt->topt.line_style = &pg_asciiformat;
+ else if (pg_strncasecmp("old-ascii", value, vallen) == 0)
+ popt->topt.line_style = &pg_asciiformat_old;
else if (pg_strncasecmp("unicode", value, vallen) == 0)
popt->topt.line_style = &pg_utf8format;
else
{
- psql_error("\\pset: allowed line styles are ascii, unicode\n");
+ psql_error("\\pset: allowed line styles are ascii, old-ascii, unicode\n");
return false;
}