]> granicus.if.org Git - postgresql/blob - src/test/regress/expected/psql.out
d602aeef4219a7a2f088879bdbac65795a39ae28
[postgresql] / src / test / regress / expected / psql.out
1 --
2 -- Tests for psql features that aren't closely connected to any
3 -- specific server features
4 --
5 -- \set
6 -- fail: invalid name
7 \set invalid/name foo
8 invalid variable name: "invalid/name"
9 -- fail: invalid value for special variable
10 \set AUTOCOMMIT foo
11 unrecognized value "foo" for "AUTOCOMMIT": boolean expected
12 \set FETCH_COUNT foo
13 invalid value "foo" for "FETCH_COUNT": integer expected
14 -- check handling of built-in boolean variable
15 \echo :ON_ERROR_ROLLBACK
16 off
17 \set ON_ERROR_ROLLBACK
18 \echo :ON_ERROR_ROLLBACK
19 on
20 \set ON_ERROR_ROLLBACK foo
21 unrecognized value "foo" for "ON_ERROR_ROLLBACK"
22 Available values are: on, off, interactive.
23 \echo :ON_ERROR_ROLLBACK
24 on
25 \set ON_ERROR_ROLLBACK on
26 \echo :ON_ERROR_ROLLBACK
27 on
28 \unset ON_ERROR_ROLLBACK
29 \echo :ON_ERROR_ROLLBACK
30 off
31 -- \g and \gx
32 SELECT 1 as one, 2 as two \g
33  one | two 
34 -----+-----
35    1 |   2
36 (1 row)
37
38 \gx
39 -[ RECORD 1 ]
40 one | 1
41 two | 2
42
43 SELECT 3 as three, 4 as four \gx
44 -[ RECORD 1 ]
45 three | 3
46 four  | 4
47
48 \g
49  three | four 
50 -------+------
51      3 |    4
52 (1 row)
53
54 -- \gset
55 select 10 as test01, 20 as test02, 'Hello' as test03 \gset pref01_
56 \echo :pref01_test01 :pref01_test02 :pref01_test03
57 10 20 Hello
58 -- should fail: bad variable name
59 select 10 as "bad name"
60 \gset
61 invalid variable name: "bad name"
62 -- multiple backslash commands in one line
63 select 1 as x, 2 as y \gset pref01_ \\ \echo :pref01_x
64 1
65 select 3 as x, 4 as y \gset pref01_ \echo :pref01_x \echo :pref01_y
66 3
67 4
68 select 5 as x, 6 as y \gset pref01_ \\ \g \echo :pref01_x :pref01_y
69  x | y 
70 ---+---
71  5 | 6
72 (1 row)
73
74 5 6
75 select 7 as x, 8 as y \g \gset pref01_ \echo :pref01_x :pref01_y
76  x | y 
77 ---+---
78  7 | 8
79 (1 row)
80
81 7 8
82 -- NULL should unset the variable
83 \set var2 xyz
84 select 1 as var1, NULL as var2, 3 as var3 \gset
85 \echo :var1 :var2 :var3
86 1 :var2 3
87 -- \gset requires just one tuple
88 select 10 as test01, 20 as test02 from generate_series(1,3) \gset
89 more than one row returned for \gset
90 select 10 as test01, 20 as test02 from generate_series(1,0) \gset
91 no rows returned for \gset
92 -- \gset should work in FETCH_COUNT mode too
93 \set FETCH_COUNT 1
94 select 1 as x, 2 as y \gset pref01_ \\ \echo :pref01_x
95 1
96 select 3 as x, 4 as y \gset pref01_ \echo :pref01_x \echo :pref01_y
97 3
98 4
99 select 10 as test01, 20 as test02 from generate_series(1,3) \gset
100 more than one row returned for \gset
101 select 10 as test01, 20 as test02 from generate_series(1,0) \gset
102 no rows returned for \gset
103 \unset FETCH_COUNT
104 -- \gexec
105 create temporary table gexec_test(a int, b text, c date, d float);
106 select format('create index on gexec_test(%I)', attname)
107 from pg_attribute
108 where attrelid = 'gexec_test'::regclass and attnum > 0
109 order by attnum
110 \gexec
111 create index on gexec_test(a)
112 create index on gexec_test(b)
113 create index on gexec_test(c)
114 create index on gexec_test(d)
115 -- \gexec should work in FETCH_COUNT mode too
116 -- (though the fetch limit applies to the executed queries not the meta query)
117 \set FETCH_COUNT 1
118 select 'select 1 as ones', 'select x.y, x.y*2 as double from generate_series(1,4) as x(y)'
119 union all
120 select 'drop table gexec_test', NULL
121 union all
122 select 'drop table gexec_test', 'select ''2000-01-01''::date as party_over'
123 \gexec
124 select 1 as ones
125  ones 
126 ------
127     1
128 (1 row)
129
130 select x.y, x.y*2 as double from generate_series(1,4) as x(y)
131  y | double 
132 ---+--------
133  1 |      2
134  2 |      4
135  3 |      6
136  4 |      8
137 (4 rows)
138
139 drop table gexec_test
140 drop table gexec_test
141 ERROR:  table "gexec_test" does not exist
142 select '2000-01-01'::date as party_over
143  party_over 
144 ------------
145  01-01-2000
146 (1 row)
147
148 \unset FETCH_COUNT
149 -- show all pset options
150 \pset
151 border                   1
152 columns                  0
153 expanded                 off
154 fieldsep                 '|'
155 fieldsep_zero            off
156 footer                   on
157 format                   aligned
158 linestyle                ascii
159 null                     ''
160 numericlocale            off
161 pager                    1
162 pager_min_lines          0
163 recordsep                '\n'
164 recordsep_zero           off
165 tableattr                
166 title                    
167 tuples_only              off
168 unicode_border_linestyle single
169 unicode_column_linestyle single
170 unicode_header_linestyle single
171 -- test multi-line headers, wrapping, and newline indicators
172 prepare q as select array_to_string(array_agg(repeat('x',2*n)),E'\n') as "ab
173
174 c", array_to_string(array_agg(repeat('y',20-2*n)),E'\n') as "a
175 bc" from generate_series(1,10) as n(n) group by n>1 order by n>1;
176 \pset linestyle ascii
177 \pset expanded off
178 \pset columns 40
179 \pset border 0
180 \pset format unaligned
181 execute q;
182 ab
183
184 c|a
185 bc
186 xx|yyyyyyyyyyyyyyyyyy
187 xxxx
188 xxxxxx
189 xxxxxxxx
190 xxxxxxxxxx
191 xxxxxxxxxxxx
192 xxxxxxxxxxxxxx
193 xxxxxxxxxxxxxxxx
194 xxxxxxxxxxxxxxxxxx
195 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
196 yyyyyyyyyyyyyy
197 yyyyyyyyyyyy
198 yyyyyyyyyy
199 yyyyyyyy
200 yyyyyy
201 yyyy
202 yy
203
204 (2 rows)
205 \pset format aligned
206 execute q;
207          ab         +        a         +
208                     +        bc         
209          c                              
210 -------------------- ------------------
211 xx                   yyyyyyyyyyyyyyyyyy
212 xxxx                +yyyyyyyyyyyyyyyy  +
213 xxxxxx              +yyyyyyyyyyyyyy    +
214 xxxxxxxx            +yyyyyyyyyyyy      +
215 xxxxxxxxxx          +yyyyyyyyyy        +
216 xxxxxxxxxxxx        +yyyyyyyy          +
217 xxxxxxxxxxxxxx      +yyyyyy            +
218 xxxxxxxxxxxxxxxx    +yyyy              +
219 xxxxxxxxxxxxxxxxxx  +yy                +
220 xxxxxxxxxxxxxxxxxxxx 
221 (2 rows)
222
223 \pset format wrapped
224 execute q;
225          ab         +        a         +
226                     +        bc         
227          c                              
228 -------------------- ------------------
229 xx                   yyyyyyyyyyyyyyyyyy
230 xxxx                +yyyyyyyyyyyyyyyy  +
231 xxxxxx              +yyyyyyyyyyyyyy    +
232 xxxxxxxx            +yyyyyyyyyyyy      +
233 xxxxxxxxxx          +yyyyyyyyyy        +
234 xxxxxxxxxxxx        +yyyyyyyy          +
235 xxxxxxxxxxxxxx      +yyyyyy            +
236 xxxxxxxxxxxxxxxx    +yyyy              +
237 xxxxxxxxxxxxxxxxxx  +yy                +
238 xxxxxxxxxxxxxxxxxxxx 
239 (2 rows)
240
241 \pset border 1
242 \pset format unaligned
243 execute q;
244 ab
245
246 c|a
247 bc
248 xx|yyyyyyyyyyyyyyyyyy
249 xxxx
250 xxxxxx
251 xxxxxxxx
252 xxxxxxxxxx
253 xxxxxxxxxxxx
254 xxxxxxxxxxxxxx
255 xxxxxxxxxxxxxxxx
256 xxxxxxxxxxxxxxxxxx
257 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
258 yyyyyyyyyyyyyy
259 yyyyyyyyyyyy
260 yyyyyyyyyy
261 yyyyyyyy
262 yyyyyy
263 yyyy
264 yy
265
266 (2 rows)
267 \pset format aligned
268 execute q;
269           ab         +|         a         +
270                      +|         bc         
271           c           |                    
272 ----------------------+--------------------
273  xx                   | yyyyyyyyyyyyyyyyyy
274  xxxx                +| yyyyyyyyyyyyyyyy  +
275  xxxxxx              +| yyyyyyyyyyyyyy    +
276  xxxxxxxx            +| yyyyyyyyyyyy      +
277  xxxxxxxxxx          +| yyyyyyyyyy        +
278  xxxxxxxxxxxx        +| yyyyyyyy          +
279  xxxxxxxxxxxxxx      +| yyyyyy            +
280  xxxxxxxxxxxxxxxx    +| yyyy              +
281  xxxxxxxxxxxxxxxxxx  +| yy                +
282  xxxxxxxxxxxxxxxxxxxx | 
283 (2 rows)
284
285 \pset format wrapped
286 execute q;
287         ab        +|         a         +
288                   +|         bc         
289          c         |                    
290 -------------------+--------------------
291  xx                | yyyyyyyyyyyyyyyyyy
292  xxxx             +| yyyyyyyyyyyyyyyy  +
293  xxxxxx           +| yyyyyyyyyyyyyy    +
294  xxxxxxxx         +| yyyyyyyyyyyy      +
295  xxxxxxxxxx       +| yyyyyyyyyy        +
296  xxxxxxxxxxxx     +| yyyyyyyy          +
297  xxxxxxxxxxxxxx   +| yyyyyy            +
298  xxxxxxxxxxxxxxxx +| yyyy              +
299  xxxxxxxxxxxxxxxxx.| yy                +
300 .x                +| 
301  xxxxxxxxxxxxxxxxx.| 
302 .xxx               | 
303 (2 rows)
304
305 \pset border 2
306 \pset format unaligned
307 execute q;
308 ab
309
310 c|a
311 bc
312 xx|yyyyyyyyyyyyyyyyyy
313 xxxx
314 xxxxxx
315 xxxxxxxx
316 xxxxxxxxxx
317 xxxxxxxxxxxx
318 xxxxxxxxxxxxxx
319 xxxxxxxxxxxxxxxx
320 xxxxxxxxxxxxxxxxxx
321 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
322 yyyyyyyyyyyyyy
323 yyyyyyyyyyyy
324 yyyyyyyyyy
325 yyyyyyyy
326 yyyyyy
327 yyyy
328 yy
329
330 (2 rows)
331 \pset format aligned
332 execute q;
333 +----------------------+--------------------+
334 |          ab         +|         a         +|
335 |                     +|         bc         |
336 |          c           |                    |
337 +----------------------+--------------------+
338 | xx                   | yyyyyyyyyyyyyyyyyy |
339 | xxxx                +| yyyyyyyyyyyyyyyy  +|
340 | xxxxxx              +| yyyyyyyyyyyyyy    +|
341 | xxxxxxxx            +| yyyyyyyyyyyy      +|
342 | xxxxxxxxxx          +| yyyyyyyyyy        +|
343 | xxxxxxxxxxxx        +| yyyyyyyy          +|
344 | xxxxxxxxxxxxxx      +| yyyyyy            +|
345 | xxxxxxxxxxxxxxxx    +| yyyy              +|
346 | xxxxxxxxxxxxxxxxxx  +| yy                +|
347 | xxxxxxxxxxxxxxxxxxxx |                    |
348 +----------------------+--------------------+
349 (2 rows)
350
351 \pset format wrapped
352 execute q;
353 +-----------------+--------------------+
354 |       ab       +|         a         +|
355 |                +|         bc         |
356 |        c        |                    |
357 +-----------------+--------------------+
358 | xx              | yyyyyyyyyyyyyyyyyy |
359 | xxxx           +| yyyyyyyyyyyyyyyy  +|
360 | xxxxxx         +| yyyyyyyyyyyyyy    +|
361 | xxxxxxxx       +| yyyyyyyyyyyy      +|
362 | xxxxxxxxxx     +| yyyyyyyyyy        +|
363 | xxxxxxxxxxxx   +| yyyyyyyy          +|
364 | xxxxxxxxxxxxxx +| yyyyyy            +|
365 | xxxxxxxxxxxxxxx.| yyyy              +|
366 |.x              +| yy                +|
367 | xxxxxxxxxxxxxxx.|                    |
368 |.xxx            +|                    |
369 | xxxxxxxxxxxxxxx.|                    |
370 |.xxxxx           |                    |
371 +-----------------+--------------------+
372 (2 rows)
373
374 \pset expanded on
375 \pset columns 20
376 \pset border 0
377 \pset format unaligned
378 execute q;
379 ab
380
381 c|xx
382 a
383 bc|yyyyyyyyyyyyyyyyyy
384
385 ab
386
387 c|xxxx
388 xxxxxx
389 xxxxxxxx
390 xxxxxxxxxx
391 xxxxxxxxxxxx
392 xxxxxxxxxxxxxx
393 xxxxxxxxxxxxxxxx
394 xxxxxxxxxxxxxxxxxx
395 xxxxxxxxxxxxxxxxxxxx
396 a
397 bc|yyyyyyyyyyyyyyyy
398 yyyyyyyyyyyyyy
399 yyyyyyyyyyyy
400 yyyyyyyyyy
401 yyyyyyyy
402 yyyyyy
403 yyyy
404 yy
405
406 \pset format aligned
407 execute q;
408 * Record 1            
409 ab+ xx
410   +
411 c  
412 a + yyyyyyyyyyyyyyyyyy
413 bc 
414 * Record 2            
415 ab+ xxxx                +
416   + xxxxxx              +
417 c   xxxxxxxx            +
418     xxxxxxxxxx          +
419     xxxxxxxxxxxx        +
420     xxxxxxxxxxxxxx      +
421     xxxxxxxxxxxxxxxx    +
422     xxxxxxxxxxxxxxxxxx  +
423     xxxxxxxxxxxxxxxxxxxx
424 a + yyyyyyyyyyyyyyyy    +
425 bc  yyyyyyyyyyyyyy      +
426     yyyyyyyyyyyy        +
427     yyyyyyyyyy          +
428     yyyyyyyy            +
429     yyyyyy              +
430     yyyy                +
431     yy                  +
432     
433
434 \pset format wrapped
435 execute q;
436 * Record 1       
437 ab+ xx
438   +
439 c  
440 a + yyyyyyyyyyyyyyy.
441 bc .yyy
442 * Record 2       
443 ab+ xxxx           +
444   + xxxxxx         +
445 c   xxxxxxxx       +
446     xxxxxxxxxx     +
447     xxxxxxxxxxxx   +
448     xxxxxxxxxxxxxx +
449     xxxxxxxxxxxxxxx.
450    .x              +
451     xxxxxxxxxxxxxxx.
452    .xxx            +
453     xxxxxxxxxxxxxxx.
454    .xxxxx
455 a + yyyyyyyyyyyyyyy.
456 bc .y              +
457     yyyyyyyyyyyyyy +
458     yyyyyyyyyyyy   +
459     yyyyyyyyyy     +
460     yyyyyyyy       +
461     yyyyyy         +
462     yyyy           +
463     yy             +
464     
465
466 \pset border 1
467 \pset format unaligned
468 execute q;
469 ab
470
471 c|xx
472 a
473 bc|yyyyyyyyyyyyyyyyyy
474
475 ab
476
477 c|xxxx
478 xxxxxx
479 xxxxxxxx
480 xxxxxxxxxx
481 xxxxxxxxxxxx
482 xxxxxxxxxxxxxx
483 xxxxxxxxxxxxxxxx
484 xxxxxxxxxxxxxxxxxx
485 xxxxxxxxxxxxxxxxxxxx
486 a
487 bc|yyyyyyyyyyyyyyyy
488 yyyyyyyyyyyyyy
489 yyyyyyyyyyyy
490 yyyyyyyyyy
491 yyyyyyyy
492 yyyyyy
493 yyyy
494 yy
495
496 \pset format aligned
497 execute q;
498 -[ RECORD 1 ]------------
499 ab+| xx
500   +|
501 c  |
502 a +| yyyyyyyyyyyyyyyyyy
503 bc |
504 -[ RECORD 2 ]------------
505 ab+| xxxx                +
506   +| xxxxxx              +
507 c  | xxxxxxxx            +
508    | xxxxxxxxxx          +
509    | xxxxxxxxxxxx        +
510    | xxxxxxxxxxxxxx      +
511    | xxxxxxxxxxxxxxxx    +
512    | xxxxxxxxxxxxxxxxxx  +
513    | xxxxxxxxxxxxxxxxxxxx
514 a +| yyyyyyyyyyyyyyyy    +
515 bc | yyyyyyyyyyyyyy      +
516    | yyyyyyyyyyyy        +
517    | yyyyyyyyyy          +
518    | yyyyyyyy            +
519    | yyyyyy              +
520    | yyyy                +
521    | yy                  +
522    | 
523
524 \pset format wrapped
525 execute q;
526 -[ RECORD 1 ]------
527 ab+| xx
528   +|
529 c  |
530 a +| yyyyyyyyyyyyyy.
531 bc |.yyyy
532 -[ RECORD 2 ]------
533 ab+| xxxx          +
534   +| xxxxxx        +
535 c  | xxxxxxxx      +
536    | xxxxxxxxxx    +
537    | xxxxxxxxxxxx  +
538    | xxxxxxxxxxxxxx+
539    | xxxxxxxxxxxxxx.
540    |.xx            +
541    | xxxxxxxxxxxxxx.
542    |.xxxx          +
543    | xxxxxxxxxxxxxx.
544    |.xxxxxx
545 a +| yyyyyyyyyyyyyy.
546 bc |.yy            +
547    | yyyyyyyyyyyyyy+
548    | yyyyyyyyyyyy  +
549    | yyyyyyyyyy    +
550    | yyyyyyyy      +
551    | yyyyyy        +
552    | yyyy          +
553    | yy            +
554    | 
555
556 \pset border 2
557 \pset format unaligned
558 execute q;
559 ab
560
561 c|xx
562 a
563 bc|yyyyyyyyyyyyyyyyyy
564
565 ab
566
567 c|xxxx
568 xxxxxx
569 xxxxxxxx
570 xxxxxxxxxx
571 xxxxxxxxxxxx
572 xxxxxxxxxxxxxx
573 xxxxxxxxxxxxxxxx
574 xxxxxxxxxxxxxxxxxx
575 xxxxxxxxxxxxxxxxxxxx
576 a
577 bc|yyyyyyyyyyyyyyyy
578 yyyyyyyyyyyyyy
579 yyyyyyyyyyyy
580 yyyyyyyyyy
581 yyyyyyyy
582 yyyyyy
583 yyyy
584 yy
585
586 \pset format aligned
587 execute q;
588 +-[ RECORD 1 ]--------------+
589 | ab+| xx                   |
590 |   +|                      |
591 | c  |                      |
592 | a +| yyyyyyyyyyyyyyyyyy   |
593 | bc |                      |
594 +-[ RECORD 2 ]--------------+
595 | ab+| xxxx                +|
596 |   +| xxxxxx              +|
597 | c  | xxxxxxxx            +|
598 |    | xxxxxxxxxx          +|
599 |    | xxxxxxxxxxxx        +|
600 |    | xxxxxxxxxxxxxx      +|
601 |    | xxxxxxxxxxxxxxxx    +|
602 |    | xxxxxxxxxxxxxxxxxx  +|
603 |    | xxxxxxxxxxxxxxxxxxxx |
604 | a +| yyyyyyyyyyyyyyyy    +|
605 | bc | yyyyyyyyyyyyyy      +|
606 |    | yyyyyyyyyyyy        +|
607 |    | yyyyyyyyyy          +|
608 |    | yyyyyyyy            +|
609 |    | yyyyyy              +|
610 |    | yyyy                +|
611 |    | yy                  +|
612 |    |                      |
613 +----+----------------------+
614
615 \pset format wrapped
616 execute q;
617 +-[ RECORD 1 ]-----+
618 | ab+| xx          |
619 |   +|             |
620 | c  |             |
621 | a +| yyyyyyyyyyy.|
622 | bc |.yyyyyyy     |
623 +-[ RECORD 2 ]-----+
624 | ab+| xxxx       +|
625 |   +| xxxxxx     +|
626 | c  | xxxxxxxx   +|
627 |    | xxxxxxxxxx +|
628 |    | xxxxxxxxxxx.|
629 |    |.x          +|
630 |    | xxxxxxxxxxx.|
631 |    |.xxx        +|
632 |    | xxxxxxxxxxx.|
633 |    |.xxxxx      +|
634 |    | xxxxxxxxxxx.|
635 |    |.xxxxxxx    +|
636 |    | xxxxxxxxxxx.|
637 |    |.xxxxxxxxx   |
638 | a +| yyyyyyyyyyy.|
639 | bc |.yyyyy      +|
640 |    | yyyyyyyyyyy.|
641 |    |.yyy        +|
642 |    | yyyyyyyyyyy.|
643 |    |.y          +|
644 |    | yyyyyyyyyy +|
645 |    | yyyyyyyy   +|
646 |    | yyyyyy     +|
647 |    | yyyy       +|
648 |    | yy         +|
649 |    |             |
650 +----+-------------+
651
652 \pset linestyle old-ascii
653 \pset expanded off
654 \pset columns 40
655 \pset border 0
656 \pset format unaligned
657 execute q;
658 ab
659
660 c|a
661 bc
662 xx|yyyyyyyyyyyyyyyyyy
663 xxxx
664 xxxxxx
665 xxxxxxxx
666 xxxxxxxxxx
667 xxxxxxxxxxxx
668 xxxxxxxxxxxxxx
669 xxxxxxxxxxxxxxxx
670 xxxxxxxxxxxxxxxxxx
671 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
672 yyyyyyyyyyyyyy
673 yyyyyyyyyyyy
674 yyyyyyyyyy
675 yyyyyyyy
676 yyyyyy
677 yyyy
678 yy
679
680 (2 rows)
681 \pset format aligned
682 execute q;
683          ab                  a         
684                     +        bc        
685          c          +                  
686 -------------------- ------------------
687 xx                   yyyyyyyyyyyyyyyyyy
688 xxxx                 yyyyyyyyyyyyyyyy   
689 xxxxxx               yyyyyyyyyyyyyy     
690 xxxxxxxx             yyyyyyyyyyyy       
691 xxxxxxxxxx           yyyyyyyyyy         
692 xxxxxxxxxxxx         yyyyyyyy           
693 xxxxxxxxxxxxxx       yyyyyy             
694 xxxxxxxxxxxxxxxx     yyyy               
695 xxxxxxxxxxxxxxxxxx   yy                 
696 xxxxxxxxxxxxxxxxxxxx 
697 (2 rows)
698
699 \pset format wrapped
700 execute q;
701          ab                  a         
702                     +        bc        
703          c          +                  
704 -------------------- ------------------
705 xx                   yyyyyyyyyyyyyyyyyy
706 xxxx                 yyyyyyyyyyyyyyyy   
707 xxxxxx               yyyyyyyyyyyyyy     
708 xxxxxxxx             yyyyyyyyyyyy       
709 xxxxxxxxxx           yyyyyyyyyy         
710 xxxxxxxxxxxx         yyyyyyyy           
711 xxxxxxxxxxxxxx       yyyyyy             
712 xxxxxxxxxxxxxxxx     yyyy               
713 xxxxxxxxxxxxxxxxxx   yy                 
714 xxxxxxxxxxxxxxxxxxxx 
715 (2 rows)
716
717 \pset border 1
718 \pset format unaligned
719 execute q;
720 ab
721
722 c|a
723 bc
724 xx|yyyyyyyyyyyyyyyyyy
725 xxxx
726 xxxxxx
727 xxxxxxxx
728 xxxxxxxxxx
729 xxxxxxxxxxxx
730 xxxxxxxxxxxxxx
731 xxxxxxxxxxxxxxxx
732 xxxxxxxxxxxxxxxxxx
733 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
734 yyyyyyyyyyyyyy
735 yyyyyyyyyyyy
736 yyyyyyyyyy
737 yyyyyyyy
738 yyyyyy
739 yyyy
740 yy
741
742 (2 rows)
743 \pset format aligned
744 execute q;
745           ab          |         a          
746 +                     |+        bc         
747 +         c           |+                   
748 ----------------------+--------------------
749  xx                   | yyyyyyyyyyyyyyyyyy
750  xxxx                 | yyyyyyyyyyyyyyyy   
751  xxxxxx               : yyyyyyyyyyyyyy     
752  xxxxxxxx             : yyyyyyyyyyyy       
753  xxxxxxxxxx           : yyyyyyyyyy         
754  xxxxxxxxxxxx         : yyyyyyyy           
755  xxxxxxxxxxxxxx       : yyyyyy             
756  xxxxxxxxxxxxxxxx     : yyyy               
757  xxxxxxxxxxxxxxxxxx   : yy                 
758  xxxxxxxxxxxxxxxxxxxx : 
759 (2 rows)
760
761 \pset format wrapped
762 execute q;
763         ab         |         a          
764 +                  |+        bc         
765 +        c         |+                   
766 -------------------+--------------------
767  xx                | yyyyyyyyyyyyyyyyyy
768  xxxx              | yyyyyyyyyyyyyyyy   
769  xxxxxx            : yyyyyyyyyyyyyy     
770  xxxxxxxx          : yyyyyyyyyyyy       
771  xxxxxxxxxx        : yyyyyyyyyy         
772  xxxxxxxxxxxx      : yyyyyyyy           
773  xxxxxxxxxxxxxx    : yyyyyy             
774  xxxxxxxxxxxxxxxx  : yyyy               
775  xxxxxxxxxxxxxxxxx : yy                 
776  x                 : 
777  xxxxxxxxxxxxxxxxx   
778  xxx                 
779 (2 rows)
780
781 \pset border 2
782 \pset format unaligned
783 execute q;
784 ab
785
786 c|a
787 bc
788 xx|yyyyyyyyyyyyyyyyyy
789 xxxx
790 xxxxxx
791 xxxxxxxx
792 xxxxxxxxxx
793 xxxxxxxxxxxx
794 xxxxxxxxxxxxxx
795 xxxxxxxxxxxxxxxx
796 xxxxxxxxxxxxxxxxxx
797 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
798 yyyyyyyyyyyyyy
799 yyyyyyyyyyyy
800 yyyyyyyyyy
801 yyyyyyyy
802 yyyyyy
803 yyyy
804 yy
805
806 (2 rows)
807 \pset format aligned
808 execute q;
809 +----------------------+--------------------+
810 |          ab          |         a          |
811 |+                     |+        bc         |
812 |+         c           |+                   |
813 +----------------------+--------------------+
814 | xx                   | yyyyyyyyyyyyyyyyyy |
815 | xxxx                 | yyyyyyyyyyyyyyyy   |
816 | xxxxxx               : yyyyyyyyyyyyyy     |
817 | xxxxxxxx             : yyyyyyyyyyyy       |
818 | xxxxxxxxxx           : yyyyyyyyyy         |
819 | xxxxxxxxxxxx         : yyyyyyyy           |
820 | xxxxxxxxxxxxxx       : yyyyyy             |
821 | xxxxxxxxxxxxxxxx     : yyyy               |
822 | xxxxxxxxxxxxxxxxxx   : yy                 |
823 | xxxxxxxxxxxxxxxxxxxx :                    |
824 +----------------------+--------------------+
825 (2 rows)
826
827 \pset format wrapped
828 execute q;
829 +-----------------+--------------------+
830 |       ab        |         a          |
831 |+                |+        bc         |
832 |+       c        |+                   |
833 +-----------------+--------------------+
834 | xx              | yyyyyyyyyyyyyyyyyy |
835 | xxxx            | yyyyyyyyyyyyyyyy   |
836 | xxxxxx          : yyyyyyyyyyyyyy     |
837 | xxxxxxxx        : yyyyyyyyyyyy       |
838 | xxxxxxxxxx      : yyyyyyyyyy         |
839 | xxxxxxxxxxxx    : yyyyyyyy           |
840 | xxxxxxxxxxxxxx  : yyyyyy             |
841 | xxxxxxxxxxxxxxx : yyyy               |
842 | x               : yy                 |
843 | xxxxxxxxxxxxxxx :                    |
844 | xxx                                  |
845 | xxxxxxxxxxxxxxx                      |
846 | xxxxx                                |
847 +-----------------+--------------------+
848 (2 rows)
849
850 \pset expanded on
851 \pset columns 20
852 \pset border 0
853 \pset format unaligned
854 execute q;
855 ab
856
857 c|xx
858 a
859 bc|yyyyyyyyyyyyyyyyyy
860
861 ab
862
863 c|xxxx
864 xxxxxx
865 xxxxxxxx
866 xxxxxxxxxx
867 xxxxxxxxxxxx
868 xxxxxxxxxxxxxx
869 xxxxxxxxxxxxxxxx
870 xxxxxxxxxxxxxxxxxx
871 xxxxxxxxxxxxxxxxxxxx
872 a
873 bc|yyyyyyyyyyyyyyyy
874 yyyyyyyyyyyyyy
875 yyyyyyyyyyyy
876 yyyyyyyyyy
877 yyyyyyyy
878 yyyyyy
879 yyyy
880 yy
881
882 \pset format aligned
883 execute q;
884 * Record 1             
885  ab xx
886 +  
887 +c 
888  a  yyyyyyyyyyyyyyyyyy
889 +bc
890 * Record 2             
891  ab xxxx
892 +   xxxxxx
893 +c  xxxxxxxx
894     xxxxxxxxxx
895     xxxxxxxxxxxx
896     xxxxxxxxxxxxxx
897     xxxxxxxxxxxxxxxx
898     xxxxxxxxxxxxxxxxxx
899     xxxxxxxxxxxxxxxxxxxx
900  a  yyyyyyyyyyyyyyyy
901 +bc yyyyyyyyyyyyyy
902     yyyyyyyyyyyy
903     yyyyyyyyyy
904     yyyyyyyy
905     yyyyyy
906     yyyy
907     yy
908     
909
910 \pset format wrapped
911 execute q;
912 * Record 1         
913  ab xx
914 +  
915 +c 
916  a  yyyyyyyyyyyyyyyy
917 +bc yy
918 * Record 2         
919  ab xxxx
920 +   xxxxxx
921 +c  xxxxxxxx
922     xxxxxxxxxx
923     xxxxxxxxxxxx
924     xxxxxxxxxxxxxx
925     xxxxxxxxxxxxxxxx
926     xxxxxxxxxxxxxxxx
927     xx
928     xxxxxxxxxxxxxxxx
929     xxxx
930  a  yyyyyyyyyyyyyyyy
931 +bc yyyyyyyyyyyyyy
932     yyyyyyyyyyyy
933     yyyyyyyyyy
934     yyyyyyyy
935     yyyyyy
936     yyyy
937     yy
938     
939
940 \pset border 1
941 \pset format unaligned
942 execute q;
943 ab
944
945 c|xx
946 a
947 bc|yyyyyyyyyyyyyyyyyy
948
949 ab
950
951 c|xxxx
952 xxxxxx
953 xxxxxxxx
954 xxxxxxxxxx
955 xxxxxxxxxxxx
956 xxxxxxxxxxxxxx
957 xxxxxxxxxxxxxxxx
958 xxxxxxxxxxxxxxxxxx
959 xxxxxxxxxxxxxxxxxxxx
960 a
961 bc|yyyyyyyyyyyyyyyy
962 yyyyyyyyyyyyyy
963 yyyyyyyyyyyy
964 yyyyyyyyyy
965 yyyyyyyy
966 yyyyyy
967 yyyy
968 yy
969
970 \pset format aligned
971 execute q;
972 -[ RECORD 1 ]-------------
973  ab | xx
974 +   ;
975 +c  ;
976  a  | yyyyyyyyyyyyyyyyyy
977 +bc ;
978 -[ RECORD 2 ]-------------
979  ab | xxxx
980 +   : xxxxxx
981 +c  : xxxxxxxx
982     : xxxxxxxxxx
983     : xxxxxxxxxxxx
984     : xxxxxxxxxxxxxx
985     : xxxxxxxxxxxxxxxx
986     : xxxxxxxxxxxxxxxxxx
987     : xxxxxxxxxxxxxxxxxxxx
988  a  | yyyyyyyyyyyyyyyy
989 +bc : yyyyyyyyyyyyyy
990     : yyyyyyyyyyyy
991     : yyyyyyyyyy
992     : yyyyyyyy
993     : yyyyyy
994     : yyyy
995     : yy
996     : 
997
998 \pset format wrapped
999 execute q;
1000 -[ RECORD 1 ]-------
1001  ab | xx
1002 +   ;
1003 +c  ;
1004  a  | yyyyyyyyyyyyyy
1005 +bc ; yyyy
1006 -[ RECORD 2 ]-------
1007  ab | xxxx
1008 +   : xxxxxx
1009 +c  : xxxxxxxx
1010     : xxxxxxxxxx
1011     : xxxxxxxxxxxx
1012     : xxxxxxxxxxxxxx
1013     : xxxxxxxxxxxxxx
1014     ; xx
1015     : xxxxxxxxxxxxxx
1016     ; xxxx
1017     : xxxxxxxxxxxxxx
1018     ; xxxxxx
1019  a  | yyyyyyyyyyyyyy
1020 +bc ; yy
1021     : yyyyyyyyyyyyyy
1022     : yyyyyyyyyyyy
1023     : yyyyyyyyyy
1024     : yyyyyyyy
1025     : yyyyyy
1026     : yyyy
1027     : yy
1028     : 
1029
1030 \pset border 2
1031 \pset format unaligned
1032 execute q;
1033 ab
1034
1035 c|xx
1036 a
1037 bc|yyyyyyyyyyyyyyyyyy
1038
1039 ab
1040
1041 c|xxxx
1042 xxxxxx
1043 xxxxxxxx
1044 xxxxxxxxxx
1045 xxxxxxxxxxxx
1046 xxxxxxxxxxxxxx
1047 xxxxxxxxxxxxxxxx
1048 xxxxxxxxxxxxxxxxxx
1049 xxxxxxxxxxxxxxxxxxxx
1050 a
1051 bc|yyyyyyyyyyyyyyyy
1052 yyyyyyyyyyyyyy
1053 yyyyyyyyyyyy
1054 yyyyyyyyyy
1055 yyyyyyyy
1056 yyyyyy
1057 yyyy
1058 yy
1059
1060 \pset format aligned
1061 execute q;
1062 +-[ RECORD 1 ]--------------+
1063 | ab | xx                   |
1064 |+   ;                      |
1065 |+c  ;                      |
1066 | a  | yyyyyyyyyyyyyyyyyy   |
1067 |+bc ;                      |
1068 +-[ RECORD 2 ]--------------+
1069 | ab | xxxx                 |
1070 |+   : xxxxxx               |
1071 |+c  : xxxxxxxx             |
1072 |    : xxxxxxxxxx           |
1073 |    : xxxxxxxxxxxx         |
1074 |    : xxxxxxxxxxxxxx       |
1075 |    : xxxxxxxxxxxxxxxx     |
1076 |    : xxxxxxxxxxxxxxxxxx   |
1077 |    : xxxxxxxxxxxxxxxxxxxx |
1078 | a  | yyyyyyyyyyyyyyyy     |
1079 |+bc : yyyyyyyyyyyyyy       |
1080 |    : yyyyyyyyyyyy         |
1081 |    : yyyyyyyyyy           |
1082 |    : yyyyyyyy             |
1083 |    : yyyyyy               |
1084 |    : yyyy                 |
1085 |    : yy                   |
1086 |    :                      |
1087 +----+----------------------+
1088
1089 \pset format wrapped
1090 execute q;
1091 +-[ RECORD 1 ]-----+
1092 | ab | xx          |
1093 |+   ;             |
1094 |+c  ;             |
1095 | a  | yyyyyyyyyyy |
1096 |+bc ; yyyyyyy     |
1097 +-[ RECORD 2 ]-----+
1098 | ab | xxxx        |
1099 |+   : xxxxxx      |
1100 |+c  : xxxxxxxx    |
1101 |    : xxxxxxxxxx  |
1102 |    : xxxxxxxxxxx |
1103 |    ; x           |
1104 |    : xxxxxxxxxxx |
1105 |    ; xxx         |
1106 |    : xxxxxxxxxxx |
1107 |    ; xxxxx       |
1108 |    : xxxxxxxxxxx |
1109 |    ; xxxxxxx     |
1110 |    : xxxxxxxxxxx |
1111 |    ; xxxxxxxxx   |
1112 | a  | yyyyyyyyyyy |
1113 |+bc ; yyyyy       |
1114 |    : yyyyyyyyyyy |
1115 |    ; yyy         |
1116 |    : yyyyyyyyyyy |
1117 |    ; y           |
1118 |    : yyyyyyyyyy  |
1119 |    : yyyyyyyy    |
1120 |    : yyyyyy      |
1121 |    : yyyy        |
1122 |    : yy          |
1123 |    :             |
1124 +----+-------------+
1125
1126 deallocate q;
1127 -- test single-line header and data
1128 prepare q as select repeat('x',2*n) as "0123456789abcdef", repeat('y',20-2*n) as "0123456789" from generate_series(1,10) as n;
1129 \pset linestyle ascii
1130 \pset expanded off
1131 \pset columns 40
1132 \pset border 0
1133 \pset format unaligned
1134 execute q;
1135 0123456789abcdef|0123456789
1136 xx|yyyyyyyyyyyyyyyyyy
1137 xxxx|yyyyyyyyyyyyyyyy
1138 xxxxxx|yyyyyyyyyyyyyy
1139 xxxxxxxx|yyyyyyyyyyyy
1140 xxxxxxxxxx|yyyyyyyyyy
1141 xxxxxxxxxxxx|yyyyyyyy
1142 xxxxxxxxxxxxxx|yyyyyy
1143 xxxxxxxxxxxxxxxx|yyyy
1144 xxxxxxxxxxxxxxxxxx|yy
1145 xxxxxxxxxxxxxxxxxxxx|
1146 (10 rows)
1147 \pset format aligned
1148 execute q;
1149   0123456789abcdef       0123456789     
1150 -------------------- ------------------
1151 xx                   yyyyyyyyyyyyyyyyyy
1152 xxxx                 yyyyyyyyyyyyyyyy
1153 xxxxxx               yyyyyyyyyyyyyy
1154 xxxxxxxx             yyyyyyyyyyyy
1155 xxxxxxxxxx           yyyyyyyyyy
1156 xxxxxxxxxxxx         yyyyyyyy
1157 xxxxxxxxxxxxxx       yyyyyy
1158 xxxxxxxxxxxxxxxx     yyyy
1159 xxxxxxxxxxxxxxxxxx   yy
1160 xxxxxxxxxxxxxxxxxxxx 
1161 (10 rows)
1162
1163 \pset format wrapped
1164 execute q;
1165   0123456789abcdef       0123456789     
1166 -------------------- ------------------
1167 xx                   yyyyyyyyyyyyyyyyyy
1168 xxxx                 yyyyyyyyyyyyyyyy
1169 xxxxxx               yyyyyyyyyyyyyy
1170 xxxxxxxx             yyyyyyyyyyyy
1171 xxxxxxxxxx           yyyyyyyyyy
1172 xxxxxxxxxxxx         yyyyyyyy
1173 xxxxxxxxxxxxxx       yyyyyy
1174 xxxxxxxxxxxxxxxx     yyyy
1175 xxxxxxxxxxxxxxxxxx   yy
1176 xxxxxxxxxxxxxxxxxxxx 
1177 (10 rows)
1178
1179 \pset border 1
1180 \pset format unaligned
1181 execute q;
1182 0123456789abcdef|0123456789
1183 xx|yyyyyyyyyyyyyyyyyy
1184 xxxx|yyyyyyyyyyyyyyyy
1185 xxxxxx|yyyyyyyyyyyyyy
1186 xxxxxxxx|yyyyyyyyyyyy
1187 xxxxxxxxxx|yyyyyyyyyy
1188 xxxxxxxxxxxx|yyyyyyyy
1189 xxxxxxxxxxxxxx|yyyyyy
1190 xxxxxxxxxxxxxxxx|yyyy
1191 xxxxxxxxxxxxxxxxxx|yy
1192 xxxxxxxxxxxxxxxxxxxx|
1193 (10 rows)
1194 \pset format aligned
1195 execute q;
1196    0123456789abcdef   |     0123456789     
1197 ----------------------+--------------------
1198  xx                   | yyyyyyyyyyyyyyyyyy
1199  xxxx                 | yyyyyyyyyyyyyyyy
1200  xxxxxx               | yyyyyyyyyyyyyy
1201  xxxxxxxx             | yyyyyyyyyyyy
1202  xxxxxxxxxx           | yyyyyyyyyy
1203  xxxxxxxxxxxx         | yyyyyyyy
1204  xxxxxxxxxxxxxx       | yyyyyy
1205  xxxxxxxxxxxxxxxx     | yyyy
1206  xxxxxxxxxxxxxxxxxx   | yy
1207  xxxxxxxxxxxxxxxxxxxx | 
1208 (10 rows)
1209
1210 \pset format wrapped
1211 execute q;
1212   0123456789abcdef   |    0123456789    
1213 ---------------------+------------------
1214  xx                  | yyyyyyyyyyyyyyyy.
1215                      |.yy
1216  xxxx                | yyyyyyyyyyyyyyyy
1217  xxxxxx              | yyyyyyyyyyyyyy
1218  xxxxxxxx            | yyyyyyyyyyyy
1219  xxxxxxxxxx          | yyyyyyyyyy
1220  xxxxxxxxxxxx        | yyyyyyyy
1221  xxxxxxxxxxxxxx      | yyyyyy
1222  xxxxxxxxxxxxxxxx    | yyyy
1223  xxxxxxxxxxxxxxxxxx  | yy
1224  xxxxxxxxxxxxxxxxxxx.| 
1225 .x                   | 
1226 (10 rows)
1227
1228 \pset border 2
1229 \pset format unaligned
1230 execute q;
1231 0123456789abcdef|0123456789
1232 xx|yyyyyyyyyyyyyyyyyy
1233 xxxx|yyyyyyyyyyyyyyyy
1234 xxxxxx|yyyyyyyyyyyyyy
1235 xxxxxxxx|yyyyyyyyyyyy
1236 xxxxxxxxxx|yyyyyyyyyy
1237 xxxxxxxxxxxx|yyyyyyyy
1238 xxxxxxxxxxxxxx|yyyyyy
1239 xxxxxxxxxxxxxxxx|yyyy
1240 xxxxxxxxxxxxxxxxxx|yy
1241 xxxxxxxxxxxxxxxxxxxx|
1242 (10 rows)
1243 \pset format aligned
1244 execute q;
1245 +----------------------+--------------------+
1246 |   0123456789abcdef   |     0123456789     |
1247 +----------------------+--------------------+
1248 | xx                   | yyyyyyyyyyyyyyyyyy |
1249 | xxxx                 | yyyyyyyyyyyyyyyy   |
1250 | xxxxxx               | yyyyyyyyyyyyyy     |
1251 | xxxxxxxx             | yyyyyyyyyyyy       |
1252 | xxxxxxxxxx           | yyyyyyyyyy         |
1253 | xxxxxxxxxxxx         | yyyyyyyy           |
1254 | xxxxxxxxxxxxxx       | yyyyyy             |
1255 | xxxxxxxxxxxxxxxx     | yyyy               |
1256 | xxxxxxxxxxxxxxxxxx   | yy                 |
1257 | xxxxxxxxxxxxxxxxxxxx |                    |
1258 +----------------------+--------------------+
1259 (10 rows)
1260
1261 \pset format wrapped
1262 execute q;
1263 +--------------------+-----------------+
1264 |  0123456789abcdef  |   0123456789    |
1265 +--------------------+-----------------+
1266 | xx                 | yyyyyyyyyyyyyyy.|
1267 |                    |.yyy             |
1268 | xxxx               | yyyyyyyyyyyyyyy.|
1269 |                    |.y               |
1270 | xxxxxx             | yyyyyyyyyyyyyy  |
1271 | xxxxxxxx           | yyyyyyyyyyyy    |
1272 | xxxxxxxxxx         | yyyyyyyyyy      |
1273 | xxxxxxxxxxxx       | yyyyyyyy        |
1274 | xxxxxxxxxxxxxx     | yyyyyy          |
1275 | xxxxxxxxxxxxxxxx   | yyyy            |
1276 | xxxxxxxxxxxxxxxxxx | yy              |
1277 | xxxxxxxxxxxxxxxxxx.|                 |
1278 |.xx                 |                 |
1279 +--------------------+-----------------+
1280 (10 rows)
1281
1282 \pset expanded on
1283 \pset columns 30
1284 \pset border 0
1285 \pset format unaligned
1286 execute q;
1287 0123456789abcdef|xx
1288 0123456789|yyyyyyyyyyyyyyyyyy
1289
1290 0123456789abcdef|xxxx
1291 0123456789|yyyyyyyyyyyyyyyy
1292
1293 0123456789abcdef|xxxxxx
1294 0123456789|yyyyyyyyyyyyyy
1295
1296 0123456789abcdef|xxxxxxxx
1297 0123456789|yyyyyyyyyyyy
1298
1299 0123456789abcdef|xxxxxxxxxx
1300 0123456789|yyyyyyyyyy
1301
1302 0123456789abcdef|xxxxxxxxxxxx
1303 0123456789|yyyyyyyy
1304
1305 0123456789abcdef|xxxxxxxxxxxxxx
1306 0123456789|yyyyyy
1307
1308 0123456789abcdef|xxxxxxxxxxxxxxxx
1309 0123456789|yyyy
1310
1311 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1312 0123456789|yy
1313
1314 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1315 0123456789|
1316 \pset format aligned
1317 execute q;
1318 * Record 1                          
1319 0123456789abcdef xx
1320 0123456789       yyyyyyyyyyyyyyyyyy
1321 * Record 2                          
1322 0123456789abcdef xxxx
1323 0123456789       yyyyyyyyyyyyyyyy
1324 * Record 3                          
1325 0123456789abcdef xxxxxx
1326 0123456789       yyyyyyyyyyyyyy
1327 * Record 4                          
1328 0123456789abcdef xxxxxxxx
1329 0123456789       yyyyyyyyyyyy
1330 * Record 5                          
1331 0123456789abcdef xxxxxxxxxx
1332 0123456789       yyyyyyyyyy
1333 * Record 6                          
1334 0123456789abcdef xxxxxxxxxxxx
1335 0123456789       yyyyyyyy
1336 * Record 7                          
1337 0123456789abcdef xxxxxxxxxxxxxx
1338 0123456789       yyyyyy
1339 * Record 8                          
1340 0123456789abcdef xxxxxxxxxxxxxxxx
1341 0123456789       yyyy
1342 * Record 9                          
1343 0123456789abcdef xxxxxxxxxxxxxxxxxx
1344 0123456789       yy
1345 * Record 10                         
1346 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
1347 0123456789       
1348
1349 \pset format wrapped
1350 execute q;
1351 * Record 1                  
1352 0123456789abcdef xx
1353 0123456789       yyyyyyyyyyyy.
1354                 .yyyyyy
1355 * Record 2                  
1356 0123456789abcdef xxxx
1357 0123456789       yyyyyyyyyyyy.
1358                 .yyyy
1359 * Record 3                  
1360 0123456789abcdef xxxxxx
1361 0123456789       yyyyyyyyyyyy.
1362                 .yy
1363 * Record 4                  
1364 0123456789abcdef xxxxxxxx
1365 0123456789       yyyyyyyyyyyy
1366 * Record 5                  
1367 0123456789abcdef xxxxxxxxxx
1368 0123456789       yyyyyyyyyy
1369 * Record 6                  
1370 0123456789abcdef xxxxxxxxxxxx
1371 0123456789       yyyyyyyy
1372 * Record 7                  
1373 0123456789abcdef xxxxxxxxxxxx.
1374                 .xx
1375 0123456789       yyyyyy
1376 * Record 8                  
1377 0123456789abcdef xxxxxxxxxxxx.
1378                 .xxxx
1379 0123456789       yyyy
1380 * Record 9                  
1381 0123456789abcdef xxxxxxxxxxxx.
1382                 .xxxxxx
1383 0123456789       yy
1384 * Record 10                 
1385 0123456789abcdef xxxxxxxxxxxx.
1386                 .xxxxxxxx
1387 0123456789       
1388
1389 \pset border 1
1390 \pset format unaligned
1391 execute q;
1392 0123456789abcdef|xx
1393 0123456789|yyyyyyyyyyyyyyyyyy
1394
1395 0123456789abcdef|xxxx
1396 0123456789|yyyyyyyyyyyyyyyy
1397
1398 0123456789abcdef|xxxxxx
1399 0123456789|yyyyyyyyyyyyyy
1400
1401 0123456789abcdef|xxxxxxxx
1402 0123456789|yyyyyyyyyyyy
1403
1404 0123456789abcdef|xxxxxxxxxx
1405 0123456789|yyyyyyyyyy
1406
1407 0123456789abcdef|xxxxxxxxxxxx
1408 0123456789|yyyyyyyy
1409
1410 0123456789abcdef|xxxxxxxxxxxxxx
1411 0123456789|yyyyyy
1412
1413 0123456789abcdef|xxxxxxxxxxxxxxxx
1414 0123456789|yyyy
1415
1416 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1417 0123456789|yy
1418
1419 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1420 0123456789|
1421 \pset format aligned
1422 execute q;
1423 -[ RECORD 1 ]----+---------------------
1424 0123456789abcdef | xx
1425 0123456789       | yyyyyyyyyyyyyyyyyy
1426 -[ RECORD 2 ]----+---------------------
1427 0123456789abcdef | xxxx
1428 0123456789       | yyyyyyyyyyyyyyyy
1429 -[ RECORD 3 ]----+---------------------
1430 0123456789abcdef | xxxxxx
1431 0123456789       | yyyyyyyyyyyyyy
1432 -[ RECORD 4 ]----+---------------------
1433 0123456789abcdef | xxxxxxxx
1434 0123456789       | yyyyyyyyyyyy
1435 -[ RECORD 5 ]----+---------------------
1436 0123456789abcdef | xxxxxxxxxx
1437 0123456789       | yyyyyyyyyy
1438 -[ RECORD 6 ]----+---------------------
1439 0123456789abcdef | xxxxxxxxxxxx
1440 0123456789       | yyyyyyyy
1441 -[ RECORD 7 ]----+---------------------
1442 0123456789abcdef | xxxxxxxxxxxxxx
1443 0123456789       | yyyyyy
1444 -[ RECORD 8 ]----+---------------------
1445 0123456789abcdef | xxxxxxxxxxxxxxxx
1446 0123456789       | yyyy
1447 -[ RECORD 9 ]----+---------------------
1448 0123456789abcdef | xxxxxxxxxxxxxxxxxx
1449 0123456789       | yy
1450 -[ RECORD 10 ]---+---------------------
1451 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
1452 0123456789       | 
1453
1454 \pset format wrapped
1455 execute q;
1456 -[ RECORD 1 ]----+-----------
1457 0123456789abcdef | xx
1458 0123456789       | yyyyyyyyyy.
1459                  |.yyyyyyyy
1460 -[ RECORD 2 ]----+-----------
1461 0123456789abcdef | xxxx
1462 0123456789       | yyyyyyyyyy.
1463                  |.yyyyyy
1464 -[ RECORD 3 ]----+-----------
1465 0123456789abcdef | xxxxxx
1466 0123456789       | yyyyyyyyyy.
1467                  |.yyyy
1468 -[ RECORD 4 ]----+-----------
1469 0123456789abcdef | xxxxxxxx
1470 0123456789       | yyyyyyyyyy.
1471                  |.yy
1472 -[ RECORD 5 ]----+-----------
1473 0123456789abcdef | xxxxxxxxxx
1474 0123456789       | yyyyyyyyyy
1475 -[ RECORD 6 ]----+-----------
1476 0123456789abcdef | xxxxxxxxxx.
1477                  |.xx
1478 0123456789       | yyyyyyyy
1479 -[ RECORD 7 ]----+-----------
1480 0123456789abcdef | xxxxxxxxxx.
1481                  |.xxxx
1482 0123456789       | yyyyyy
1483 -[ RECORD 8 ]----+-----------
1484 0123456789abcdef | xxxxxxxxxx.
1485                  |.xxxxxx
1486 0123456789       | yyyy
1487 -[ RECORD 9 ]----+-----------
1488 0123456789abcdef | xxxxxxxxxx.
1489                  |.xxxxxxxx
1490 0123456789       | yy
1491 -[ RECORD 10 ]---+-----------
1492 0123456789abcdef | xxxxxxxxxx.
1493                  |.xxxxxxxxxx
1494 0123456789       | 
1495
1496 \pset border 2
1497 \pset format unaligned
1498 execute q;
1499 0123456789abcdef|xx
1500 0123456789|yyyyyyyyyyyyyyyyyy
1501
1502 0123456789abcdef|xxxx
1503 0123456789|yyyyyyyyyyyyyyyy
1504
1505 0123456789abcdef|xxxxxx
1506 0123456789|yyyyyyyyyyyyyy
1507
1508 0123456789abcdef|xxxxxxxx
1509 0123456789|yyyyyyyyyyyy
1510
1511 0123456789abcdef|xxxxxxxxxx
1512 0123456789|yyyyyyyyyy
1513
1514 0123456789abcdef|xxxxxxxxxxxx
1515 0123456789|yyyyyyyy
1516
1517 0123456789abcdef|xxxxxxxxxxxxxx
1518 0123456789|yyyyyy
1519
1520 0123456789abcdef|xxxxxxxxxxxxxxxx
1521 0123456789|yyyy
1522
1523 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1524 0123456789|yy
1525
1526 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1527 0123456789|
1528 \pset format aligned
1529 execute q;
1530 +-[ RECORD 1 ]-----+----------------------+
1531 | 0123456789abcdef | xx                   |
1532 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
1533 +-[ RECORD 2 ]-----+----------------------+
1534 | 0123456789abcdef | xxxx                 |
1535 | 0123456789       | yyyyyyyyyyyyyyyy     |
1536 +-[ RECORD 3 ]-----+----------------------+
1537 | 0123456789abcdef | xxxxxx               |
1538 | 0123456789       | yyyyyyyyyyyyyy       |
1539 +-[ RECORD 4 ]-----+----------------------+
1540 | 0123456789abcdef | xxxxxxxx             |
1541 | 0123456789       | yyyyyyyyyyyy         |
1542 +-[ RECORD 5 ]-----+----------------------+
1543 | 0123456789abcdef | xxxxxxxxxx           |
1544 | 0123456789       | yyyyyyyyyy           |
1545 +-[ RECORD 6 ]-----+----------------------+
1546 | 0123456789abcdef | xxxxxxxxxxxx         |
1547 | 0123456789       | yyyyyyyy             |
1548 +-[ RECORD 7 ]-----+----------------------+
1549 | 0123456789abcdef | xxxxxxxxxxxxxx       |
1550 | 0123456789       | yyyyyy               |
1551 +-[ RECORD 8 ]-----+----------------------+
1552 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
1553 | 0123456789       | yyyy                 |
1554 +-[ RECORD 9 ]-----+----------------------+
1555 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
1556 | 0123456789       | yy                   |
1557 +-[ RECORD 10 ]----+----------------------+
1558 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
1559 | 0123456789       |                      |
1560 +------------------+----------------------+
1561
1562 \pset format wrapped
1563 execute q;
1564 +-[ RECORD 1 ]-----+---------+
1565 | 0123456789abcdef | xx      |
1566 | 0123456789       | yyyyyyy.|
1567 |                  |.yyyyyyy.|
1568 |                  |.yyyy    |
1569 +-[ RECORD 2 ]-----+---------+
1570 | 0123456789abcdef | xxxx    |
1571 | 0123456789       | yyyyyyy.|
1572 |                  |.yyyyyyy.|
1573 |                  |.yy      |
1574 +-[ RECORD 3 ]-----+---------+
1575 | 0123456789abcdef | xxxxxx  |
1576 | 0123456789       | yyyyyyy.|
1577 |                  |.yyyyyyy |
1578 +-[ RECORD 4 ]-----+---------+
1579 | 0123456789abcdef | xxxxxxx.|
1580 |                  |.x       |
1581 | 0123456789       | yyyyyyy.|
1582 |                  |.yyyyy   |
1583 +-[ RECORD 5 ]-----+---------+
1584 | 0123456789abcdef | xxxxxxx.|
1585 |                  |.xxx     |
1586 | 0123456789       | yyyyyyy.|
1587 |                  |.yyy     |
1588 +-[ RECORD 6 ]-----+---------+
1589 | 0123456789abcdef | xxxxxxx.|
1590 |                  |.xxxxx   |
1591 | 0123456789       | yyyyyyy.|
1592 |                  |.y       |
1593 +-[ RECORD 7 ]-----+---------+
1594 | 0123456789abcdef | xxxxxxx.|
1595 |                  |.xxxxxxx |
1596 | 0123456789       | yyyyyy  |
1597 +-[ RECORD 8 ]-----+---------+
1598 | 0123456789abcdef | xxxxxxx.|
1599 |                  |.xxxxxxx.|
1600 |                  |.xx      |
1601 | 0123456789       | yyyy    |
1602 +-[ RECORD 9 ]-----+---------+
1603 | 0123456789abcdef | xxxxxxx.|
1604 |                  |.xxxxxxx.|
1605 |                  |.xxxx    |
1606 | 0123456789       | yy      |
1607 +-[ RECORD 10 ]----+---------+
1608 | 0123456789abcdef | xxxxxxx.|
1609 |                  |.xxxxxxx.|
1610 |                  |.xxxxxx  |
1611 | 0123456789       |         |
1612 +------------------+---------+
1613
1614 \pset expanded on
1615 \pset columns 20
1616 \pset border 0
1617 \pset format unaligned
1618 execute q;
1619 0123456789abcdef|xx
1620 0123456789|yyyyyyyyyyyyyyyyyy
1621
1622 0123456789abcdef|xxxx
1623 0123456789|yyyyyyyyyyyyyyyy
1624
1625 0123456789abcdef|xxxxxx
1626 0123456789|yyyyyyyyyyyyyy
1627
1628 0123456789abcdef|xxxxxxxx
1629 0123456789|yyyyyyyyyyyy
1630
1631 0123456789abcdef|xxxxxxxxxx
1632 0123456789|yyyyyyyyyy
1633
1634 0123456789abcdef|xxxxxxxxxxxx
1635 0123456789|yyyyyyyy
1636
1637 0123456789abcdef|xxxxxxxxxxxxxx
1638 0123456789|yyyyyy
1639
1640 0123456789abcdef|xxxxxxxxxxxxxxxx
1641 0123456789|yyyy
1642
1643 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1644 0123456789|yy
1645
1646 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1647 0123456789|
1648 \pset format aligned
1649 execute q;
1650 * Record 1                          
1651 0123456789abcdef xx
1652 0123456789       yyyyyyyyyyyyyyyyyy
1653 * Record 2                          
1654 0123456789abcdef xxxx
1655 0123456789       yyyyyyyyyyyyyyyy
1656 * Record 3                          
1657 0123456789abcdef xxxxxx
1658 0123456789       yyyyyyyyyyyyyy
1659 * Record 4                          
1660 0123456789abcdef xxxxxxxx
1661 0123456789       yyyyyyyyyyyy
1662 * Record 5                          
1663 0123456789abcdef xxxxxxxxxx
1664 0123456789       yyyyyyyyyy
1665 * Record 6                          
1666 0123456789abcdef xxxxxxxxxxxx
1667 0123456789       yyyyyyyy
1668 * Record 7                          
1669 0123456789abcdef xxxxxxxxxxxxxx
1670 0123456789       yyyyyy
1671 * Record 8                          
1672 0123456789abcdef xxxxxxxxxxxxxxxx
1673 0123456789       yyyy
1674 * Record 9                          
1675 0123456789abcdef xxxxxxxxxxxxxxxxxx
1676 0123456789       yy
1677 * Record 10                         
1678 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
1679 0123456789       
1680
1681 \pset format wrapped
1682 execute q;
1683 * Record 1         
1684 0123456789abcdef xx
1685 0123456789       yyy.
1686                 .yyy.
1687                 .yyy.
1688                 .yyy.
1689                 .yyy.
1690                 .yyy
1691 * Record 2         
1692 0123456789abcdef xxx.
1693                 .x
1694 0123456789       yyy.
1695                 .yyy.
1696                 .yyy.
1697                 .yyy.
1698                 .yyy.
1699                 .y
1700 * Record 3         
1701 0123456789abcdef xxx.
1702                 .xxx
1703 0123456789       yyy.
1704                 .yyy.
1705                 .yyy.
1706                 .yyy.
1707                 .yy
1708 * Record 4         
1709 0123456789abcdef xxx.
1710                 .xxx.
1711                 .xx
1712 0123456789       yyy.
1713                 .yyy.
1714                 .yyy.
1715                 .yyy
1716 * Record 5         
1717 0123456789abcdef xxx.
1718                 .xxx.
1719                 .xxx.
1720                 .x
1721 0123456789       yyy.
1722                 .yyy.
1723                 .yyy.
1724                 .y
1725 * Record 6         
1726 0123456789abcdef xxx.
1727                 .xxx.
1728                 .xxx.
1729                 .xxx
1730 0123456789       yyy.
1731                 .yyy.
1732                 .yy
1733 * Record 7         
1734 0123456789abcdef xxx.
1735                 .xxx.
1736                 .xxx.
1737                 .xxx.
1738                 .xx
1739 0123456789       yyy.
1740                 .yyy
1741 * Record 8         
1742 0123456789abcdef xxx.
1743                 .xxx.
1744                 .xxx.
1745                 .xxx.
1746                 .xxx.
1747                 .x
1748 0123456789       yyy.
1749                 .y
1750 * Record 9         
1751 0123456789abcdef xxx.
1752                 .xxx.
1753                 .xxx.
1754                 .xxx.
1755                 .xxx.
1756                 .xxx
1757 0123456789       yy
1758 * Record 10        
1759 0123456789abcdef xxx.
1760                 .xxx.
1761                 .xxx.
1762                 .xxx.
1763                 .xxx.
1764                 .xxx.
1765                 .xx
1766 0123456789       
1767
1768 \pset border 1
1769 \pset format unaligned
1770 execute q;
1771 0123456789abcdef|xx
1772 0123456789|yyyyyyyyyyyyyyyyyy
1773
1774 0123456789abcdef|xxxx
1775 0123456789|yyyyyyyyyyyyyyyy
1776
1777 0123456789abcdef|xxxxxx
1778 0123456789|yyyyyyyyyyyyyy
1779
1780 0123456789abcdef|xxxxxxxx
1781 0123456789|yyyyyyyyyyyy
1782
1783 0123456789abcdef|xxxxxxxxxx
1784 0123456789|yyyyyyyyyy
1785
1786 0123456789abcdef|xxxxxxxxxxxx
1787 0123456789|yyyyyyyy
1788
1789 0123456789abcdef|xxxxxxxxxxxxxx
1790 0123456789|yyyyyy
1791
1792 0123456789abcdef|xxxxxxxxxxxxxxxx
1793 0123456789|yyyy
1794
1795 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1796 0123456789|yy
1797
1798 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1799 0123456789|
1800 \pset format aligned
1801 execute q;
1802 -[ RECORD 1 ]----+---------------------
1803 0123456789abcdef | xx
1804 0123456789       | yyyyyyyyyyyyyyyyyy
1805 -[ RECORD 2 ]----+---------------------
1806 0123456789abcdef | xxxx
1807 0123456789       | yyyyyyyyyyyyyyyy
1808 -[ RECORD 3 ]----+---------------------
1809 0123456789abcdef | xxxxxx
1810 0123456789       | yyyyyyyyyyyyyy
1811 -[ RECORD 4 ]----+---------------------
1812 0123456789abcdef | xxxxxxxx
1813 0123456789       | yyyyyyyyyyyy
1814 -[ RECORD 5 ]----+---------------------
1815 0123456789abcdef | xxxxxxxxxx
1816 0123456789       | yyyyyyyyyy
1817 -[ RECORD 6 ]----+---------------------
1818 0123456789abcdef | xxxxxxxxxxxx
1819 0123456789       | yyyyyyyy
1820 -[ RECORD 7 ]----+---------------------
1821 0123456789abcdef | xxxxxxxxxxxxxx
1822 0123456789       | yyyyyy
1823 -[ RECORD 8 ]----+---------------------
1824 0123456789abcdef | xxxxxxxxxxxxxxxx
1825 0123456789       | yyyy
1826 -[ RECORD 9 ]----+---------------------
1827 0123456789abcdef | xxxxxxxxxxxxxxxxxx
1828 0123456789       | yy
1829 -[ RECORD 10 ]---+---------------------
1830 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
1831 0123456789       | 
1832
1833 \pset format wrapped
1834 execute q;
1835 -[ RECORD 1 ]----+----
1836 0123456789abcdef | xx
1837 0123456789       | yyy.
1838                  |.yyy.
1839                  |.yyy.
1840                  |.yyy.
1841                  |.yyy.
1842                  |.yyy
1843 -[ RECORD 2 ]----+----
1844 0123456789abcdef | xxx.
1845                  |.x
1846 0123456789       | yyy.
1847                  |.yyy.
1848                  |.yyy.
1849                  |.yyy.
1850                  |.yyy.
1851                  |.y
1852 -[ RECORD 3 ]----+----
1853 0123456789abcdef | xxx.
1854                  |.xxx
1855 0123456789       | yyy.
1856                  |.yyy.
1857                  |.yyy.
1858                  |.yyy.
1859                  |.yy
1860 -[ RECORD 4 ]----+----
1861 0123456789abcdef | xxx.
1862                  |.xxx.
1863                  |.xx
1864 0123456789       | yyy.
1865                  |.yyy.
1866                  |.yyy.
1867                  |.yyy
1868 -[ RECORD 5 ]----+----
1869 0123456789abcdef | xxx.
1870                  |.xxx.
1871                  |.xxx.
1872                  |.x
1873 0123456789       | yyy.
1874                  |.yyy.
1875                  |.yyy.
1876                  |.y
1877 -[ RECORD 6 ]----+----
1878 0123456789abcdef | xxx.
1879                  |.xxx.
1880                  |.xxx.
1881                  |.xxx
1882 0123456789       | yyy.
1883                  |.yyy.
1884                  |.yy
1885 -[ RECORD 7 ]----+----
1886 0123456789abcdef | xxx.
1887                  |.xxx.
1888                  |.xxx.
1889                  |.xxx.
1890                  |.xx
1891 0123456789       | yyy.
1892                  |.yyy
1893 -[ RECORD 8 ]----+----
1894 0123456789abcdef | xxx.
1895                  |.xxx.
1896                  |.xxx.
1897                  |.xxx.
1898                  |.xxx.
1899                  |.x
1900 0123456789       | yyy.
1901                  |.y
1902 -[ RECORD 9 ]----+----
1903 0123456789abcdef | xxx.
1904                  |.xxx.
1905                  |.xxx.
1906                  |.xxx.
1907                  |.xxx.
1908                  |.xxx
1909 0123456789       | yy
1910 -[ RECORD 10 ]---+----
1911 0123456789abcdef | xxx.
1912                  |.xxx.
1913                  |.xxx.
1914                  |.xxx.
1915                  |.xxx.
1916                  |.xxx.
1917                  |.xx
1918 0123456789       | 
1919
1920 \pset border 2
1921 \pset format unaligned
1922 execute q;
1923 0123456789abcdef|xx
1924 0123456789|yyyyyyyyyyyyyyyyyy
1925
1926 0123456789abcdef|xxxx
1927 0123456789|yyyyyyyyyyyyyyyy
1928
1929 0123456789abcdef|xxxxxx
1930 0123456789|yyyyyyyyyyyyyy
1931
1932 0123456789abcdef|xxxxxxxx
1933 0123456789|yyyyyyyyyyyy
1934
1935 0123456789abcdef|xxxxxxxxxx
1936 0123456789|yyyyyyyyyy
1937
1938 0123456789abcdef|xxxxxxxxxxxx
1939 0123456789|yyyyyyyy
1940
1941 0123456789abcdef|xxxxxxxxxxxxxx
1942 0123456789|yyyyyy
1943
1944 0123456789abcdef|xxxxxxxxxxxxxxxx
1945 0123456789|yyyy
1946
1947 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1948 0123456789|yy
1949
1950 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1951 0123456789|
1952 \pset format aligned
1953 execute q;
1954 +-[ RECORD 1 ]-----+----------------------+
1955 | 0123456789abcdef | xx                   |
1956 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
1957 +-[ RECORD 2 ]-----+----------------------+
1958 | 0123456789abcdef | xxxx                 |
1959 | 0123456789       | yyyyyyyyyyyyyyyy     |
1960 +-[ RECORD 3 ]-----+----------------------+
1961 | 0123456789abcdef | xxxxxx               |
1962 | 0123456789       | yyyyyyyyyyyyyy       |
1963 +-[ RECORD 4 ]-----+----------------------+
1964 | 0123456789abcdef | xxxxxxxx             |
1965 | 0123456789       | yyyyyyyyyyyy         |
1966 +-[ RECORD 5 ]-----+----------------------+
1967 | 0123456789abcdef | xxxxxxxxxx           |
1968 | 0123456789       | yyyyyyyyyy           |
1969 +-[ RECORD 6 ]-----+----------------------+
1970 | 0123456789abcdef | xxxxxxxxxxxx         |
1971 | 0123456789       | yyyyyyyy             |
1972 +-[ RECORD 7 ]-----+----------------------+
1973 | 0123456789abcdef | xxxxxxxxxxxxxx       |
1974 | 0123456789       | yyyyyy               |
1975 +-[ RECORD 8 ]-----+----------------------+
1976 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
1977 | 0123456789       | yyyy                 |
1978 +-[ RECORD 9 ]-----+----------------------+
1979 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
1980 | 0123456789       | yy                   |
1981 +-[ RECORD 10 ]----+----------------------+
1982 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
1983 | 0123456789       |                      |
1984 +------------------+----------------------+
1985
1986 \pset format wrapped
1987 execute q;
1988 +-[ RECORD 1 ]-----+-----+
1989 | 0123456789abcdef | xx  |
1990 | 0123456789       | yyy.|
1991 |                  |.yyy.|
1992 |                  |.yyy.|
1993 |                  |.yyy.|
1994 |                  |.yyy.|
1995 |                  |.yyy |
1996 +-[ RECORD 2 ]-----+-----+
1997 | 0123456789abcdef | xxx.|
1998 |                  |.x   |
1999 | 0123456789       | yyy.|
2000 |                  |.yyy.|
2001 |                  |.yyy.|
2002 |                  |.yyy.|
2003 |                  |.yyy.|
2004 |                  |.y   |
2005 +-[ RECORD 3 ]-----+-----+
2006 | 0123456789abcdef | xxx.|
2007 |                  |.xxx |
2008 | 0123456789       | yyy.|
2009 |                  |.yyy.|
2010 |                  |.yyy.|
2011 |                  |.yyy.|
2012 |                  |.yy  |
2013 +-[ RECORD 4 ]-----+-----+
2014 | 0123456789abcdef | xxx.|
2015 |                  |.xxx.|
2016 |                  |.xx  |
2017 | 0123456789       | yyy.|
2018 |                  |.yyy.|
2019 |                  |.yyy.|
2020 |                  |.yyy |
2021 +-[ RECORD 5 ]-----+-----+
2022 | 0123456789abcdef | xxx.|
2023 |                  |.xxx.|
2024 |                  |.xxx.|
2025 |                  |.x   |
2026 | 0123456789       | yyy.|
2027 |                  |.yyy.|
2028 |                  |.yyy.|
2029 |                  |.y   |
2030 +-[ RECORD 6 ]-----+-----+
2031 | 0123456789abcdef | xxx.|
2032 |                  |.xxx.|
2033 |                  |.xxx.|
2034 |                  |.xxx |
2035 | 0123456789       | yyy.|
2036 |                  |.yyy.|
2037 |                  |.yy  |
2038 +-[ RECORD 7 ]-----+-----+
2039 | 0123456789abcdef | xxx.|
2040 |                  |.xxx.|
2041 |                  |.xxx.|
2042 |                  |.xxx.|
2043 |                  |.xx  |
2044 | 0123456789       | yyy.|
2045 |                  |.yyy |
2046 +-[ RECORD 8 ]-----+-----+
2047 | 0123456789abcdef | xxx.|
2048 |                  |.xxx.|
2049 |                  |.xxx.|
2050 |                  |.xxx.|
2051 |                  |.xxx.|
2052 |                  |.x   |
2053 | 0123456789       | yyy.|
2054 |                  |.y   |
2055 +-[ RECORD 9 ]-----+-----+
2056 | 0123456789abcdef | xxx.|
2057 |                  |.xxx.|
2058 |                  |.xxx.|
2059 |                  |.xxx.|
2060 |                  |.xxx.|
2061 |                  |.xxx |
2062 | 0123456789       | yy  |
2063 +-[ RECORD 10 ]----+-----+
2064 | 0123456789abcdef | xxx.|
2065 |                  |.xxx.|
2066 |                  |.xxx.|
2067 |                  |.xxx.|
2068 |                  |.xxx.|
2069 |                  |.xxx.|
2070 |                  |.xx  |
2071 | 0123456789       |     |
2072 +------------------+-----+
2073
2074 \pset linestyle old-ascii
2075 \pset expanded off
2076 \pset columns 40
2077 \pset border 0
2078 \pset format unaligned
2079 execute q;
2080 0123456789abcdef|0123456789
2081 xx|yyyyyyyyyyyyyyyyyy
2082 xxxx|yyyyyyyyyyyyyyyy
2083 xxxxxx|yyyyyyyyyyyyyy
2084 xxxxxxxx|yyyyyyyyyyyy
2085 xxxxxxxxxx|yyyyyyyyyy
2086 xxxxxxxxxxxx|yyyyyyyy
2087 xxxxxxxxxxxxxx|yyyyyy
2088 xxxxxxxxxxxxxxxx|yyyy
2089 xxxxxxxxxxxxxxxxxx|yy
2090 xxxxxxxxxxxxxxxxxxxx|
2091 (10 rows)
2092 \pset format aligned
2093 execute q;
2094   0123456789abcdef       0123456789    
2095 -------------------- ------------------
2096 xx                   yyyyyyyyyyyyyyyyyy
2097 xxxx                 yyyyyyyyyyyyyyyy
2098 xxxxxx               yyyyyyyyyyyyyy
2099 xxxxxxxx             yyyyyyyyyyyy
2100 xxxxxxxxxx           yyyyyyyyyy
2101 xxxxxxxxxxxx         yyyyyyyy
2102 xxxxxxxxxxxxxx       yyyyyy
2103 xxxxxxxxxxxxxxxx     yyyy
2104 xxxxxxxxxxxxxxxxxx   yy
2105 xxxxxxxxxxxxxxxxxxxx 
2106 (10 rows)
2107
2108 \pset format wrapped
2109 execute q;
2110   0123456789abcdef       0123456789    
2111 -------------------- ------------------
2112 xx                   yyyyyyyyyyyyyyyyyy
2113 xxxx                 yyyyyyyyyyyyyyyy
2114 xxxxxx               yyyyyyyyyyyyyy
2115 xxxxxxxx             yyyyyyyyyyyy
2116 xxxxxxxxxx           yyyyyyyyyy
2117 xxxxxxxxxxxx         yyyyyyyy
2118 xxxxxxxxxxxxxx       yyyyyy
2119 xxxxxxxxxxxxxxxx     yyyy
2120 xxxxxxxxxxxxxxxxxx   yy
2121 xxxxxxxxxxxxxxxxxxxx 
2122 (10 rows)
2123
2124 \pset border 1
2125 \pset format unaligned
2126 execute q;
2127 0123456789abcdef|0123456789
2128 xx|yyyyyyyyyyyyyyyyyy
2129 xxxx|yyyyyyyyyyyyyyyy
2130 xxxxxx|yyyyyyyyyyyyyy
2131 xxxxxxxx|yyyyyyyyyyyy
2132 xxxxxxxxxx|yyyyyyyyyy
2133 xxxxxxxxxxxx|yyyyyyyy
2134 xxxxxxxxxxxxxx|yyyyyy
2135 xxxxxxxxxxxxxxxx|yyyy
2136 xxxxxxxxxxxxxxxxxx|yy
2137 xxxxxxxxxxxxxxxxxxxx|
2138 (10 rows)
2139 \pset format aligned
2140 execute q;
2141    0123456789abcdef   |     0123456789     
2142 ----------------------+--------------------
2143  xx                   | yyyyyyyyyyyyyyyyyy
2144  xxxx                 | yyyyyyyyyyyyyyyy
2145  xxxxxx               | yyyyyyyyyyyyyy
2146  xxxxxxxx             | yyyyyyyyyyyy
2147  xxxxxxxxxx           | yyyyyyyyyy
2148  xxxxxxxxxxxx         | yyyyyyyy
2149  xxxxxxxxxxxxxx       | yyyyyy
2150  xxxxxxxxxxxxxxxx     | yyyy
2151  xxxxxxxxxxxxxxxxxx   | yy
2152  xxxxxxxxxxxxxxxxxxxx | 
2153 (10 rows)
2154
2155 \pset format wrapped
2156 execute q;
2157   0123456789abcdef   |    0123456789    
2158 ---------------------+------------------
2159  xx                  | yyyyyyyyyyyyyyyy 
2160                      ; yy
2161  xxxx                | yyyyyyyyyyyyyyyy
2162  xxxxxx              | yyyyyyyyyyyyyy
2163  xxxxxxxx            | yyyyyyyyyyyy
2164  xxxxxxxxxx          | yyyyyyyyyy
2165  xxxxxxxxxxxx        | yyyyyyyy
2166  xxxxxxxxxxxxxx      | yyyyyy
2167  xxxxxxxxxxxxxxxx    | yyyy
2168  xxxxxxxxxxxxxxxxxx  | yy
2169  xxxxxxxxxxxxxxxxxxx | 
2170  x                     
2171 (10 rows)
2172
2173 \pset border 2
2174 \pset format unaligned
2175 execute q;
2176 0123456789abcdef|0123456789
2177 xx|yyyyyyyyyyyyyyyyyy
2178 xxxx|yyyyyyyyyyyyyyyy
2179 xxxxxx|yyyyyyyyyyyyyy
2180 xxxxxxxx|yyyyyyyyyyyy
2181 xxxxxxxxxx|yyyyyyyyyy
2182 xxxxxxxxxxxx|yyyyyyyy
2183 xxxxxxxxxxxxxx|yyyyyy
2184 xxxxxxxxxxxxxxxx|yyyy
2185 xxxxxxxxxxxxxxxxxx|yy
2186 xxxxxxxxxxxxxxxxxxxx|
2187 (10 rows)
2188 \pset format aligned
2189 execute q;
2190 +----------------------+--------------------+
2191 |   0123456789abcdef   |     0123456789     |
2192 +----------------------+--------------------+
2193 | xx                   | yyyyyyyyyyyyyyyyyy |
2194 | xxxx                 | yyyyyyyyyyyyyyyy   |
2195 | xxxxxx               | yyyyyyyyyyyyyy     |
2196 | xxxxxxxx             | yyyyyyyyyyyy       |
2197 | xxxxxxxxxx           | yyyyyyyyyy         |
2198 | xxxxxxxxxxxx         | yyyyyyyy           |
2199 | xxxxxxxxxxxxxx       | yyyyyy             |
2200 | xxxxxxxxxxxxxxxx     | yyyy               |
2201 | xxxxxxxxxxxxxxxxxx   | yy                 |
2202 | xxxxxxxxxxxxxxxxxxxx |                    |
2203 +----------------------+--------------------+
2204 (10 rows)
2205
2206 \pset format wrapped
2207 execute q;
2208 +--------------------+-----------------+
2209 |  0123456789abcdef  |   0123456789    |
2210 +--------------------+-----------------+
2211 | xx                 | yyyyyyyyyyyyyyy |
2212 |                    ; yyy             |
2213 | xxxx               | yyyyyyyyyyyyyyy |
2214 |                    ; y               |
2215 | xxxxxx             | yyyyyyyyyyyyyy  |
2216 | xxxxxxxx           | yyyyyyyyyyyy    |
2217 | xxxxxxxxxx         | yyyyyyyyyy      |
2218 | xxxxxxxxxxxx       | yyyyyyyy        |
2219 | xxxxxxxxxxxxxx     | yyyyyy          |
2220 | xxxxxxxxxxxxxxxx   | yyyy            |
2221 | xxxxxxxxxxxxxxxxxx | yy              |
2222 | xxxxxxxxxxxxxxxxxx |                 |
2223 | xx                                   |
2224 +--------------------+-----------------+
2225 (10 rows)
2226
2227 \pset expanded on
2228 \pset border 0
2229 \pset format unaligned
2230 execute q;
2231 0123456789abcdef|xx
2232 0123456789|yyyyyyyyyyyyyyyyyy
2233
2234 0123456789abcdef|xxxx
2235 0123456789|yyyyyyyyyyyyyyyy
2236
2237 0123456789abcdef|xxxxxx
2238 0123456789|yyyyyyyyyyyyyy
2239
2240 0123456789abcdef|xxxxxxxx
2241 0123456789|yyyyyyyyyyyy
2242
2243 0123456789abcdef|xxxxxxxxxx
2244 0123456789|yyyyyyyyyy
2245
2246 0123456789abcdef|xxxxxxxxxxxx
2247 0123456789|yyyyyyyy
2248
2249 0123456789abcdef|xxxxxxxxxxxxxx
2250 0123456789|yyyyyy
2251
2252 0123456789abcdef|xxxxxxxxxxxxxxxx
2253 0123456789|yyyy
2254
2255 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2256 0123456789|yy
2257
2258 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2259 0123456789|
2260 \pset format aligned
2261 execute q;
2262 * Record 1                          
2263 0123456789abcdef xx
2264 0123456789       yyyyyyyyyyyyyyyyyy
2265 * Record 2                          
2266 0123456789abcdef xxxx
2267 0123456789       yyyyyyyyyyyyyyyy
2268 * Record 3                          
2269 0123456789abcdef xxxxxx
2270 0123456789       yyyyyyyyyyyyyy
2271 * Record 4                          
2272 0123456789abcdef xxxxxxxx
2273 0123456789       yyyyyyyyyyyy
2274 * Record 5                          
2275 0123456789abcdef xxxxxxxxxx
2276 0123456789       yyyyyyyyyy
2277 * Record 6                          
2278 0123456789abcdef xxxxxxxxxxxx
2279 0123456789       yyyyyyyy
2280 * Record 7                          
2281 0123456789abcdef xxxxxxxxxxxxxx
2282 0123456789       yyyyyy
2283 * Record 8                          
2284 0123456789abcdef xxxxxxxxxxxxxxxx
2285 0123456789       yyyy
2286 * Record 9                          
2287 0123456789abcdef xxxxxxxxxxxxxxxxxx
2288 0123456789       yy
2289 * Record 10                         
2290 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
2291 0123456789       
2292
2293 \pset format wrapped
2294 execute q;
2295 * Record 1                          
2296 0123456789abcdef xx
2297 0123456789       yyyyyyyyyyyyyyyyyy
2298 * Record 2                          
2299 0123456789abcdef xxxx
2300 0123456789       yyyyyyyyyyyyyyyy
2301 * Record 3                          
2302 0123456789abcdef xxxxxx
2303 0123456789       yyyyyyyyyyyyyy
2304 * Record 4                          
2305 0123456789abcdef xxxxxxxx
2306 0123456789       yyyyyyyyyyyy
2307 * Record 5                          
2308 0123456789abcdef xxxxxxxxxx
2309 0123456789       yyyyyyyyyy
2310 * Record 6                          
2311 0123456789abcdef xxxxxxxxxxxx
2312 0123456789       yyyyyyyy
2313 * Record 7                          
2314 0123456789abcdef xxxxxxxxxxxxxx
2315 0123456789       yyyyyy
2316 * Record 8                          
2317 0123456789abcdef xxxxxxxxxxxxxxxx
2318 0123456789       yyyy
2319 * Record 9                          
2320 0123456789abcdef xxxxxxxxxxxxxxxxxx
2321 0123456789       yy
2322 * Record 10                         
2323 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
2324 0123456789       
2325
2326 \pset border 1
2327 \pset format unaligned
2328 execute q;
2329 0123456789abcdef|xx
2330 0123456789|yyyyyyyyyyyyyyyyyy
2331
2332 0123456789abcdef|xxxx
2333 0123456789|yyyyyyyyyyyyyyyy
2334
2335 0123456789abcdef|xxxxxx
2336 0123456789|yyyyyyyyyyyyyy
2337
2338 0123456789abcdef|xxxxxxxx
2339 0123456789|yyyyyyyyyyyy
2340
2341 0123456789abcdef|xxxxxxxxxx
2342 0123456789|yyyyyyyyyy
2343
2344 0123456789abcdef|xxxxxxxxxxxx
2345 0123456789|yyyyyyyy
2346
2347 0123456789abcdef|xxxxxxxxxxxxxx
2348 0123456789|yyyyyy
2349
2350 0123456789abcdef|xxxxxxxxxxxxxxxx
2351 0123456789|yyyy
2352
2353 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2354 0123456789|yy
2355
2356 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2357 0123456789|
2358 \pset format aligned
2359 execute q;
2360 -[ RECORD 1 ]----+---------------------
2361 0123456789abcdef | xx
2362 0123456789       | yyyyyyyyyyyyyyyyyy
2363 -[ RECORD 2 ]----+---------------------
2364 0123456789abcdef | xxxx
2365 0123456789       | yyyyyyyyyyyyyyyy
2366 -[ RECORD 3 ]----+---------------------
2367 0123456789abcdef | xxxxxx
2368 0123456789       | yyyyyyyyyyyyyy
2369 -[ RECORD 4 ]----+---------------------
2370 0123456789abcdef | xxxxxxxx
2371 0123456789       | yyyyyyyyyyyy
2372 -[ RECORD 5 ]----+---------------------
2373 0123456789abcdef | xxxxxxxxxx
2374 0123456789       | yyyyyyyyyy
2375 -[ RECORD 6 ]----+---------------------
2376 0123456789abcdef | xxxxxxxxxxxx
2377 0123456789       | yyyyyyyy
2378 -[ RECORD 7 ]----+---------------------
2379 0123456789abcdef | xxxxxxxxxxxxxx
2380 0123456789       | yyyyyy
2381 -[ RECORD 8 ]----+---------------------
2382 0123456789abcdef | xxxxxxxxxxxxxxxx
2383 0123456789       | yyyy
2384 -[ RECORD 9 ]----+---------------------
2385 0123456789abcdef | xxxxxxxxxxxxxxxxxx
2386 0123456789       | yy
2387 -[ RECORD 10 ]---+---------------------
2388 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
2389 0123456789       | 
2390
2391 \pset format wrapped
2392 execute q;
2393 -[ RECORD 1 ]----+---------------------
2394 0123456789abcdef | xx
2395 0123456789       | yyyyyyyyyyyyyyyyyy
2396 -[ RECORD 2 ]----+---------------------
2397 0123456789abcdef | xxxx
2398 0123456789       | yyyyyyyyyyyyyyyy
2399 -[ RECORD 3 ]----+---------------------
2400 0123456789abcdef | xxxxxx
2401 0123456789       | yyyyyyyyyyyyyy
2402 -[ RECORD 4 ]----+---------------------
2403 0123456789abcdef | xxxxxxxx
2404 0123456789       | yyyyyyyyyyyy
2405 -[ RECORD 5 ]----+---------------------
2406 0123456789abcdef | xxxxxxxxxx
2407 0123456789       | yyyyyyyyyy
2408 -[ RECORD 6 ]----+---------------------
2409 0123456789abcdef | xxxxxxxxxxxx
2410 0123456789       | yyyyyyyy
2411 -[ RECORD 7 ]----+---------------------
2412 0123456789abcdef | xxxxxxxxxxxxxx
2413 0123456789       | yyyyyy
2414 -[ RECORD 8 ]----+---------------------
2415 0123456789abcdef | xxxxxxxxxxxxxxxx
2416 0123456789       | yyyy
2417 -[ RECORD 9 ]----+---------------------
2418 0123456789abcdef | xxxxxxxxxxxxxxxxxx
2419 0123456789       | yy
2420 -[ RECORD 10 ]---+---------------------
2421 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
2422 0123456789       | 
2423
2424 \pset border 2
2425 \pset format unaligned
2426 execute q;
2427 0123456789abcdef|xx
2428 0123456789|yyyyyyyyyyyyyyyyyy
2429
2430 0123456789abcdef|xxxx
2431 0123456789|yyyyyyyyyyyyyyyy
2432
2433 0123456789abcdef|xxxxxx
2434 0123456789|yyyyyyyyyyyyyy
2435
2436 0123456789abcdef|xxxxxxxx
2437 0123456789|yyyyyyyyyyyy
2438
2439 0123456789abcdef|xxxxxxxxxx
2440 0123456789|yyyyyyyyyy
2441
2442 0123456789abcdef|xxxxxxxxxxxx
2443 0123456789|yyyyyyyy
2444
2445 0123456789abcdef|xxxxxxxxxxxxxx
2446 0123456789|yyyyyy
2447
2448 0123456789abcdef|xxxxxxxxxxxxxxxx
2449 0123456789|yyyy
2450
2451 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2452 0123456789|yy
2453
2454 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2455 0123456789|
2456 \pset format aligned
2457 execute q;
2458 +-[ RECORD 1 ]-----+----------------------+
2459 | 0123456789abcdef | xx                   |
2460 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
2461 +-[ RECORD 2 ]-----+----------------------+
2462 | 0123456789abcdef | xxxx                 |
2463 | 0123456789       | yyyyyyyyyyyyyyyy     |
2464 +-[ RECORD 3 ]-----+----------------------+
2465 | 0123456789abcdef | xxxxxx               |
2466 | 0123456789       | yyyyyyyyyyyyyy       |
2467 +-[ RECORD 4 ]-----+----------------------+
2468 | 0123456789abcdef | xxxxxxxx             |
2469 | 0123456789       | yyyyyyyyyyyy         |
2470 +-[ RECORD 5 ]-----+----------------------+
2471 | 0123456789abcdef | xxxxxxxxxx           |
2472 | 0123456789       | yyyyyyyyyy           |
2473 +-[ RECORD 6 ]-----+----------------------+
2474 | 0123456789abcdef | xxxxxxxxxxxx         |
2475 | 0123456789       | yyyyyyyy             |
2476 +-[ RECORD 7 ]-----+----------------------+
2477 | 0123456789abcdef | xxxxxxxxxxxxxx       |
2478 | 0123456789       | yyyyyy               |
2479 +-[ RECORD 8 ]-----+----------------------+
2480 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
2481 | 0123456789       | yyyy                 |
2482 +-[ RECORD 9 ]-----+----------------------+
2483 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
2484 | 0123456789       | yy                   |
2485 +-[ RECORD 10 ]----+----------------------+
2486 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
2487 | 0123456789       |                      |
2488 +------------------+----------------------+
2489
2490 \pset format wrapped
2491 execute q;
2492 +-[ RECORD 1 ]-----+-------------------+
2493 | 0123456789abcdef | xx                |
2494 | 0123456789       | yyyyyyyyyyyyyyyyy |
2495 |                  ; y                 |
2496 +-[ RECORD 2 ]-----+-------------------+
2497 | 0123456789abcdef | xxxx              |
2498 | 0123456789       | yyyyyyyyyyyyyyyy  |
2499 +-[ RECORD 3 ]-----+-------------------+
2500 | 0123456789abcdef | xxxxxx            |
2501 | 0123456789       | yyyyyyyyyyyyyy    |
2502 +-[ RECORD 4 ]-----+-------------------+
2503 | 0123456789abcdef | xxxxxxxx          |
2504 | 0123456789       | yyyyyyyyyyyy      |
2505 +-[ RECORD 5 ]-----+-------------------+
2506 | 0123456789abcdef | xxxxxxxxxx        |
2507 | 0123456789       | yyyyyyyyyy        |
2508 +-[ RECORD 6 ]-----+-------------------+
2509 | 0123456789abcdef | xxxxxxxxxxxx      |
2510 | 0123456789       | yyyyyyyy          |
2511 +-[ RECORD 7 ]-----+-------------------+
2512 | 0123456789abcdef | xxxxxxxxxxxxxx    |
2513 | 0123456789       | yyyyyy            |
2514 +-[ RECORD 8 ]-----+-------------------+
2515 | 0123456789abcdef | xxxxxxxxxxxxxxxx  |
2516 | 0123456789       | yyyy              |
2517 +-[ RECORD 9 ]-----+-------------------+
2518 | 0123456789abcdef | xxxxxxxxxxxxxxxxx |
2519 |                  ; x                 |
2520 | 0123456789       | yy                |
2521 +-[ RECORD 10 ]----+-------------------+
2522 | 0123456789abcdef | xxxxxxxxxxxxxxxxx |
2523 |                  ; xxx               |
2524 | 0123456789       |                   |
2525 +------------------+-------------------+
2526
2527 deallocate q;
2528 \pset linestyle ascii
2529 prepare q as select ' | = | lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&' as " | -- | 012345678 9abc def!*@#&!@(*&*~~_+-=\ \", '11' as "0123456789", 11 as int from generate_series(1,10) as n;
2530 \pset format asciidoc
2531 \pset expanded off
2532 \pset border 0
2533 execute q;
2534
2535 [options="header",cols="<l,<l,>l",frame="none",grid="none"]
2536 |====
2537 ^l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ ^l|0123456789 ^l|int
2538 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2539 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2540 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2541 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2542 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2543 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2544 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2545 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2546 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2547 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2548 |====
2549
2550 ....
2551 (10 rows)
2552 ....
2553 \pset border 1
2554 execute q;
2555
2556 [options="header",cols="<l,<l,>l",frame="none"]
2557 |====
2558 ^l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ ^l|0123456789 ^l|int
2559 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2560 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2561 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2562 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2563 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2564 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2565 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2566 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2567 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2568 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2569 |====
2570
2571 ....
2572 (10 rows)
2573 ....
2574 \pset border 2
2575 execute q;
2576
2577 [options="header",cols="<l,<l,>l",frame="all",grid="all"]
2578 |====
2579 ^l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ ^l|0123456789 ^l|int
2580 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2581 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2582 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2583 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2584 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2585 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2586 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2587 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2588 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2589 | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
2590 |====
2591
2592 ....
2593 (10 rows)
2594 ....
2595 \pset expanded on
2596 \pset border 0
2597 execute q;
2598
2599 [cols="h,l",frame="none",grid="none"]
2600 |====
2601 2+^|Record 1
2602 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2603 <l|0123456789 <l|11
2604 <l|int >l|11
2605 2+^|Record 2
2606 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2607 <l|0123456789 <l|11
2608 <l|int >l|11
2609 2+^|Record 3
2610 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2611 <l|0123456789 <l|11
2612 <l|int >l|11
2613 2+^|Record 4
2614 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2615 <l|0123456789 <l|11
2616 <l|int >l|11
2617 2+^|Record 5
2618 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2619 <l|0123456789 <l|11
2620 <l|int >l|11
2621 2+^|Record 6
2622 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2623 <l|0123456789 <l|11
2624 <l|int >l|11
2625 2+^|Record 7
2626 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2627 <l|0123456789 <l|11
2628 <l|int >l|11
2629 2+^|Record 8
2630 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2631 <l|0123456789 <l|11
2632 <l|int >l|11
2633 2+^|Record 9
2634 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2635 <l|0123456789 <l|11
2636 <l|int >l|11
2637 2+^|Record 10
2638 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2639 <l|0123456789 <l|11
2640 <l|int >l|11
2641 |====
2642 \pset border 1
2643 execute q;
2644
2645 [cols="h,l",frame="none"]
2646 |====
2647 2+^|Record 1
2648 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2649 <l|0123456789 <l|11
2650 <l|int >l|11
2651 2+^|Record 2
2652 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2653 <l|0123456789 <l|11
2654 <l|int >l|11
2655 2+^|Record 3
2656 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2657 <l|0123456789 <l|11
2658 <l|int >l|11
2659 2+^|Record 4
2660 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2661 <l|0123456789 <l|11
2662 <l|int >l|11
2663 2+^|Record 5
2664 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2665 <l|0123456789 <l|11
2666 <l|int >l|11
2667 2+^|Record 6
2668 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2669 <l|0123456789 <l|11
2670 <l|int >l|11
2671 2+^|Record 7
2672 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2673 <l|0123456789 <l|11
2674 <l|int >l|11
2675 2+^|Record 8
2676 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2677 <l|0123456789 <l|11
2678 <l|int >l|11
2679 2+^|Record 9
2680 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2681 <l|0123456789 <l|11
2682 <l|int >l|11
2683 2+^|Record 10
2684 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2685 <l|0123456789 <l|11
2686 <l|int >l|11
2687 |====
2688 \pset border 2
2689 execute q;
2690
2691 [cols="h,l",frame="all",grid="all"]
2692 |====
2693 2+^|Record 1
2694 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2695 <l|0123456789 <l|11
2696 <l|int >l|11
2697 2+^|Record 2
2698 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2699 <l|0123456789 <l|11
2700 <l|int >l|11
2701 2+^|Record 3
2702 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2703 <l|0123456789 <l|11
2704 <l|int >l|11
2705 2+^|Record 4
2706 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2707 <l|0123456789 <l|11
2708 <l|int >l|11
2709 2+^|Record 5
2710 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2711 <l|0123456789 <l|11
2712 <l|int >l|11
2713 2+^|Record 6
2714 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2715 <l|0123456789 <l|11
2716 <l|int >l|11
2717 2+^|Record 7
2718 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2719 <l|0123456789 <l|11
2720 <l|int >l|11
2721 2+^|Record 8
2722 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2723 <l|0123456789 <l|11
2724 <l|int >l|11
2725 2+^|Record 9
2726 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2727 <l|0123456789 <l|11
2728 <l|int >l|11
2729 2+^|Record 10
2730 <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
2731 <l|0123456789 <l|11
2732 <l|int >l|11
2733 |====
2734 deallocate q;
2735 \pset format aligned
2736 \pset expanded off
2737 \pset border 1
2738 -- tests for \if ... \endif
2739 \if true
2740   select 'okay';
2741  ?column? 
2742 ----------
2743  okay
2744 (1 row)
2745
2746   select 'still okay';
2747   ?column?  
2748 ------------
2749  still okay
2750 (1 row)
2751
2752 \else
2753   not okay;
2754   still not okay
2755 \endif
2756 -- at this point query buffer should still have last valid line
2757 \g
2758   ?column?  
2759 ------------
2760  still okay
2761 (1 row)
2762
2763 -- \if should work okay on part of a query
2764 select
2765   \if true
2766     42
2767   \else
2768     (bogus
2769   \endif
2770   forty_two;
2771  forty_two 
2772 -----------
2773         42
2774 (1 row)
2775
2776 select \if false \\ (bogus \else \\ 42 \endif \\ forty_two;
2777  forty_two 
2778 -----------
2779         42
2780 (1 row)
2781
2782 -- test a large nested if using a variety of true-equivalents
2783 \if true
2784         \if 1
2785                 \if yes
2786                         \if on
2787                                 \echo 'all true'
2788 all true
2789                         \else
2790                                 \echo 'should not print #1-1'
2791                         \endif
2792                 \else
2793                         \echo 'should not print #1-2'
2794                 \endif
2795         \else
2796                 \echo 'should not print #1-3'
2797         \endif
2798 \else
2799         \echo 'should not print #1-4'
2800 \endif
2801 -- test a variety of false-equivalents in an if/elif/else structure
2802 \if false
2803         \echo 'should not print #2-1'
2804 \elif 0
2805         \echo 'should not print #2-2'
2806 \elif no
2807         \echo 'should not print #2-3'
2808 \elif off
2809         \echo 'should not print #2-4'
2810 \else
2811         \echo 'all false'
2812 all false
2813 \endif
2814 -- test simple true-then-else
2815 \if true
2816         \echo 'first thing true'
2817 first thing true
2818 \else
2819         \echo 'should not print #3-1'
2820 \endif
2821 -- test simple false-true-else
2822 \if false
2823         \echo 'should not print #4-1'
2824 \elif true
2825         \echo 'second thing true'
2826 second thing true
2827 \else
2828         \echo 'should not print #5-1'
2829 \endif
2830 -- invalid boolean expressions are false
2831 \if invalid boolean expression
2832 unrecognized value "invalid boolean expression" for "\if expression": boolean expected
2833         \echo 'will not print #6-1'
2834 \else
2835         \echo 'will print anyway #6-2'
2836 will print anyway #6-2
2837 \endif
2838 -- test un-matched endif
2839 \endif
2840 \endif: no matching \if
2841 -- test un-matched else
2842 \else
2843 \else: no matching \if
2844 -- test un-matched elif
2845 \elif
2846 \elif: no matching \if
2847 -- test double-else error
2848 \if true
2849 \else
2850 \else
2851 \else: cannot occur after \else
2852 \endif
2853 -- test elif out-of-order
2854 \if false
2855 \else
2856 \elif
2857 \elif: cannot occur after \else
2858 \endif
2859 -- test if-endif matching in a false branch
2860 \if false
2861     \if false
2862         \echo 'should not print #7-1'
2863     \else
2864         \echo 'should not print #7-2'
2865     \endif
2866     \echo 'should not print #7-3'
2867 \else
2868     \echo 'should print #7-4'
2869 should print #7-4
2870 \endif
2871 -- show that vars and backticks are not expanded when ignoring extra args
2872 \set foo bar
2873 \echo :foo :'foo' :"foo"
2874 bar 'bar' "bar"
2875 \pset fieldsep | `nosuchcommand` :foo :'foo' :"foo"
2876 \pset: extra argument "nosuchcommand" ignored
2877 \pset: extra argument ":foo" ignored
2878 \pset: extra argument ":'foo'" ignored
2879 \pset: extra argument ":"foo"" ignored
2880 -- show that vars and backticks are not expanded and commands are ignored
2881 -- when in a false if-branch
2882 \set try_to_quit '\\q'
2883 \if false
2884         :try_to_quit
2885         \echo `nosuchcommand` :foo :'foo' :"foo"
2886         \pset fieldsep | `nosuchcommand` :foo :'foo' :"foo"
2887         \a \C arg1 \c arg1 arg2 arg3 arg4 \cd arg1 \conninfo
2888         \copy arg1 arg2 arg3 arg4 arg5 arg6
2889         \copyright \dt arg1 \e arg1 arg2
2890         \ef whole_line
2891         \ev whole_line
2892         \echo arg1 arg2 arg3 arg4 arg5 \echo arg1 \encoding arg1 \errverbose
2893         \g arg1 \gx arg1 \gexec \h \html \i arg1 \ir arg1 \l arg1 \lo arg1 arg2
2894         \o arg1 \p \password arg1 \prompt arg1 arg2 \pset arg1 arg2 \q
2895         \reset \s arg1 \set arg1 arg2 arg3 arg4 arg5 arg6 arg7 \setenv arg1 arg2
2896         \sf whole_line
2897         \sv whole_line
2898         \t arg1 \T arg1 \timing arg1 \unset arg1 \w arg1 \watch arg1 \x arg1
2899         -- \else here is eaten as part of OT_FILEPIPE argument
2900         \w |/no/such/file \else
2901         -- \endif here is eaten as part of whole-line argument
2902         \! whole_line \endif
2903 \else
2904         \echo 'should print #8-1'
2905 should print #8-1
2906 \endif
2907 -- SHOW_CONTEXT
2908 \set SHOW_CONTEXT never
2909 do $$
2910 begin
2911   raise notice 'foo';
2912   raise exception 'bar';
2913 end $$;
2914 NOTICE:  foo
2915 ERROR:  bar
2916 \set SHOW_CONTEXT errors
2917 do $$
2918 begin
2919   raise notice 'foo';
2920   raise exception 'bar';
2921 end $$;
2922 NOTICE:  foo
2923 ERROR:  bar
2924 CONTEXT:  PL/pgSQL function inline_code_block line 4 at RAISE
2925 \set SHOW_CONTEXT always
2926 do $$
2927 begin
2928   raise notice 'foo';
2929   raise exception 'bar';
2930 end $$;
2931 NOTICE:  foo
2932 CONTEXT:  PL/pgSQL function inline_code_block line 3 at RAISE
2933 ERROR:  bar
2934 CONTEXT:  PL/pgSQL function inline_code_block line 4 at RAISE
2935 -- test printing and clearing the query buffer
2936 SELECT 1;
2937  ?column? 
2938 ----------
2939         1
2940 (1 row)
2941
2942 \p
2943 SELECT 1;
2944 SELECT 2 \r
2945 \p
2946 SELECT 1;
2947 SELECT 3 \p
2948 SELECT 3 
2949 UNION SELECT 4 \p
2950 SELECT 3 
2951 UNION SELECT 4 
2952 UNION SELECT 5
2953 ORDER BY 1;
2954  ?column? 
2955 ----------
2956         3
2957         4
2958         5
2959 (3 rows)
2960
2961 \r
2962 \p
2963 SELECT 3 
2964 UNION SELECT 4 
2965 UNION SELECT 5
2966 ORDER BY 1;