*** a/src/bin/psql/print.c
--- b/src/bin/psql/print.c
***************
*** 1161,1166 **** print_aligned_vertical(const printTableContent *cont, FILE *fout)
--- 1161,1167 ----
  	struct lineptr *hlineptr,
  			   *dlineptr;
  	bool		is_pager = false;
+ 	int			output_columns = 0;		/* Width of interactive console */
  
  	if (cancel_pressed)
  		return;
***************
*** 1234,1250 **** print_aligned_vertical(const printTableContent *cont, FILE *fout)
  			fprintf(fout, "%s\n", cont->title);
  	}
  
  	/* print records */
  	for (i = 0, ptr = cont->cells; *ptr; i++, ptr++)
  	{
  		printTextRule pos;
! 		int			line_count,
  					dcomplete,
! 					hcomplete;
  
  		if (cancel_pressed)
  			break;
  
  		if (i == 0)
  			pos = PRINT_RULE_TOP;
  		else if (!(*(ptr + 1)))
--- 1235,1302 ----
  			fprintf(fout, "%s\n", cont->title);
  	}
  
+ 	/*
+ 	 * Choose target output width: \pset columns, or $COLUMNS, or ioctl
+ 	 */
+ 	if (cont->opt->columns > 0)
+ 		output_columns = cont->opt->columns;
+ 	else if ((fout == stdout && isatty(fileno(stdout))) || is_pager)
+ 	{
+ 		if (cont->opt->env_columns > 0)
+ 			output_columns = cont->opt->env_columns;
+ #ifdef TIOCGWINSZ
+ 		else
+ 		{
+ 			struct winsize screen_size;
+ 
+ 			if (ioctl(fileno(stdout), TIOCGWINSZ, &screen_size) != -1)
+ 				output_columns = screen_size.ws_col;
+ 		}
+ #endif
+ 	}
+ 
+ 	if (cont->opt->format == PRINT_WRAPPED)
+ 	{
+ 		/* Calculate the available width to wrap the columns to after
+ 		 * subtracting the maximum header width and separators. At a minimum
+ 		 * enough to print "[ RECORD N ]" */
+ 		unsigned int swidth;
+ 
+ 		if (opt_border == 0)
+ 			swidth = 1; /* "header data" */
+ 		else if (opt_border == 1)
+ 			swidth = 3; /* "header | data" */
+ 		else if (opt_border > 1)
+ 			swidth = 7; /* "| header | data |" */
+ 
+ 		/* If no output columns is set (pager or pipe case) then just use the
+ 		 * full display width, effectively disabling wrapping */
+ 		if (output_columns == 0)
+ 			output_columns = dwidth + swidth + hwidth;
+ 
+ 		/* Minimum expanded width is 20 to accomodate "RECORD N" */
+ 		Assert(hwidth + swidth < 20);
+ 		if (output_columns < 20 || dwidth + hwidth + swidth < 20)
+ 			dwidth = 20 - hwidth - swidth;
+ 		else if (output_columns < dwidth + swidth + hwidth)
+ 			dwidth = output_columns - hwidth - swidth;
+ 	}
+ 
  	/* print records */
  	for (i = 0, ptr = cont->cells; *ptr; i++, ptr++)
  	{
  		printTextRule pos;
! 		int			dline,
! 					hline,
  					dcomplete,
! 					hcomplete,
! 					offset,
! 					chars_to_output;
  
  		if (cancel_pressed)
  			break;
  
+ 		/* TODO ??!? */
  		if (i == 0)
  			pos = PRINT_RULE_TOP;
  		else if (!(*(ptr + 1)))
***************
*** 1252,1257 **** print_aligned_vertical(const printTableContent *cont, FILE *fout)
--- 1304,1310 ----
  		else
  			pos = PRINT_RULE_MIDDLE;
  
+ 		/* Print record header (e.g. "[ RECORD N ]") above each record */
  		if (i % cont->ncolumns == 0)
  		{
  			if (!opt_tuples_only)
***************
*** 1270,1317 **** print_aligned_vertical(const printTableContent *cont, FILE *fout)
  		pg_wcsformat((const unsigned char *) *ptr, strlen(*ptr), encoding,
  					 dlineptr, dheight);
  
! 		line_count = 0;
  		dcomplete = hcomplete = 0;
  		while (!dcomplete || !hcomplete)
  		{
  			if (opt_border == 2)
  				fprintf(fout, "%s ", dformat->leftvrule);
  			if (!hcomplete)
  			{
! 				fprintf(fout, "%-s%*s", hlineptr[line_count].ptr,
! 						hwidth - hlineptr[line_count].width, "");
  
! 				if (!hlineptr[line_count + 1].ptr)
  					hcomplete = 1;
  			}
  			else
! 				fprintf(fout, "%*s", hwidth, "");
  
  			if (opt_border > 0)
! 				fprintf(fout, " %s ", dformat->midvrule);
! 			else
! 				fputc(' ', fout);
  
  			if (!dcomplete)
  			{
! 				if (opt_border < 2)
! 					fprintf(fout, "%s\n", dlineptr[line_count].ptr);
! 				else
! 					fprintf(fout, "%-s%*s %s\n", dlineptr[line_count].ptr,
! 							dwidth - dlineptr[line_count].width, "",
! 							dformat->rightvrule);
  
! 				if (!dlineptr[line_count + 1].ptr)
  					dcomplete = 1;
  			}
  			else
  			{
  				if (opt_border < 2)
! 					fputc('\n', fout);
  				else
! 					fprintf(fout, "%*s %s\n", dwidth, "", dformat->rightvrule);
  			}
- 			line_count++;
  		}
  	}
  
--- 1323,1428 ----
  		pg_wcsformat((const unsigned char *) *ptr, strlen(*ptr), encoding,
  					 dlineptr, dheight);
  
! 		/* Loop through header and data in parallel dealing with newlines and
! 		 * wrapped lines until they're both exhausted */
! 		dline = hline = 0;
  		dcomplete = hcomplete = 0;
+ 		offset = 0;
+ 		chars_to_output = dlineptr[dline].width;
  		while (!dcomplete || !hcomplete)
  		{
+ 			/* Left border */
  			if (opt_border == 2)
  				fprintf(fout, "%s ", dformat->leftvrule);
+ 
+ 			/* Header (never wrapped so just need to deal with newlines) */
  			if (!hcomplete)
  			{
! 				int twidth = fprintf(fout, "%-s", hlineptr[hline].ptr);
! 				int swidth = hwidth - twidth;
! 				if (swidth > 0) /* spacer */
! 					fprintf(fout, "%*s", swidth, "");
  
! 				if (hlineptr[hline + 1].ptr)
! 				{
! 					/* More lines after this one due to a newline */
! 					fputs(format->nl_right, fout);
! 					hline++;
! 				} 
! 				else 
! 				{
! 					/* This was the last line of the header */
! 					fputs(" ", fout);
  					hcomplete = 1;
+ 				}
  			}
  			else
! 			{
! 				/* Header exhausted but more data for column */
! 				fprintf(fout, "%*s", hwidth + 1, "");
! 			}
  
+ 			/* Separator */
  			if (opt_border > 0)
! 				fprintf(fout, "%s", dformat->midvrule);
  
+ 			/* Data */
  			if (!dcomplete)
  			{
! 				int target_width,
! 					bytes_to_output,
! 					swidth;
! 
! 				fputs(!dcomplete && !offset? " ": format->wrap_left, fout);
! 
! 				target_width = dwidth;
! 				bytes_to_output = strlen_max_width(dlineptr[dline].ptr + offset,
! 												   &target_width, encoding);
! 				fputnbytes(fout, (char *)(dlineptr[dline].ptr + offset),
! 						   bytes_to_output);
! 
! 				chars_to_output -= target_width;
! 				offset += bytes_to_output;
  
! 				/* spacer */
! 				swidth = dwidth - target_width;
! 				if (swidth > 0)
! 					fprintf(fout, "%*s", swidth, "");
! 
! 				if (chars_to_output)
! 				{
! 					/* continuing a wrapped column */
! 					fputs(format->wrap_right, fout);
! 				}
! 				else if (dlineptr[dline + 1].ptr)
! 				{
! 					/* reached a newline in the column */
! 					fputs(format->nl_right, fout);
! 					dline++;
! 					offset = 0;
! 					chars_to_output = dlineptr[dline].width;
! 				}
! 				else
! 				{
! 					/* reached the end of the cell */
! 					fputs(" ", fout);
  					dcomplete = 1;
+ 				}
+ 
+ 				if (opt_border == 2)
+ 					fputs(dformat->rightvrule, fout);
+ 
+ 				fputs("\n", fout);
  			}
  			else
  			{
+ 				/* data exhausted (this can occur if header is longer than the
+ 				 * data due to newlines in the header) */
  				if (opt_border < 2)
! 					fputs("\n", fout);
  				else
! 					fprintf(fout, "%*s  %s\n", dwidth, "", dformat->rightvrule);
  			}
  		}
  	}
  
*** a/src/test/regress/expected/psql.out
--- b/src/test/regress/expected/psql.out
***************
*** 68,70 **** Record separator (recordsep) is <newline>.
--- 68,3104 ----
  Table attributes (tableattr) unset.
  Title (title) unset.
  Tuples only (tuples_only) is off.
