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