+ -- test multi-line headers, wrapping, and newline indicators
+ prepare q as select array_to_string(array_agg(repeat('x',2*n)),E'\n') as "a
+ 
+ b", array_to_string(array_agg(repeat('y',20-2*n)),E'\n') as "a
+ b" from generate_series(1,10) as n(n) group by n>1 ;
+ \pset linestyle ascii
+ \pset expanded off
+ \pset columns 40
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+          a          +        a         +
+                     +        b          
+          b                              
+ -------------------- ------------------
+ xx                   yyyyyyyyyyyyyyyyyy
+ xxxx                +yyyyyyyyyyyyyyyy  +
+ xxxxxx              +yyyyyyyyyyyyyy    +
+ xxxxxxxx            +yyyyyyyyyyyy      +
+ xxxxxxxxxx          +yyyyyyyyyy        +
+ xxxxxxxxxxxx        +yyyyyyyy          +
+ xxxxxxxxxxxxxx      +yyyyyy            +
+ xxxxxxxxxxxxxxxx    +yyyy              +
+ xxxxxxxxxxxxxxxxxx  +yy                +
+ xxxxxxxxxxxxxxxxxxxx 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+          a          +        a         +
+                     +        b          
+          b                              
+ -------------------- ------------------
+ xx                   yyyyyyyyyyyyyyyyyy
+ xxxx                +yyyyyyyyyyyyyyyy  +
+ xxxxxx              +yyyyyyyyyyyyyy    +
+ xxxxxxxx            +yyyyyyyyyyyy      +
+ xxxxxxxxxx          +yyyyyyyyyy        +
+ xxxxxxxxxxxx        +yyyyyyyy          +
+ xxxxxxxxxxxxxx      +yyyyyy            +
+ xxxxxxxxxxxxxxxx    +yyyy              +
+ xxxxxxxxxxxxxxxxxx  +yy                +
+ xxxxxxxxxxxxxxxxxxxx 
+ (2 rows)
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+           a          +|         a         +
+                      +|         b          
+           b           |                    
+ ----------------------+--------------------
+  xx                   | yyyyyyyyyyyyyyyyyy
+  xxxx                +| yyyyyyyyyyyyyyyy  +
+  xxxxxx              +| yyyyyyyyyyyyyy    +
+  xxxxxxxx            +| yyyyyyyyyyyy      +
+  xxxxxxxxxx          +| yyyyyyyyyy        +
+  xxxxxxxxxxxx        +| yyyyyyyy          +
+  xxxxxxxxxxxxxx      +| yyyyyy            +
+  xxxxxxxxxxxxxxxx    +| yyyy              +
+  xxxxxxxxxxxxxxxxxx  +| yy                +
+  xxxxxxxxxxxxxxxxxxxx | 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+          a        +|         a         +
+                   +|         b          
+          b         |                    
+ -------------------+--------------------
+  xx                | yyyyyyyyyyyyyyyyyy
+  xxxx             +| yyyyyyyyyyyyyyyy  +
+  xxxxxx           +| yyyyyyyyyyyyyy    +
+  xxxxxxxx         +| yyyyyyyyyyyy      +
+  xxxxxxxxxx       +| yyyyyyyyyy        +
+  xxxxxxxxxxxx     +| yyyyyyyy          +
+  xxxxxxxxxxxxxx   +| yyyyyy            +
+  xxxxxxxxxxxxxxxx +| yyyy              +
+  xxxxxxxxxxxxxxxxx.| yy                +
+ .x                +| 
+  xxxxxxxxxxxxxxxxx.| 
+ .xxx               | 
+ (2 rows)
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+ +----------------------+--------------------+
+ |          a          +|         a         +|
+ |                     +|         b          |
+ |          b           |                    |
+ +----------------------+--------------------+
+ | xx                   | yyyyyyyyyyyyyyyyyy |
+ | xxxx                +| yyyyyyyyyyyyyyyy  +|
+ | xxxxxx              +| yyyyyyyyyyyyyy    +|
+ | xxxxxxxx            +| yyyyyyyyyyyy      +|
+ | xxxxxxxxxx          +| yyyyyyyyyy        +|
+ | xxxxxxxxxxxx        +| yyyyyyyy          +|
+ | xxxxxxxxxxxxxx      +| yyyyyy            +|
+ | xxxxxxxxxxxxxxxx    +| yyyy              +|
+ | xxxxxxxxxxxxxxxxxx  +| yy                +|
+ | xxxxxxxxxxxxxxxxxxxx |                    |
+ +----------------------+--------------------+
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+ +-----------------+--------------------+
+ |        a       +|         a         +|
+ |                +|         b          |
+ |        b        |                    |
+ +-----------------+--------------------+
+ | xx              | yyyyyyyyyyyyyyyyyy |
+ | xxxx           +| yyyyyyyyyyyyyyyy  +|
+ | xxxxxx         +| yyyyyyyyyyyyyy    +|
+ | xxxxxxxx       +| yyyyyyyyyyyy      +|
+ | xxxxxxxxxx     +| yyyyyyyyyy        +|
+ | xxxxxxxxxxxx   +| yyyyyyyy          +|
+ | xxxxxxxxxxxxxx +| yyyyyy            +|
+ | xxxxxxxxxxxxxxx.| yyyy              +|
+ |.x              +| yy                +|
+ | xxxxxxxxxxxxxxx.|                    |
+ |.xxx            +|                    |
+ | xxxxxxxxxxxxxxx.|                    |
+ |.xxxxx           |                    |
+ +-----------------+--------------------+
+ (2 rows)
+ 
+ \pset expanded on
+ \pset columns 20
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ * Record 1           
+ a+ xx                   
+  +
+ b 
+ a+ yyyyyyyyyyyyyyyyyy   
+ b 
+ * Record 2           
+ a+ xxxx                +
+  + xxxxxx              +
+ b  xxxxxxxx            +
+    xxxxxxxxxx          +
+    xxxxxxxxxxxx        +
+    xxxxxxxxxxxxxx      +
+    xxxxxxxxxxxxxxxx    +
+    xxxxxxxxxxxxxxxxxx  +
+    xxxxxxxxxxxxxxxxxxxx 
+ a+ yyyyyyyyyyyyyyyy    +
+ b  yyyyyyyyyyyyyy      +
+    yyyyyyyyyyyy        +
+    yyyyyyyyyy          +
+    yyyyyyyy            +
+    yyyyyy              +
+    yyyy                +
+    yy                  +
+                         
+ 
+ \pset format wrapped
+ execute q;
+ * Record 1         
+ a+ xx                 
+  +
+ b 
+ a+ yyyyyyyyyyyyyyyyyy 
+ b 
+ * Record 2         
+ a+ xxxx              +
+  + xxxxxx            +
+ b  xxxxxxxx          +
+    xxxxxxxxxx        +
+    xxxxxxxxxxxx      +
+    xxxxxxxxxxxxxx    +
+    xxxxxxxxxxxxxxxx  +
+    xxxxxxxxxxxxxxxxxx+
+    xxxxxxxxxxxxxxxxxx.
+   .xx                 
+ a+ yyyyyyyyyyyyyyyy  +
+ b  yyyyyyyyyyyyyy    +
+    yyyyyyyyyyyy      +
+    yyyyyyyyyy        +
+    yyyyyyyy          +
+    yyyyyy            +
+    yyyy              +
+    yy                +
+                       
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ -[ RECORD 1 ]-----------
+ a+| xx                   
+  +|
+ b |
+ a+| yyyyyyyyyyyyyyyyyy   
+ b |
+ -[ RECORD 2 ]-----------
+ a+| xxxx                +
+  +| xxxxxx              +
+ b | xxxxxxxx            +
+   | xxxxxxxxxx          +
+   | xxxxxxxxxxxx        +
+   | xxxxxxxxxxxxxx      +
+   | xxxxxxxxxxxxxxxx    +
+   | xxxxxxxxxxxxxxxxxx  +
+   | xxxxxxxxxxxxxxxxxxxx 
+ a+| yyyyyyyyyyyyyyyy    +
+ b | yyyyyyyyyyyyyy      +
+   | yyyyyyyyyyyy        +
+   | yyyyyyyyyy          +
+   | yyyyyyyy            +
+   | yyyyyy              +
+   | yyyy                +
+   | yy                  +
+   |                      
+ 
+ \pset format wrapped
+ execute q;
+ -[ RECORD 1 ]-------
+ a+| xx               
+  +|
+ b |
+ a+| yyyyyyyyyyyyyyyy.
+ b |.yy               
+ -[ RECORD 2 ]-------
+ a+| xxxx            +
+  +| xxxxxx          +
+ b | xxxxxxxx        +
+   | xxxxxxxxxx      +
+   | xxxxxxxxxxxx    +
+   | xxxxxxxxxxxxxx  +
+   | xxxxxxxxxxxxxxxx+
+   | xxxxxxxxxxxxxxxx.
+   |.xx              +
+   | xxxxxxxxxxxxxxxx.
+   |.xxxx             
+ a+| yyyyyyyyyyyyyyyy+
+ b | yyyyyyyyyyyyyy  +
+   | yyyyyyyyyyyy    +
+   | yyyyyyyyyy      +
+   | yyyyyyyy        +
+   | yyyyyy          +
+   | yyyy            +
+   | yy              +
+   |                  
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ +-[ RECORD 1 ]-------------+
+ | a+| xx                   |
+ |  +|                      |
+ | b |                      |
+ | a+| yyyyyyyyyyyyyyyyyy   |
+ | b |                      |
+ +-[ RECORD 2 ]-------------+
+ | a+| xxxx                +|
+ |  +| xxxxxx              +|
+ | b | xxxxxxxx            +|
+ |   | xxxxxxxxxx          +|
+ |   | xxxxxxxxxxxx        +|
+ |   | xxxxxxxxxxxxxx      +|
+ |   | xxxxxxxxxxxxxxxx    +|
+ |   | xxxxxxxxxxxxxxxxxx  +|
+ |   | xxxxxxxxxxxxxxxxxxxx |
+ | a+| yyyyyyyyyyyyyyyy    +|
+ | b | yyyyyyyyyyyyyy      +|
+ |   | yyyyyyyyyyyy        +|
+ |   | yyyyyyyyyy          +|
+ |   | yyyyyyyy            +|
+ |   | yyyyyy              +|
+ |   | yyyy                +|
+ |   | yy                  +|
+ |   |                      |
+ +---+----------------------+
+ 
+ \pset format wrapped
+ execute q;
+ +-[ RECORD 1 ]-----+
+ | a+| xx           |
+ |  +|              |
+ | b |              |
+ | a+| yyyyyyyyyyyy.|
+ | b |.yyyyyy       |
+ +-[ RECORD 2 ]-----+
+ | a+| xxxx        +|
+ |  +| xxxxxx      +|
+ | b | xxxxxxxx    +|
+ |   | xxxxxxxxxx  +|
+ |   | xxxxxxxxxxxx+|
+ |   | xxxxxxxxxxxx.|
+ |   |.xx          +|
+ |   | xxxxxxxxxxxx.|
+ |   |.xxxx        +|
+ |   | xxxxxxxxxxxx.|
+ |   |.xxxxxx      +|
+ |   | xxxxxxxxxxxx.|
+ |   |.xxxxxxxx     |
+ | a+| yyyyyyyyyyyy.|
+ | b |.yyyy        +|
+ |   | yyyyyyyyyyyy.|
+ |   |.yy          +|
+ |   | yyyyyyyyyyyy+|
+ |   | yyyyyyyyyy  +|
+ |   | yyyyyyyy    +|
+ |   | yyyyyy      +|
+ |   | yyyy        +|
+ |   | yy          +|
+ |   |              |
+ +---+--------------+
+ 
+ \pset linestyle old-ascii
+ \pset expanded off
+ \pset columns 40
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+          a                   a         
+                     +        b         
+          b          +                  
+ -------------------- ------------------
+ xx                   yyyyyyyyyyyyyyyyyy
+ xxxx                 yyyyyyyyyyyyyyyy   
+ xxxxxx               yyyyyyyyyyyyyy     
+ xxxxxxxx             yyyyyyyyyyyy       
+ xxxxxxxxxx           yyyyyyyyyy         
+ xxxxxxxxxxxx         yyyyyyyy           
+ xxxxxxxxxxxxxx       yyyyyy             
+ xxxxxxxxxxxxxxxx     yyyy               
+ xxxxxxxxxxxxxxxxxx   yy                 
+ xxxxxxxxxxxxxxxxxxxx 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+          a                   a         
+                     +        b         
+          b          +                  
+ -------------------- ------------------
+ xx                   yyyyyyyyyyyyyyyyyy
+ xxxx                 yyyyyyyyyyyyyyyy   
+ xxxxxx               yyyyyyyyyyyyyy     
+ xxxxxxxx             yyyyyyyyyyyy       
+ xxxxxxxxxx           yyyyyyyyyy         
+ xxxxxxxxxxxx         yyyyyyyy           
+ xxxxxxxxxxxxxx       yyyyyy             
+ xxxxxxxxxxxxxxxx     yyyy               
+ xxxxxxxxxxxxxxxxxx   yy                 
+ xxxxxxxxxxxxxxxxxxxx 
+ (2 rows)
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+           a           |         a          
+ +                     |+        b          
+ +         b           |+                   
+ ----------------------+--------------------
+  xx                   | yyyyyyyyyyyyyyyyyy
+  xxxx                 | yyyyyyyyyyyyyyyy   
+  xxxxxx               : yyyyyyyyyyyyyy     
+  xxxxxxxx             : yyyyyyyyyyyy       
+  xxxxxxxxxx           : yyyyyyyyyy         
+  xxxxxxxxxxxx         : yyyyyyyy           
+  xxxxxxxxxxxxxx       : yyyyyy             
+  xxxxxxxxxxxxxxxx     : yyyy               
+  xxxxxxxxxxxxxxxxxx   : yy                 
+  xxxxxxxxxxxxxxxxxxxx : 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+          a         |         a          
+ +                  |+        b          
+ +        b         |+                   
+ -------------------+--------------------
+  xx                | yyyyyyyyyyyyyyyyyy
+  xxxx              | yyyyyyyyyyyyyyyy   
+  xxxxxx            : yyyyyyyyyyyyyy     
+  xxxxxxxx          : yyyyyyyyyyyy       
+  xxxxxxxxxx        : yyyyyyyyyy         
+  xxxxxxxxxxxx      : yyyyyyyy           
+  xxxxxxxxxxxxxx    : yyyyyy             
+  xxxxxxxxxxxxxxxx  : yyyy               
+  xxxxxxxxxxxxxxxxx : yy                 
+  x                 : 
+  xxxxxxxxxxxxxxxxx   
+  xxx                 
+ (2 rows)
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+ +----------------------+--------------------+
+ |          a           |         a          |
+ |+                     |+        b          |
+ |+         b           |+                   |
+ +----------------------+--------------------+
+ | xx                   | yyyyyyyyyyyyyyyyyy |
+ | xxxx                 | yyyyyyyyyyyyyyyy   |
+ | xxxxxx               : yyyyyyyyyyyyyy     |
+ | xxxxxxxx             : yyyyyyyyyyyy       |
+ | xxxxxxxxxx           : yyyyyyyyyy         |
+ | xxxxxxxxxxxx         : yyyyyyyy           |
+ | xxxxxxxxxxxxxx       : yyyyyy             |
+ | xxxxxxxxxxxxxxxx     : yyyy               |
+ | xxxxxxxxxxxxxxxxxx   : yy                 |
+ | xxxxxxxxxxxxxxxxxxxx :                    |
+ +----------------------+--------------------+
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+ +-----------------+--------------------+
+ |        a        |         a          |
+ |+                |+        b          |
+ |+       b        |+                   |
+ +-----------------+--------------------+
+ | xx              | yyyyyyyyyyyyyyyyyy |
+ | xxxx            | yyyyyyyyyyyyyyyy   |
+ | xxxxxx          : yyyyyyyyyyyyyy     |
+ | xxxxxxxx        : yyyyyyyyyyyy       |
+ | xxxxxxxxxx      : yyyyyyyyyy         |
+ | xxxxxxxxxxxx    : yyyyyyyy           |
+ | xxxxxxxxxxxxxx  : yyyyyy             |
+ | xxxxxxxxxxxxxxx : yyyy               |
+ | x               : yy                 |
+ | xxxxxxxxxxxxxxx :                    |
+ | xxx                                  |
+ | xxxxxxxxxxxxxxx                      |
+ | xxxxx                                |
+ +-----------------+--------------------+
+ (2 rows)
+ 
+ \pset expanded on
+ \pset columns 20
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ * Record 1           
+ a  xx                   
+   
+ b 
+ a  yyyyyyyyyyyyyyyyyy   
+ b 
+ * Record 2           
+ a  xxxx                 
+    xxxxxx               
+ b  xxxxxxxx             
+    xxxxxxxxxx           
+    xxxxxxxxxxxx         
+    xxxxxxxxxxxxxx       
+    xxxxxxxxxxxxxxxx     
+    xxxxxxxxxxxxxxxxxx   
+    xxxxxxxxxxxxxxxxxxxx 
+ a  yyyyyyyyyyyyyyyy     
+ b  yyyyyyyyyyyyyy       
+    yyyyyyyyyyyy         
+    yyyyyyyyyy           
+    yyyyyyyy             
+    yyyyyy               
+    yyyy                 
+    yy                   
+                         
+ 
+ \pset format wrapped
+ execute q;
+ * Record 1         
+ a  xx                 
+   
+ b 
+ a  yyyyyyyyyyyyyyyyyy 
+ b 
+ * Record 2         
+ a  xxxx               
+    xxxxxx             
+ b  xxxxxxxx           
+    xxxxxxxxxx         
+    xxxxxxxxxxxx       
+    xxxxxxxxxxxxxx     
+    xxxxxxxxxxxxxxxx   
+    xxxxxxxxxxxxxxxxxx 
+    xxxxxxxxxxxxxxxxxx 
+    xx                 
+ a  yyyyyyyyyyyyyyyy   
+ b  yyyyyyyyyyyyyy     
+    yyyyyyyyyyyy       
+    yyyyyyyyyy         
+    yyyyyyyy           
+    yyyyyy             
+    yyyy               
+    yy                 
+                       
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ -[ RECORD 1 ]-----------
+ a | xx                   
+   |
+ b |
+ a | yyyyyyyyyyyyyyyyyy   
+ b |
+ -[ RECORD 2 ]-----------
+ a | xxxx                 
+   | xxxxxx               
+ b | xxxxxxxx             
+   | xxxxxxxxxx           
+   | xxxxxxxxxxxx         
+   | xxxxxxxxxxxxxx       
+   | xxxxxxxxxxxxxxxx     
+   | xxxxxxxxxxxxxxxxxx   
+   | xxxxxxxxxxxxxxxxxxxx 
+ a | yyyyyyyyyyyyyyyy     
+ b | yyyyyyyyyyyyyy       
+   | yyyyyyyyyyyy         
+   | yyyyyyyyyy           
+   | yyyyyyyy             
+   | yyyyyy               
+   | yyyy                 
+   | yy                   
+   |                      
+ 
+ \pset format wrapped
+ execute q;
+ -[ RECORD 1 ]-------
+ a | xx               
+   |
+ b |
+ a | yyyyyyyyyyyyyyyy 
+ b | yy               
+ -[ RECORD 2 ]-------
+ a | xxxx             
+   | xxxxxx           
+ b | xxxxxxxx         
+   | xxxxxxxxxx       
+   | xxxxxxxxxxxx     
+   | xxxxxxxxxxxxxx   
+   | xxxxxxxxxxxxxxxx 
+   | xxxxxxxxxxxxxxxx 
+   | xx               
+   | xxxxxxxxxxxxxxxx 
+   | xxxx             
+ a | yyyyyyyyyyyyyyyy 
+ b | yyyyyyyyyyyyyy   
+   | yyyyyyyyyyyy     
+   | yyyyyyyyyy       
+   | yyyyyyyy         
+   | yyyyyy           
+   | yyyy             
+   | yy               
+   |                  
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ +-[ RECORD 1 ]-------------+
+ | a | xx                   |
+ |   |                      |
+ | b |                      |
+ | a | yyyyyyyyyyyyyyyyyy   |
+ | b |                      |
+ +-[ RECORD 2 ]-------------+
+ | a | xxxx                 |
+ |   | xxxxxx               |
+ | b | xxxxxxxx             |
+ |   | xxxxxxxxxx           |
+ |   | xxxxxxxxxxxx         |
+ |   | xxxxxxxxxxxxxx       |
+ |   | xxxxxxxxxxxxxxxx     |
+ |   | xxxxxxxxxxxxxxxxxx   |
+ |   | xxxxxxxxxxxxxxxxxxxx |
+ | a | yyyyyyyyyyyyyyyy     |
+ | b | yyyyyyyyyyyyyy       |
+ |   | yyyyyyyyyyyy         |
+ |   | yyyyyyyyyy           |
+ |   | yyyyyyyy             |
+ |   | yyyyyy               |
+ |   | yyyy                 |
+ |   | yy                   |
+ |   |                      |
+ +---+----------------------+
+ 
+ \pset format wrapped
+ execute q;
+ +-[ RECORD 1 ]-----+
+ | a | xx           |
+ |   |              |
+ | b |              |
+ | a | yyyyyyyyyyyy |
+ | b | yyyyyy       |
+ +-[ RECORD 2 ]-----+
+ | a | xxxx         |
+ |   | xxxxxx       |
+ | b | xxxxxxxx     |
+ |   | xxxxxxxxxx   |
+ |   | xxxxxxxxxxxx |
+ |   | xxxxxxxxxxxx |
+ |   | xx           |
+ |   | xxxxxxxxxxxx |
+ |   | xxxx         |
+ |   | xxxxxxxxxxxx |
+ |   | xxxxxx       |
+ |   | xxxxxxxxxxxx |
+ |   | xxxxxxxx     |
+ | a | yyyyyyyyyyyy |
+ | b | yyyy         |
+ |   | yyyyyyyyyyyy |
+ |   | yy           |
+ |   | yyyyyyyyyyyy |
+ |   | yyyyyyyyyy   |
+ |   | yyyyyyyy     |
+ |   | yyyyyy       |
+ |   | yyyy         |
+ |   | yy           |
+ |   |              |
+ +---+--------------+
+ 
+ \pset linestyle unicode
+ \pset expanded off
+ \pset columns 40
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+          a          ↵        a         ↵
+                     ↵        b          
+          b                              
+ ──────────────────── ──────────────────
+ xx                   yyyyyyyyyyyyyyyyyy
+ xxxx                ↵yyyyyyyyyyyyyyyy  ↵
+ xxxxxx              ↵yyyyyyyyyyyyyy    ↵
+ xxxxxxxx            ↵yyyyyyyyyyyy      ↵
+ xxxxxxxxxx          ↵yyyyyyyyyy        ↵
+ xxxxxxxxxxxx        ↵yyyyyyyy          ↵
+ xxxxxxxxxxxxxx      ↵yyyyyy            ↵
+ xxxxxxxxxxxxxxxx    ↵yyyy              ↵
+ xxxxxxxxxxxxxxxxxx  ↵yy                ↵
+ xxxxxxxxxxxxxxxxxxxx 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+          a          ↵        a         ↵
+                     ↵        b          
+          b                              
+ ──────────────────── ──────────────────
+ xx                   yyyyyyyyyyyyyyyyyy
+ xxxx                ↵yyyyyyyyyyyyyyyy  ↵
+ xxxxxx              ↵yyyyyyyyyyyyyy    ↵
+ xxxxxxxx            ↵yyyyyyyyyyyy      ↵
+ xxxxxxxxxx          ↵yyyyyyyyyy        ↵
+ xxxxxxxxxxxx        ↵yyyyyyyy          ↵
+ xxxxxxxxxxxxxx      ↵yyyyyy            ↵
+ xxxxxxxxxxxxxxxx    ↵yyyy              ↵
+ xxxxxxxxxxxxxxxxxx  ↵yy                ↵
+ xxxxxxxxxxxxxxxxxxxx 
+ (2 rows)
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+           a          ↵│         a         ↵
+                      ↵│         b          
+           b           │                    
+ ──────────────────────┼────────────────────
+  xx                   │ yyyyyyyyyyyyyyyyyy
+  xxxx                ↵│ yyyyyyyyyyyyyyyy  ↵
+  xxxxxx              ↵│ yyyyyyyyyyyyyy    ↵
+  xxxxxxxx            ↵│ yyyyyyyyyyyy      ↵
+  xxxxxxxxxx          ↵│ yyyyyyyyyy        ↵
+  xxxxxxxxxxxx        ↵│ yyyyyyyy          ↵
+  xxxxxxxxxxxxxx      ↵│ yyyyyy            ↵
+  xxxxxxxxxxxxxxxx    ↵│ yyyy              ↵
+  xxxxxxxxxxxxxxxxxx  ↵│ yy                ↵
+  xxxxxxxxxxxxxxxxxxxx │ 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+          a        ↵│         a         ↵
+                   ↵│         b          
+          b         │                    
+ ───────────────────┼────────────────────
+  xx                │ yyyyyyyyyyyyyyyyyy
+  xxxx             ↵│ yyyyyyyyyyyyyyyy  ↵
+  xxxxxx           ↵│ yyyyyyyyyyyyyy    ↵
+  xxxxxxxx         ↵│ yyyyyyyyyyyy      ↵
+  xxxxxxxxxx       ↵│ yyyyyyyyyy        ↵
+  xxxxxxxxxxxx     ↵│ yyyyyyyy          ↵
+  xxxxxxxxxxxxxx   ↵│ yyyyyy            ↵
+  xxxxxxxxxxxxxxxx ↵│ yyyy              ↵
+  xxxxxxxxxxxxxxxxx…│ yy                ↵
+ …x                ↵│ 
+  xxxxxxxxxxxxxxxxx…│ 
+ …xxx               │ 
+ (2 rows)
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ xx|yyyyyyyyyyyyyyyyyy
+ xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+ ┌──────────────────────┬────────────────────┐
+ │          a          ↵│         a         ↵│
+ │                     ↵│         b          │
+ │          b           │                    │
+ ├──────────────────────┼────────────────────┤
+ │ xx                   │ yyyyyyyyyyyyyyyyyy │
+ │ xxxx                ↵│ yyyyyyyyyyyyyyyy  ↵│
+ │ xxxxxx              ↵│ yyyyyyyyyyyyyy    ↵│
+ │ xxxxxxxx            ↵│ yyyyyyyyyyyy      ↵│
+ │ xxxxxxxxxx          ↵│ yyyyyyyyyy        ↵│
+ │ xxxxxxxxxxxx        ↵│ yyyyyyyy          ↵│
+ │ xxxxxxxxxxxxxx      ↵│ yyyyyy            ↵│
+ │ xxxxxxxxxxxxxxxx    ↵│ yyyy              ↵│
+ │ xxxxxxxxxxxxxxxxxx  ↵│ yy                ↵│
+ │ xxxxxxxxxxxxxxxxxxxx │                    │
+ └──────────────────────┴────────────────────┘
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+ ┌─────────────────┬────────────────────┐
+ │        a       ↵│         a         ↵│
+ │                ↵│         b          │
+ │        b        │                    │
+ ├─────────────────┼────────────────────┤
+ │ xx              │ yyyyyyyyyyyyyyyyyy │
+ │ xxxx           ↵│ yyyyyyyyyyyyyyyy  ↵│
+ │ xxxxxx         ↵│ yyyyyyyyyyyyyy    ↵│
+ │ xxxxxxxx       ↵│ yyyyyyyyyyyy      ↵│
+ │ xxxxxxxxxx     ↵│ yyyyyyyyyy        ↵│
+ │ xxxxxxxxxxxx   ↵│ yyyyyyyy          ↵│
+ │ xxxxxxxxxxxxxx ↵│ yyyyyy            ↵│
+ │ xxxxxxxxxxxxxxx…│ yyyy              ↵│
+ │…x              ↵│ yy                ↵│
+ │ xxxxxxxxxxxxxxx…│                    │
+ │…xxx            ↵│                    │
+ │ xxxxxxxxxxxxxxx…│                    │
+ │…xxxxx           │                    │
+ └─────────────────┴────────────────────┘
+ (2 rows)
+ 
+ \pset expanded on
+ \pset columns 20
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ * Record 1           
+ a↵ xx                   
+  ↵
+ b 
+ a↵ yyyyyyyyyyyyyyyyyy   
+ b 
+ * Record 2           
+ a↵ xxxx                ↵
+  ↵ xxxxxx              ↵
+ b  xxxxxxxx            ↵
+    xxxxxxxxxx          ↵
+    xxxxxxxxxxxx        ↵
+    xxxxxxxxxxxxxx      ↵
+    xxxxxxxxxxxxxxxx    ↵
+    xxxxxxxxxxxxxxxxxx  ↵
+    xxxxxxxxxxxxxxxxxxxx 
+ a↵ yyyyyyyyyyyyyyyy    ↵
+ b  yyyyyyyyyyyyyy      ↵
+    yyyyyyyyyyyy        ↵
+    yyyyyyyyyy          ↵
+    yyyyyyyy            ↵
+    yyyyyy              ↵
+    yyyy                ↵
+    yy                  ↵
+                         
+ 
+ \pset format wrapped
+ execute q;
+ * Record 1         
+ a↵ xx                 
+  ↵
+ b 
+ a↵ yyyyyyyyyyyyyyyyyy 
+ b 
+ * Record 2         
+ a↵ xxxx              ↵
+  ↵ xxxxxx            ↵
+ b  xxxxxxxx          ↵
+    xxxxxxxxxx        ↵
+    xxxxxxxxxxxx      ↵
+    xxxxxxxxxxxxxx    ↵
+    xxxxxxxxxxxxxxxx  ↵
+    xxxxxxxxxxxxxxxxxx↵
+    xxxxxxxxxxxxxxxxxx…
+   …xx                 
+ a↵ yyyyyyyyyyyyyyyy  ↵
+ b  yyyyyyyyyyyyyy    ↵
+    yyyyyyyyyyyy      ↵
+    yyyyyyyyyy        ↵
+    yyyyyyyy          ↵
+    yyyyyy            ↵
+    yyyy              ↵
+    yy                ↵
+                       
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ ─[ RECORD 1 ]───────────
+ a↵│ xx                   
+  ↵│
+ b │
+ a↵│ yyyyyyyyyyyyyyyyyy   
+ b │
+ ─[ RECORD 2 ]───────────
+ a↵│ xxxx                ↵
+  ↵│ xxxxxx              ↵
+ b │ xxxxxxxx            ↵
+   │ xxxxxxxxxx          ↵
+   │ xxxxxxxxxxxx        ↵
+   │ xxxxxxxxxxxxxx      ↵
+   │ xxxxxxxxxxxxxxxx    ↵
+   │ xxxxxxxxxxxxxxxxxx  ↵
+   │ xxxxxxxxxxxxxxxxxxxx 
+ a↵│ yyyyyyyyyyyyyyyy    ↵
+ b │ yyyyyyyyyyyyyy      ↵
+   │ yyyyyyyyyyyy        ↵
+   │ yyyyyyyyyy          ↵
+   │ yyyyyyyy            ↵
+   │ yyyyyy              ↵
+   │ yyyy                ↵
+   │ yy                  ↵
+   │                      
+ 
+ \pset format wrapped
+ execute q;
+ ─[ RECORD 1 ]───────
+ a↵│ xx               
+  ↵│
+ b │
+ a↵│ yyyyyyyyyyyyyyyy…
+ b │…yy               
+ ─[ RECORD 2 ]───────
+ a↵│ xxxx            ↵
+  ↵│ xxxxxx          ↵
+ b │ xxxxxxxx        ↵
+   │ xxxxxxxxxx      ↵
+   │ xxxxxxxxxxxx    ↵
+   │ xxxxxxxxxxxxxx  ↵
+   │ xxxxxxxxxxxxxxxx↵
+   │ xxxxxxxxxxxxxxxx…
+   │…xx              ↵
+   │ xxxxxxxxxxxxxxxx…
+   │…xxxx             
+ a↵│ yyyyyyyyyyyyyyyy↵
+ b │ yyyyyyyyyyyyyy  ↵
+   │ yyyyyyyyyyyy    ↵
+   │ yyyyyyyyyy      ↵
+   │ yyyyyyyy        ↵
+   │ yyyyyy          ↵
+   │ yyyy            ↵
+   │ yy              ↵
+   │                  
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|xx
+ a
+ b|yyyyyyyyyyyyyyyyyy
+ 
+ a
+ 
+ b|xxxx
+ xxxxxx
+ xxxxxxxx
+ xxxxxxxxxx
+ xxxxxxxxxxxx
+ xxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxx
+ a
+ b|yyyyyyyyyyyyyyyy
+ yyyyyyyyyyyyyy
+ yyyyyyyyyyyy
+ yyyyyyyyyy
+ yyyyyyyy
+ yyyyyy
+ yyyy
+ yy
+ 
+ \pset format aligned
+ execute q;
+ ┌─[ RECORD 1 ]─────────────┐
+ │ a↵│ xx                   │
+ │  ↵│                      │
+ │ b │                      │
+ │ a↵│ yyyyyyyyyyyyyyyyyy   │
+ │ b │                      │
+ ├─[ RECORD 2 ]─────────────┤
+ │ a↵│ xxxx                ↵│
+ │  ↵│ xxxxxx              ↵│
+ │ b │ xxxxxxxx            ↵│
+ │   │ xxxxxxxxxx          ↵│
+ │   │ xxxxxxxxxxxx        ↵│
+ │   │ xxxxxxxxxxxxxx      ↵│
+ │   │ xxxxxxxxxxxxxxxx    ↵│
+ │   │ xxxxxxxxxxxxxxxxxx  ↵│
+ │   │ xxxxxxxxxxxxxxxxxxxx │
+ │ a↵│ yyyyyyyyyyyyyyyy    ↵│
+ │ b │ yyyyyyyyyyyyyy      ↵│
+ │   │ yyyyyyyyyyyy        ↵│
+ │   │ yyyyyyyyyy          ↵│
+ │   │ yyyyyyyy            ↵│
+ │   │ yyyyyy              ↵│
+ │   │ yyyy                ↵│
+ │   │ yy                  ↵│
+ │   │                      │
+ └───┴──────────────────────┘
+ 
+ \pset format wrapped
+ execute q;
+ ┌─[ RECORD 1 ]─────┐
+ │ a↵│ xx           │
+ │  ↵│              │
+ │ b │              │
+ │ a↵│ yyyyyyyyyyyy…│
+ │ b │…yyyyyy       │
+ ├─[ RECORD 2 ]─────┤
+ │ a↵│ xxxx        ↵│
+ │  ↵│ xxxxxx      ↵│
+ │ b │ xxxxxxxx    ↵│
+ │   │ xxxxxxxxxx  ↵│
+ │   │ xxxxxxxxxxxx↵│
+ │   │ xxxxxxxxxxxx…│
+ │   │…xx          ↵│
+ │   │ xxxxxxxxxxxx…│
+ │   │…xxxx        ↵│
+ │   │ xxxxxxxxxxxx…│
+ │   │…xxxxxx      ↵│
+ │   │ xxxxxxxxxxxx…│
+ │   │…xxxxxxxx     │
+ │ a↵│ yyyyyyyyyyyy…│
+ │ b │…yyyy        ↵│
+ │   │ yyyyyyyyyyyy…│
+ │   │…yy          ↵│
+ │   │ yyyyyyyyyyyy↵│
+ │   │ yyyyyyyyyy  ↵│
+ │   │ yyyyyyyy    ↵│
+ │   │ yyyyyy      ↵│
+ │   │ yyyy        ↵│
+ │   │ yy          ↵│
+ │   │              │
+ └───┴──────────────┘
+ 
+ deallocate q;
+ -- Do it all over again with a utf character
+ \encoding unicode
+ prepare q as select array_to_string(array_agg(repeat(convert_from('\xEFBCB8'::bytea,'utf-8'),2*n)),E'\n') as "a
+ 
+ b", array_to_string(array_agg(repeat(convert_from('\xEFBCB8'::bytea,'utf-8'),20-2*n)),E'\n') as "a
+ b" from generate_series(1,10) as n(n) group by n>1 ;
+ \pset linestyle ascii
+ \pset expanded off
+ \pset columns 40
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+                    a                    +                 a                  +
+                                         +                 b                   
+                    b                                                          
+ ---------------------------------------- ------------------------------------
+ ＸＸ                                     ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ                                +ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +
+ ＸＸＸＸＸＸ                            +ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +
+ ＸＸＸＸＸＸＸＸ                        +ＸＸＸＸＸＸＸＸＸＸＸＸ            +
+ ＸＸＸＸＸＸＸＸＸＸ                    +ＸＸＸＸＸＸＸＸＸＸ                +
+ ＸＸＸＸＸＸＸＸＸＸＸＸ                +ＸＸＸＸＸＸＸＸ                    +
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +ＸＸＸＸＸＸ                        +
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +ＸＸＸＸ                            +
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +ＸＸ                                +
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+       a       +           a            +
+               +           b             
+       b                                 
+ -------------- ------------------------
+ ＸＸ           ＸＸＸＸＸＸＸＸＸＸＸＸ.
+                ＸＸＸＸＸＸ
+ ＸＸＸＸ      +ＸＸＸＸＸＸＸＸＸＸＸＸ.
+ ＸＸＸＸＸＸ  +ＸＸＸＸ                +
+ ＸＸＸＸＸＸＸ.ＸＸＸＸＸＸＸＸＸＸＸＸ.
+ Ｘ            +ＸＸ                    +
+ ＸＸＸＸＸＸＸ.ＸＸＸＸＸＸＸＸＸＸＸＸ+
+ ＸＸＸ        +ＸＸＸＸＸＸＸＸＸＸ    +
+ ＸＸＸＸＸＸＸ.ＸＸＸＸＸＸＸＸ        +
+ ＸＸＸＸＸ    +ＸＸＸＸＸＸ            +
+ ＸＸＸＸＸＸＸ.ＸＸＸＸ                +
+ ＸＸＸＸＸＸＸ+ＸＸ                    +
+ ＸＸＸＸＸＸＸ.
+ ＸＸＸＸＸＸＸ.
+ ＸＸ          +
+ ＸＸＸＸＸＸＸ.
+ ＸＸＸＸＸＸＸ.
+ ＸＸＸＸ      +
+ ＸＸＸＸＸＸＸ.
+ ＸＸＸＸＸＸＸ.
+ ＸＸＸＸＸＸ   
+ (2 rows)
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+                     a                    +|                  a                  +
+                                          +|                  b                   
+                     b                     |                                      
+ ------------------------------------------+--------------------------------------
+  ＸＸ                                     | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+  ＸＸＸＸ                                +| ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +
+  ＸＸＸＸＸＸ                            +| ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +
+  ＸＸＸＸＸＸＸＸ                        +| ＸＸＸＸＸＸＸＸＸＸＸＸ            +
+  ＸＸＸＸＸＸＸＸＸＸ                    +| ＸＸＸＸＸＸＸＸＸＸ                +
+  ＸＸＸＸＸＸＸＸＸＸＸＸ                +| ＸＸＸＸＸＸＸＸ                    +
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +| ＸＸＸＸＸＸ                        +
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +| ＸＸＸＸ                            +
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +| ＸＸ                                +
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ | 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+        a      +|           a           +
+               +|           b            
+        b       |                        
+ ---------------+------------------------
+  ＸＸ          | ＸＸＸＸＸＸＸＸＸＸＸ.
+                |.ＸＸＸＸＸＸＸ
+  ＸＸＸＸ     +| ＸＸＸＸＸＸＸＸＸＸＸ.
+  ＸＸＸＸＸＸ +|.ＸＸＸＸＸ            +
+  ＸＸＸＸＸＸ .| ＸＸＸＸＸＸＸＸＸＸＸ.
+ .ＸＸ         +|.ＸＸＸ                +
+  ＸＸＸＸＸＸ .| ＸＸＸＸＸＸＸＸＸＸＸ.
+ .ＸＸＸＸ     +|.Ｘ                    +
+  ＸＸＸＸＸＸ .| ＸＸＸＸＸＸＸＸＸＸ  +
+ .ＸＸＸＸＸＸ +| ＸＸＸＸＸＸＸＸ      +
+  ＸＸＸＸＸＸ .| ＸＸＸＸＸＸ          +
+ .ＸＸＸＸＸＸ .| ＸＸＸＸ              +
+ .ＸＸ         +| ＸＸ                  +
+  ＸＸＸＸＸＸ .| 
+ .ＸＸＸＸＸＸ .| 
+ .ＸＸＸＸ     +| 
+  ＸＸＸＸＸＸ .| 
+ .ＸＸＸＸＸＸ .| 
+ .ＸＸＸＸＸＸ +| 
+  ＸＸＸＸＸＸ .| 
+ .ＸＸＸＸＸＸ .| 
+ .ＸＸＸＸＸＸ .| 
+ .ＸＸ          | 
+ (2 rows)
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+ +------------------------------------------+--------------------------------------+
+ |                    a                    +|                  a                  +|
+ |                                         +|                  b                   |
+ |                    b                     |                                      |
+ +------------------------------------------+--------------------------------------+
+ | ＸＸ                                     | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ |
+ | ＸＸＸＸ                                +| ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +|
+ | ＸＸＸＸＸＸ                            +| ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +|
+ | ＸＸＸＸＸＸＸＸ                        +| ＸＸＸＸＸＸＸＸＸＸＸＸ            +|
+ | ＸＸＸＸＸＸＸＸＸＸ                    +| ＸＸＸＸＸＸＸＸＸＸ                +|
+ | ＸＸＸＸＸＸＸＸＸＸＸＸ                +| ＸＸＸＸＸＸＸＸ                    +|
+ | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +| ＸＸＸＸＸＸ                        +|
+ | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +| ＸＸＸＸ                            +|
+ | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +| ＸＸ                                +|
+ | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ |                                      |
+ +------------------------------------------+--------------------------------------+
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+ +--------------+-----------------------+
+ |      a      +|           a          +|
+ |             +|           b           |
+ |      b       |                       |
+ +--------------+-----------------------+
+ | ＸＸ         | ＸＸＸＸＸＸＸＸＸＸ .|
+ |              |.ＸＸＸＸＸＸＸＸ      |
+ | ＸＸＸＸ    +| ＸＸＸＸＸＸＸＸＸＸ .|
+ | ＸＸＸＸＸＸ+|.ＸＸＸＸＸＸ         +|
+ | ＸＸＸＸＸＸ.| ＸＸＸＸＸＸＸＸＸＸ .|
+ |.ＸＸ        +|.ＸＸＸＸ             +|
+ | ＸＸＸＸＸＸ.| ＸＸＸＸＸＸＸＸＸＸ .|
+ |.ＸＸＸＸ    +|.ＸＸ                 +|
+ | ＸＸＸＸＸＸ.| ＸＸＸＸＸＸＸＸＸＸ +|
+ |.ＸＸＸＸＸＸ+| ＸＸＸＸＸＸＸＸ     +|
+ | ＸＸＸＸＸＸ.| ＸＸＸＸＸＸ         +|
+ |.ＸＸＸＸＸＸ.| ＸＸＸＸ             +|
+ |.ＸＸ        +| ＸＸ                 +|
+ | ＸＸＸＸＸＸ.|                       |
+ |.ＸＸＸＸＸＸ.|                       |
+ |.ＸＸＸＸ    +|                       |
+ | ＸＸＸＸＸＸ.|                       |
+ |.ＸＸＸＸＸＸ.|                       |
+ |.ＸＸＸＸＸＸ+|                       |
+ | ＸＸＸＸＸＸ.|                       |
+ |.ＸＸＸＸＸＸ.|                       |
+ |.ＸＸＸＸＸＸ.|                       |
+ |.ＸＸ         |                       |
+ +--------------+-----------------------+
+ (2 rows)
+ 
+ \pset expanded on
+ \pset columns 20
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ * Record 1                               
+ a+ ＸＸ                                     
+  +
+ b 
+ a+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+ b 
+ * Record 2                               
+ a+ ＸＸＸＸ                                +
+  + ＸＸＸＸＸＸ                            +
+ b  ＸＸＸＸＸＸＸＸ                        +
+    ＸＸＸＸＸＸＸＸＸＸ                    +
+    ＸＸＸＸＸＸＸＸＸＸＸＸ                +
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ a+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +
+ b  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +
+    ＸＸＸＸＸＸＸＸＸＸＸＸ                +
+    ＸＸＸＸＸＸＸＸＸＸ                    +
+    ＸＸＸＸＸＸＸＸ                        +
+    ＸＸＸＸＸＸ                            +
+    ＸＸＸＸ                                +
+    ＸＸ                                    +
+                                             
+ 
+ \pset format wrapped
+ execute q;
+ * Record 1         
+ a+ ＸＸ               
+  +
+ b 
+ a+ ＸＸＸＸＸＸＸＸＸ.
+ b .ＸＸＸＸＸＸＸＸＸ 
+ * Record 2         
+ a+ ＸＸＸＸ          +
+  + ＸＸＸＸＸＸ      +
+ b  ＸＸＸＸＸＸＸＸ  +
+    ＸＸＸＸＸＸＸＸＸ.
+   .Ｘ                +
+    ＸＸＸＸＸＸＸＸＸ.
+   .ＸＸＸ            +
+    ＸＸＸＸＸＸＸＸＸ.
+   .ＸＸＸＸＸ        +
+    ＸＸＸＸＸＸＸＸＸ.
+   .ＸＸＸＸＸＸＸ    +
+    ＸＸＸＸＸＸＸＸＸ.
+   .ＸＸＸＸＸＸＸＸＸ+
+    ＸＸＸＸＸＸＸＸＸ.
+   .ＸＸＸＸＸＸＸＸＸ.
+   .ＸＸ               
+ a+ ＸＸＸＸＸＸＸＸＸ.
+ b .ＸＸＸＸＸＸＸ    +
+    ＸＸＸＸＸＸＸＸＸ.
+   .ＸＸＸＸＸ        +
+    ＸＸＸＸＸＸＸＸＸ.
+   .ＸＸＸ            +
+    ＸＸＸＸＸＸＸＸＸ.
+   .Ｘ                +
+    ＸＸＸＸＸＸＸＸ  +
+    ＸＸＸＸＸＸ      +
+    ＸＸＸＸ          +
+    ＸＸ              +
+                       
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ -[ RECORD 1 ]-------------------------------
+ a+| ＸＸ                                     
+  +|
+ b |
+ a+| ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+ b |
+ -[ RECORD 2 ]-------------------------------
+ a+| ＸＸＸＸ                                +
+  +| ＸＸＸＸＸＸ                            +
+ b | ＸＸＸＸＸＸＸＸ                        +
+   | ＸＸＸＸＸＸＸＸＸＸ                    +
+   | ＸＸＸＸＸＸＸＸＸＸＸＸ                +
+   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +
+   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +
+   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +
+   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ a+| ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +
+ b | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +
+   | ＸＸＸＸＸＸＸＸＸＸＸＸ                +
+   | ＸＸＸＸＸＸＸＸＸＸ                    +
+   | ＸＸＸＸＸＸＸＸ                        +
+   | ＸＸＸＸＸＸ                            +
+   | ＸＸＸＸ                                +
+   | ＸＸ                                    +
+   |                                          
+ 
+ \pset format wrapped
+ execute q;
+ -[ RECORD 1 ]-------
+ a+| ＸＸ             
+  +|
+ b |
+ a+| ＸＸＸＸＸＸＸＸ.
+ b |.ＸＸＸＸＸＸＸＸ.
+   |.ＸＸ             
+ -[ RECORD 2 ]-------
+ a+| ＸＸＸＸ        +
+  +| ＸＸＸＸＸＸ    +
+ b | ＸＸＸＸＸＸＸＸ+
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸ            +
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸＸＸ        +
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸＸＸＸＸ    +
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸＸＸＸＸＸＸ+
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸＸＸＸＸＸＸ.
+   |.ＸＸ            +
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸＸＸＸＸＸＸ.
+   |.ＸＸＸＸ         
+ a+| ＸＸＸＸＸＸＸＸ.
+ b |.ＸＸＸＸＸＸＸＸ+
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸＸＸＸＸ    +
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸＸＸ        +
+   | ＸＸＸＸＸＸＸＸ.
+   |.ＸＸ            +
+   | ＸＸＸＸＸＸＸＸ+
+   | ＸＸＸＸＸＸ    +
+   | ＸＸＸＸ        +
+   | ＸＸ            +
+   |                  
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ +-[ RECORD 1 ]---------------------------------+
+ | a+| ＸＸ                                     |
+ |  +|                                          |
+ | b |                                          |
+ | a+| ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     |
+ | b |                                          |
+ +-[ RECORD 2 ]---------------------------------+
+ | a+| ＸＸＸＸ                                +|
+ |  +| ＸＸＸＸＸＸ                            +|
+ | b | ＸＸＸＸＸＸＸＸ                        +|
+ |   | ＸＸＸＸＸＸＸＸＸＸ                    +|
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸ                +|
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +|
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +|
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    +|
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ |
+ | a+| ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        +|
+ | b | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            +|
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸ                +|
+ |   | ＸＸＸＸＸＸＸＸＸＸ                    +|
+ |   | ＸＸＸＸＸＸＸＸ                        +|
+ |   | ＸＸＸＸＸＸ                            +|
+ |   | ＸＸＸＸ                                +|
+ |   | ＸＸ                                    +|
+ |   |                                          |
+ +---+------------------------------------------+
+ 
+ \pset format wrapped
+ execute q;
+ +-[ RECORD 1 ]-----+
+ | a+| ＸＸ         |
+ |  +|              |
+ | b |              |
+ | a+| ＸＸＸＸＸＸ.|
+ | b |.ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ |
+ +-[ RECORD 2 ]-----+
+ | a+| ＸＸＸＸ    +|
+ |  +| ＸＸＸＸＸＸ+|
+ | b | ＸＸＸＸＸＸ.|
+ |   |.ＸＸ        +|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸ    +|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ+|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ.|
+ |   |.ＸＸ        +|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸ    +|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ+|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ.|
+ |   |.ＸＸ         |
+ | a+| ＸＸＸＸＸＸ.|
+ | b |.ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸ    +|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ.|
+ |   |.ＸＸ        +|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸＸＸ+|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸＸＸ    +|
+ |   | ＸＸＸＸＸＸ.|
+ |   |.ＸＸ        +|
+ |   | ＸＸＸＸＸＸ+|
+ |   | ＸＸＸＸ    +|
+ |   | ＸＸ        +|
+ |   |              |
+ +---+--------------+
+ 
+ -- old-ascii has a number of disadvantages and should probably be
+ -- removed. When reading this output keep in mind that old-ascii
+ -- doesn't show wrapping on the right-most column (because it uses the
+ -- "right" border style not the "mid" border style) and that we don't
+ -- bother with old-ascii divider markings on headers since we never
+ -- wrap them anwyays so they would always show the newline marker.
+ \pset linestyle old-ascii
+ \pset expanded off
+ \pset columns 40
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+                    a                                      a                  
+                                         +                 b                  
+                    b                    +                                    
+ ---------------------------------------- ------------------------------------
+ ＸＸ                                     ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ                                 ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+ ＸＸＸＸＸＸ                             ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         
+ ＸＸＸＸＸＸＸＸ                         ＸＸＸＸＸＸＸＸＸＸＸＸ             
+ ＸＸＸＸＸＸＸＸＸＸ                     ＸＸＸＸＸＸＸＸＸＸ                 
+ ＸＸＸＸＸＸＸＸＸＸＸＸ                 ＸＸＸＸＸＸＸＸ                     
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             ＸＸＸＸＸＸ                         
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         ＸＸＸＸ                             
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     ＸＸ                                 
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+       a                   a            
+               +           b            
+       b       +                        
+ -------------- ------------------------
+ ＸＸ           ＸＸＸＸＸＸＸＸＸＸＸＸ 
+                ＸＸＸＸＸＸ
+ ＸＸＸＸ       ＸＸＸＸＸＸＸＸＸＸＸＸ 
+ ＸＸＸＸＸＸ   ＸＸＸＸ                 
+ ＸＸＸＸＸＸＸ ＸＸＸＸＸＸＸＸＸＸＸＸ 
+ Ｘ             ＸＸ                     
+ ＸＸＸＸＸＸＸ ＸＸＸＸＸＸＸＸＸＸＸＸ 
+ ＸＸＸ         ＸＸＸＸＸＸＸＸＸＸ     
+ ＸＸＸＸＸＸＸ ＸＸＸＸＸＸＸＸ         
+ ＸＸＸＸＸ     ＸＸＸＸＸＸ             
+ ＸＸＸＸＸＸＸ ＸＸＸＸ                 
+ ＸＸＸＸＸＸＸ ＸＸ                     
+ ＸＸＸＸＸＸＸ 
+ ＸＸＸＸＸＸＸ 
+ ＸＸ           
+ ＸＸＸＸＸＸＸ 
+ ＸＸＸＸＸＸＸ 
+ ＸＸＸＸ       
+ ＸＸＸＸＸＸＸ 
+ ＸＸＸＸＸＸＸ 
+ ＸＸＸＸＸＸ   
+ (2 rows)
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+                     a                     |                  a                   
+ +                                         |+                 b                   
+ +                   b                     |+                                     
+ ------------------------------------------+--------------------------------------
+  ＸＸ                                     | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+  ＸＸＸＸ                                 | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+  ＸＸＸＸＸＸ                             : ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         
+  ＸＸＸＸＸＸＸＸ                         : ＸＸＸＸＸＸＸＸＸＸＸＸ             
+  ＸＸＸＸＸＸＸＸＸＸ                     : ＸＸＸＸＸＸＸＸＸＸ                 
+  ＸＸＸＸＸＸＸＸＸＸＸＸ                 : ＸＸＸＸＸＸＸＸ                     
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             : ＸＸＸＸＸＸ                         
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         : ＸＸＸＸ                             
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     : ＸＸ                                 
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ : 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+        a       |           a            
+ +              |+          b            
+ +      b       |+                       
+ ---------------+------------------------
+  ＸＸ          | ＸＸＸＸＸＸＸＸＸＸＸ 
+                ; ＸＸＸＸＸＸＸ
+  ＸＸＸＸ      | ＸＸＸＸＸＸＸＸＸＸＸ 
+  ＸＸＸＸＸＸ  ; ＸＸＸＸＸ             
+  ＸＸＸＸＸＸ  : ＸＸＸＸＸＸＸＸＸＸＸ 
+  ＸＸ          ; ＸＸＸ                 
+  ＸＸＸＸＸＸ  : ＸＸＸＸＸＸＸＸＸＸＸ 
+  ＸＸＸＸ      ; Ｘ                     
+  ＸＸＸＸＸＸ  : ＸＸＸＸＸＸＸＸＸＸ   
+  ＸＸＸＸＸＸ  : ＸＸＸＸＸＸＸＸ       
+  ＸＸＸＸＸＸ  : ＸＸＸＸＸＸ           
+  ＸＸＸＸＸＸ  : ＸＸＸＸ               
+  ＸＸ          : ＸＸ                   
+  ＸＸＸＸＸＸ  : 
+  ＸＸＸＸＸＸ    
+  ＸＸＸＸ        
+  ＸＸＸＸＸＸ    
+  ＸＸＸＸＸＸ    
+  ＸＸＸＸＸＸ    
+  ＸＸＸＸＸＸ    
+  ＸＸＸＸＸＸ    
+  ＸＸＸＸＸＸ    
+  ＸＸ            
+ (2 rows)
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+ +------------------------------------------+--------------------------------------+
+ |                    a                     |                  a                   |
+ |+                                         |+                 b                   |
+ |+                   b                     |+                                     |
+ +------------------------------------------+--------------------------------------+
+ | ＸＸ                                     | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ |
+ | ＸＸＸＸ                                 | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     |
+ | ＸＸＸＸＸＸ                             : ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         |
+ | ＸＸＸＸＸＸＸＸ                         : ＸＸＸＸＸＸＸＸＸＸＸＸ             |
+ | ＸＸＸＸＸＸＸＸＸＸ                     : ＸＸＸＸＸＸＸＸＸＸ                 |
+ | ＸＸＸＸＸＸＸＸＸＸＸＸ                 : ＸＸＸＸＸＸＸＸ                     |
+ | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             : ＸＸＸＸＸＸ                         |
+ | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         : ＸＸＸＸ                             |
+ | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     : ＸＸ                                 |
+ | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ :                                      |
+ +------------------------------------------+--------------------------------------+
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+ +--------------+-----------------------+
+ |      a       |           a           |
+ |+             |+          b           |
+ |+     b       |+                      |
+ +--------------+-----------------------+
+ | ＸＸ         | ＸＸＸＸＸＸＸＸＸＸ  |
+ |              ; ＸＸＸＸＸＸＸＸ      |
+ | ＸＸＸＸ     | ＸＸＸＸＸＸＸＸＸＸ  |
+ | ＸＸＸＸＸＸ ; ＸＸＸＸＸＸ          |
+ | ＸＸＸＸＸＸ : ＸＸＸＸＸＸＸＸＸＸ  |
+ | ＸＸ         ; ＸＸＸＸ              |
+ | ＸＸＸＸＸＸ : ＸＸＸＸＸＸＸＸＸＸ  |
+ | ＸＸＸＸ     ; ＸＸ                  |
+ | ＸＸＸＸＸＸ : ＸＸＸＸＸＸＸＸＸＸ  |
+ | ＸＸＸＸＸＸ : ＸＸＸＸＸＸＸＸ      |
+ | ＸＸＸＸＸＸ : ＸＸＸＸＸＸ          |
+ | ＸＸＸＸＸＸ : ＸＸＸＸ              |
+ | ＸＸ         : ＸＸ                  |
+ | ＸＸＸＸＸＸ :                       |
+ | ＸＸＸＸＸＸ                         |
+ | ＸＸＸＸ                             |
+ | ＸＸＸＸＸＸ                         |
+ | ＸＸＸＸＸＸ                         |
+ | ＸＸＸＸＸＸ                         |
+ | ＸＸＸＸＸＸ                         |
+ | ＸＸＸＸＸＸ                         |
+ | ＸＸＸＸＸＸ                         |
+ | ＸＸ                                 |
+ +--------------+-----------------------+
+ (2 rows)
+ 
+ \pset expanded on
+ \pset columns 20
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ * Record 1                               
+ a  ＸＸ                                     
+   
+ b 
+ a  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+ b 
+ * Record 2                               
+ a  ＸＸＸＸ                                 
+    ＸＸＸＸＸＸ                             
+ b  ＸＸＸＸＸＸＸＸ                         
+    ＸＸＸＸＸＸＸＸＸＸ                     
+    ＸＸＸＸＸＸＸＸＸＸＸＸ                 
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ a  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         
+ b  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             
+    ＸＸＸＸＸＸＸＸＸＸＸＸ                 
+    ＸＸＸＸＸＸＸＸＸＸ                     
+    ＸＸＸＸＸＸＸＸ                         
+    ＸＸＸＸＸＸ                             
+    ＸＸＸＸ                                 
+    ＸＸ                                     
+                                             
+ 
+ \pset format wrapped
+ execute q;
+ * Record 1         
+ a  ＸＸ               
+   
+ b 
+ a  ＸＸＸＸＸＸＸＸＸ 
+ b  ＸＸＸＸＸＸＸＸＸ 
+ * Record 2         
+ a  ＸＸＸＸ           
+    ＸＸＸＸＸＸ       
+ b  ＸＸＸＸＸＸＸＸ   
+    ＸＸＸＸＸＸＸＸＸ 
+    Ｘ                 
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸＸ             
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸＸＸＸ         
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸＸＸＸＸＸ     
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸ               
+ a  ＸＸＸＸＸＸＸＸＸ 
+ b  ＸＸＸＸＸＸＸ     
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸＸＸＸ         
+    ＸＸＸＸＸＸＸＸＸ 
+    ＸＸＸ             
+    ＸＸＸＸＸＸＸＸＸ 
+    Ｘ                 
+    ＸＸＸＸＸＸＸＸ   
+    ＸＸＸＸＸＸ       
+    ＸＸＸＸ           
+    ＸＸ               
+                       
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ -[ RECORD 1 ]-------------------------------
+ a | ＸＸ                                     
+   |
+ b |
+ a | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+ b |
+ -[ RECORD 2 ]-------------------------------
+ a | ＸＸＸＸ                                 
+   | ＸＸＸＸＸＸ                             
+ b | ＸＸＸＸＸＸＸＸ                         
+   | ＸＸＸＸＸＸＸＸＸＸ                     
+   | ＸＸＸＸＸＸＸＸＸＸＸＸ                 
+   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             
+   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         
+   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ a | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         
+ b | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             
+   | ＸＸＸＸＸＸＸＸＸＸＸＸ                 
+   | ＸＸＸＸＸＸＸＸＸＸ                     
+   | ＸＸＸＸＸＸＸＸ                         
+   | ＸＸＸＸＸＸ                             
+   | ＸＸＸＸ                                 
+   | ＸＸ                                     
+   |                                          
+ 
+ \pset format wrapped
+ execute q;
+ -[ RECORD 1 ]-------
+ a | ＸＸ             
+   |
+ b |
+ a | ＸＸＸＸＸＸＸＸ 
+ b | ＸＸＸＸＸＸＸＸ 
+   | ＸＸ             
+ -[ RECORD 2 ]-------
+ a | ＸＸＸＸ         
+   | ＸＸＸＸＸＸ     
+ b | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸ             
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸ         
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸ     
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸ             
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸ         
+ a | ＸＸＸＸＸＸＸＸ 
+ b | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸ     
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸ         
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸ             
+   | ＸＸＸＸＸＸＸＸ 
+   | ＸＸＸＸＸＸ     
+   | ＸＸＸＸ         
+   | ＸＸ             
+   |                  
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ +-[ RECORD 1 ]---------------------------------+
+ | a | ＸＸ                                     |
+ |   |                                          |
+ | b |                                          |
+ | a | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     |
+ | b |                                          |
+ +-[ RECORD 2 ]---------------------------------+
+ | a | ＸＸＸＸ                                 |
+ |   | ＸＸＸＸＸＸ                             |
+ | b | ＸＸＸＸＸＸＸＸ                         |
+ |   | ＸＸＸＸＸＸＸＸＸＸ                     |
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸ                 |
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             |
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         |
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     |
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ |
+ | a | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ         |
+ | b | ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ             |
+ |   | ＸＸＸＸＸＸＸＸＸＸＸＸ                 |
+ |   | ＸＸＸＸＸＸＸＸＸＸ                     |
+ |   | ＸＸＸＸＸＸＸＸ                         |
+ |   | ＸＸＸＸＸＸ                             |
+ |   | ＸＸＸＸ                                 |
+ |   | ＸＸ                                     |
+ |   |                                          |
+ +---+------------------------------------------+
+ 
+ \pset format wrapped
+ execute q;
+ +-[ RECORD 1 ]-----+
+ | a | ＸＸ         |
+ |   |              |
+ | b |              |
+ | a | ＸＸＸＸＸＸ |
+ | b | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ +-[ RECORD 2 ]-----+
+ | a | ＸＸＸＸ     |
+ |   | ＸＸＸＸＸＸ |
+ | b | ＸＸＸＸＸＸ |
+ |   | ＸＸ         |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸ     |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸ         |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸ     |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸ         |
+ | a | ＸＸＸＸＸＸ |
+ | b | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸ     |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸ         |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸ     |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸ         |
+ |   | ＸＸＸＸＸＸ |
+ |   | ＸＸＸＸ     |
+ |   | ＸＸ         |
+ |   |              |
+ +---+--------------+
+ 
+ \pset linestyle unicode
+ \pset expanded off
+ \pset columns 40
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+                    a                    ↵                 a                  ↵
+                                         ↵                 b                   
+                    b                                                          
+ ──────────────────────────────────────── ────────────────────────────────────
+ ＸＸ                                     ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ                                ↵ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵
+ ＸＸＸＸＸＸ                            ↵ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵
+ ＸＸＸＸＸＸＸＸ                        ↵ＸＸＸＸＸＸＸＸＸＸＸＸ            ↵
+ ＸＸＸＸＸＸＸＸＸＸ                    ↵ＸＸＸＸＸＸＸＸＸＸ                ↵
+ ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵ＸＸＸＸＸＸＸＸ                    ↵
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵ＸＸＸＸＸＸ                        ↵
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵ＸＸＸＸ                            ↵
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵ＸＸ                                ↵
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+       a       ↵           a            ↵
+               ↵           b             
+       b                                 
+ ────────────── ────────────────────────
+ ＸＸ           ＸＸＸＸＸＸＸＸＸＸＸＸ…
+                ＸＸＸＸＸＸ
+ ＸＸＸＸ      ↵ＸＸＸＸＸＸＸＸＸＸＸＸ…
+ ＸＸＸＸＸＸ  ↵ＸＸＸＸ                ↵
+ ＸＸＸＸＸＸＸ…ＸＸＸＸＸＸＸＸＸＸＸＸ…
+ Ｘ            ↵ＸＸ                    ↵
+ ＸＸＸＸＸＸＸ…ＸＸＸＸＸＸＸＸＸＸＸＸ↵
+ ＸＸＸ        ↵ＸＸＸＸＸＸＸＸＸＸ    ↵
+ ＸＸＸＸＸＸＸ…ＸＸＸＸＸＸＸＸ        ↵
+ ＸＸＸＸＸ    ↵ＸＸＸＸＸＸ            ↵
+ ＸＸＸＸＸＸＸ…ＸＸＸＸ                ↵
+ ＸＸＸＸＸＸＸ↵ＸＸ                    ↵
+ ＸＸＸＸＸＸＸ…
+ ＸＸＸＸＸＸＸ…
+ ＸＸ          ↵
+ ＸＸＸＸＸＸＸ…
+ ＸＸＸＸＸＸＸ…
+ ＸＸＸＸ      ↵
+ ＸＸＸＸＸＸＸ…
+ ＸＸＸＸＸＸＸ…
+ ＸＸＸＸＸＸ   
+ (2 rows)
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+                     a                    ↵│                  a                  ↵
+                                          ↵│                  b                   
+                     b                     │                                      
+ ──────────────────────────────────────────┼──────────────────────────────────────
+  ＸＸ                                     │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+  ＸＸＸＸ                                ↵│ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵
+  ＸＸＸＸＸＸ                            ↵│ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵
+  ＸＸＸＸＸＸＸＸ                        ↵│ ＸＸＸＸＸＸＸＸＸＸＸＸ            ↵
+  ＸＸＸＸＸＸＸＸＸＸ                    ↵│ ＸＸＸＸＸＸＸＸＸＸ                ↵
+  ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵│ ＸＸＸＸＸＸＸＸ                    ↵
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵│ ＸＸＸＸＸＸ                        ↵
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵│ ＸＸＸＸ                            ↵
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵│ ＸＸ                                ↵
+  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ │ 
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+        a      ↵│           a           ↵
+               ↵│           b            
+        b       │                        
+ ───────────────┼────────────────────────
+  ＸＸ          │ ＸＸＸＸＸＸＸＸＸＸＸ…
+                │…ＸＸＸＸＸＸＸ
+  ＸＸＸＸ     ↵│ ＸＸＸＸＸＸＸＸＸＸＸ…
+  ＸＸＸＸＸＸ ↵│…ＸＸＸＸＸ            ↵
+  ＸＸＸＸＸＸ …│ ＸＸＸＸＸＸＸＸＸＸＸ…
+ …ＸＸ         ↵│…ＸＸＸ                ↵
+  ＸＸＸＸＸＸ …│ ＸＸＸＸＸＸＸＸＸＸＸ…
+ …ＸＸＸＸ     ↵│…Ｘ                    ↵
+  ＸＸＸＸＸＸ …│ ＸＸＸＸＸＸＸＸＸＸ  ↵
+ …ＸＸＸＸＸＸ ↵│ ＸＸＸＸＸＸＸＸ      ↵
+  ＸＸＸＸＸＸ …│ ＸＸＸＸＸＸ          ↵
+ …ＸＸＸＸＸＸ …│ ＸＸＸＸ              ↵
+ …ＸＸ         ↵│ ＸＸ                  ↵
+  ＸＸＸＸＸＸ …│ 
+ …ＸＸＸＸＸＸ …│ 
+ …ＸＸＸＸ     ↵│ 
+  ＸＸＸＸＸＸ …│ 
+ …ＸＸＸＸＸＸ …│ 
+ …ＸＸＸＸＸＸ ↵│ 
+  ＸＸＸＸＸＸ …│ 
+ …ＸＸＸＸＸＸ …│ 
+ …ＸＸＸＸＸＸ …│ 
+ …ＸＸ          │ 
+ (2 rows)
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|a
+ b
+ ＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ (2 rows)
+ \pset format aligned
+ execute q;
+ ┌──────────────────────────────────────────┬──────────────────────────────────────┐
+ │                    a                    ↵│                  a                  ↵│
+ │                                         ↵│                  b                   │
+ │                    b                     │                                      │
+ ├──────────────────────────────────────────┼──────────────────────────────────────┤
+ │ ＸＸ                                     │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ │
+ │ ＸＸＸＸ                                ↵│ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵│
+ │ ＸＸＸＸＸＸ                            ↵│ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵│
+ │ ＸＸＸＸＸＸＸＸ                        ↵│ ＸＸＸＸＸＸＸＸＸＸＸＸ            ↵│
+ │ ＸＸＸＸＸＸＸＸＸＸ                    ↵│ ＸＸＸＸＸＸＸＸＸＸ                ↵│
+ │ ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵│ ＸＸＸＸＸＸＸＸ                    ↵│
+ │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵│ ＸＸＸＸＸＸ                        ↵│
+ │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵│ ＸＸＸＸ                            ↵│
+ │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵│ ＸＸ                                ↵│
+ │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ │                                      │
+ └──────────────────────────────────────────┴──────────────────────────────────────┘
+ (2 rows)
+ 
+ \pset format wrapped
+ execute q;
+ ┌──────────────┬───────────────────────┐
+ │      a      ↵│           a          ↵│
+ │             ↵│           b           │
+ │      b       │                       │
+ ├──────────────┼───────────────────────┤
+ │ ＸＸ         │ ＸＸＸＸＸＸＸＸＸＸ …│
+ │              │…ＸＸＸＸＸＸＸＸ      │
+ │ ＸＸＸＸ    ↵│ ＸＸＸＸＸＸＸＸＸＸ …│
+ │ ＸＸＸＸＸＸ↵│…ＸＸＸＸＸＸ         ↵│
+ │ ＸＸＸＸＸＸ…│ ＸＸＸＸＸＸＸＸＸＸ …│
+ │…ＸＸ        ↵│…ＸＸＸＸ             ↵│
+ │ ＸＸＸＸＸＸ…│ ＸＸＸＸＸＸＸＸＸＸ …│
+ │…ＸＸＸＸ    ↵│…ＸＸ                 ↵│
+ │ ＸＸＸＸＸＸ…│ ＸＸＸＸＸＸＸＸＸＸ ↵│
+ │…ＸＸＸＸＸＸ↵│ ＸＸＸＸＸＸＸＸ     ↵│
+ │ ＸＸＸＸＸＸ…│ ＸＸＸＸＸＸ         ↵│
+ │…ＸＸＸＸＸＸ…│ ＸＸＸＸ             ↵│
+ │…ＸＸ        ↵│ ＸＸ                 ↵│
+ │ ＸＸＸＸＸＸ…│                       │
+ │…ＸＸＸＸＸＸ…│                       │
+ │…ＸＸＸＸ    ↵│                       │
+ │ ＸＸＸＸＸＸ…│                       │
+ │…ＸＸＸＸＸＸ…│                       │
+ │…ＸＸＸＸＸＸ↵│                       │
+ │ ＸＸＸＸＸＸ…│                       │
+ │…ＸＸＸＸＸＸ…│                       │
+ │…ＸＸＸＸＸＸ…│                       │
+ │…ＸＸ         │                       │
+ └──────────────┴───────────────────────┘
+ (2 rows)
+ 
+ \pset expanded on
+ \pset columns 20
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ * Record 1                               
+ a↵ ＸＸ                                     
+  ↵
+ b 
+ a↵ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+ b 
+ * Record 2                               
+ a↵ ＸＸＸＸ                                ↵
+  ↵ ＸＸＸＸＸＸ                            ↵
+ b  ＸＸＸＸＸＸＸＸ                        ↵
+    ＸＸＸＸＸＸＸＸＸＸ                    ↵
+    ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵
+    ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ a↵ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵
+ b  ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵
+    ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵
+    ＸＸＸＸＸＸＸＸＸＸ                    ↵
+    ＸＸＸＸＸＸＸＸ                        ↵
+    ＸＸＸＸＸＸ                            ↵
+    ＸＸＸＸ                                ↵
+    ＸＸ                                    ↵
+                                             
+ 
+ \pset format wrapped
+ execute q;
+ * Record 1         
+ a↵ ＸＸ               
+  ↵
+ b 
+ a↵ ＸＸＸＸＸＸＸＸＸ…
+ b …ＸＸＸＸＸＸＸＸＸ 
+ * Record 2         
+ a↵ ＸＸＸＸ          ↵
+  ↵ ＸＸＸＸＸＸ      ↵
+ b  ＸＸＸＸＸＸＸＸ  ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …Ｘ                ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …ＸＸＸ            ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …ＸＸＸＸＸ        ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …ＸＸＸＸＸＸＸ    ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …ＸＸＸＸＸＸＸＸＸ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …ＸＸＸＸＸＸＸＸＸ…
+   …ＸＸ               
+ a↵ ＸＸＸＸＸＸＸＸＸ…
+ b …ＸＸＸＸＸＸＸ    ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …ＸＸＸＸＸ        ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …ＸＸＸ            ↵
+    ＸＸＸＸＸＸＸＸＸ…
+   …Ｘ                ↵
+    ＸＸＸＸＸＸＸＸ  ↵
+    ＸＸＸＸＸＸ      ↵
+    ＸＸＸＸ          ↵
+    ＸＸ              ↵
+                       
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ ─[ RECORD 1 ]───────────────────────────────
+ a↵│ ＸＸ                                     
+  ↵│
+ b │
+ a↵│ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     
+ b │
+ ─[ RECORD 2 ]───────────────────────────────
+ a↵│ ＸＸＸＸ                                ↵
+  ↵│ ＸＸＸＸＸＸ                            ↵
+ b │ ＸＸＸＸＸＸＸＸ                        ↵
+   │ ＸＸＸＸＸＸＸＸＸＸ                    ↵
+   │ ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵
+   │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵
+   │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵
+   │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵
+   │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ 
+ a↵│ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵
+ b │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵
+   │ ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵
+   │ ＸＸＸＸＸＸＸＸＸＸ                    ↵
+   │ ＸＸＸＸＸＸＸＸ                        ↵
+   │ ＸＸＸＸＸＸ                            ↵
+   │ ＸＸＸＸ                                ↵
+   │ ＸＸ                                    ↵
+   │                                          
+ 
+ \pset format wrapped
+ execute q;
+ ─[ RECORD 1 ]───────
+ a↵│ ＸＸ             
+  ↵│
+ b │
+ a↵│ ＸＸＸＸＸＸＸＸ…
+ b │…ＸＸＸＸＸＸＸＸ…
+   │…ＸＸ             
+ ─[ RECORD 2 ]───────
+ a↵│ ＸＸＸＸ        ↵
+  ↵│ ＸＸＸＸＸＸ    ↵
+ b │ ＸＸＸＸＸＸＸＸ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸ            ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸＸＸ        ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸＸＸＸＸ    ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸＸＸＸＸＸＸ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸＸＸＸＸＸＸ…
+   │…ＸＸ            ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸＸＸＸＸＸＸ…
+   │…ＸＸＸＸ         
+ a↵│ ＸＸＸＸＸＸＸＸ…
+ b │…ＸＸＸＸＸＸＸＸ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸＸＸＸＸ    ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸＸＸ        ↵
+   │ ＸＸＸＸＸＸＸＸ…
+   │…ＸＸ            ↵
+   │ ＸＸＸＸＸＸＸＸ↵
+   │ ＸＸＸＸＸＸ    ↵
+   │ ＸＸＸＸ        ↵
+   │ ＸＸ            ↵
+   │                  
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ a
+ 
+ b|ＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ 
+ a
+ 
+ b|ＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ a
+ b|ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸＸＸ
+ ＸＸＸＸＸＸ
+ ＸＸＸＸ
+ ＸＸ
+ 
+ \pset format aligned
+ execute q;
+ ┌─[ RECORD 1 ]─────────────────────────────────┐
+ │ a↵│ ＸＸ                                     │
+ │  ↵│                                          │
+ │ b │                                          │
+ │ a↵│ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ     │
+ │ b │                                          │
+ ├─[ RECORD 2 ]─────────────────────────────────┤
+ │ a↵│ ＸＸＸＸ                                ↵│
+ │  ↵│ ＸＸＸＸＸＸ                            ↵│
+ │ b │ ＸＸＸＸＸＸＸＸ                        ↵│
+ │   │ ＸＸＸＸＸＸＸＸＸＸ                    ↵│
+ │   │ ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵│
+ │   │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵│
+ │   │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵│
+ │   │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ    ↵│
+ │   │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ │
+ │ a↵│ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸＸ        ↵│
+ │ b │ ＸＸＸＸＸＸＸＸＸＸＸＸＸＸ            ↵│
+ │   │ ＸＸＸＸＸＸＸＸＸＸＸＸ                ↵│
+ │   │ ＸＸＸＸＸＸＸＸＸＸ                    ↵│
+ │   │ ＸＸＸＸＸＸＸＸ                        ↵│
+ │   │ ＸＸＸＸＸＸ                            ↵│
+ │   │ ＸＸＸＸ                                ↵│
+ │   │ ＸＸ                                    ↵│
+ │   │                                          │
+ └───┴──────────────────────────────────────────┘
+ 
+ \pset format wrapped
+ execute q;
+ ┌─[ RECORD 1 ]─────┐
+ │ a↵│ ＸＸ         │
+ │  ↵│              │
+ │ b │              │
+ │ a↵│ ＸＸＸＸＸＸ…│
+ │ b │…ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ │
+ ├─[ RECORD 2 ]─────┤
+ │ a↵│ ＸＸＸＸ    ↵│
+ │  ↵│ ＸＸＸＸＸＸ↵│
+ │ b │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸ        ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸ    ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ…│
+ │   │…ＸＸ        ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸ    ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ…│
+ │   │…ＸＸ         │
+ │ a↵│ ＸＸＸＸＸＸ…│
+ │ b │…ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸ    ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ…│
+ │   │…ＸＸ        ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸＸＸ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸＸＸ    ↵│
+ │   │ ＸＸＸＸＸＸ…│
+ │   │…ＸＸ        ↵│
+ │   │ ＸＸＸＸＸＸ↵│
+ │   │ ＸＸＸＸ    ↵│
+ │   │ ＸＸ        ↵│
+ │   │              │
+ └───┴──────────────┘
+ 
+ deallocate q;
*** a/src/test/regress/sql/psql.sql
--- b/src/test/regress/sql/psql.sql
***************
*** 40,42 **** select 10 as test01, 20 as test02 from generate_series(1,0) \gset
--- 40,406 ----
  
  -- show all pset options
  \pset
+ 
+ -- test multi-line headers, wrapping, and newline indicators
+ prepare q as select array_to_string(array_agg(repeat('x',2*n)),E'\n') as "a
+ 
+ b", array_to_string(array_agg(repeat('y',20-2*n)),E'\n') as "a
+ b" from generate_series(1,10) as n(n) group by n>1 ;
+ 
+ \pset linestyle ascii
+ 
+ \pset expanded off
+ \pset columns 40
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset expanded on
+ \pset columns 20
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset linestyle old-ascii
+ 
+ \pset expanded off
+ \pset columns 40
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset expanded on
+ \pset columns 20
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset linestyle unicode
+ 
+ \pset expanded off
+ \pset columns 40
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset expanded on
+ \pset columns 20
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ 
+ deallocate q;
+ 
+ 
+ -- Do it all over again with a utf character
+ \encoding unicode
+ 
+ prepare q as select array_to_string(array_agg(repeat(convert_from('\xEFBCB8'::bytea,'utf-8'),2*n)),E'\n') as "a
+ 
+ b", array_to_string(array_agg(repeat(convert_from('\xEFBCB8'::bytea,'utf-8'),20-2*n)),E'\n') as "a
+ b" from generate_series(1,10) as n(n) group by n>1 ;
+ 
+ \pset linestyle ascii
+ 
+ \pset expanded off
+ \pset columns 40
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset expanded on
+ \pset columns 20
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ -- old-ascii has a number of disadvantages and should probably be
+ -- removed. When reading this output keep in mind that old-ascii
+ -- doesn't show wrapping on the right-most column (because it uses the
+ -- "right" border style not the "mid" border style) and that we don't
+ -- bother with old-ascii divider markings on headers since we never
+ -- wrap them anwyays so they would always show the newline marker.
+ 
+ \pset linestyle old-ascii
+ 
+ \pset expanded off
+ \pset columns 40
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset expanded on
+ \pset columns 20
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset linestyle unicode
+ 
+ \pset expanded off
+ \pset columns 40
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset expanded on
+ \pset columns 20
+ 
+ \pset border 0
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 1
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ \pset border 2
+ \pset format unaligned
+ execute q;
+ \pset format aligned
+ execute q;
+ \pset format wrapped
+ execute q;
+ 
+ 
+ deallocate q;
