Consistently use "superuser" instead of "super user"
[pgsql.git] / src / test / regress / expected / psql.out
blob1b2f6bc418850aa9368f3674a8540f46cfa85d31
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
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
25 \set ON_ERROR_ROLLBACK on
26 \echo :ON_ERROR_ROLLBACK
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)
38 \gx
39 -[ RECORD 1 ]
40 one | 1
41 two | 2
43 SELECT 3 as three, 4 as four \gx
44 -[ RECORD 1 ]
45 three | 3
46 four  | 4
49  three | four 
50 -------+------
51      3 |    4
52 (1 row)
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)
62 \gx
63 -[ RECORD 1 ]
64 one | 1
65 two | 2
67 SELECT 3 as three, 4 as four \gx
68 -[ RECORD 1 ]
69 three | 3
70 four  | 4
73  three | four 
74 -------+------
75      3 |    4
76 (1 row)
78 \unset FETCH_COUNT
79 -- \g/\gx with pset options
80 SELECT 1 as one, 2 as two \g (format=csv csv_fieldsep='\t')
81 one     two
82 1       2
84  one | two 
85 -----+-----
86    1 |   2
87 (1 row)
89 SELECT 1 as one, 2 as two \gx (title='foo bar')
90 foo bar
91 -[ RECORD 1 ]
92 one | 1
93 two | 2
96  one | two 
97 -----+-----
98    1 |   2
99 (1 row)
101 -- \gset
102 select 10 as test01, 20 as test02, 'Hello' as test03 \gset pref01_
103 \echo :pref01_test01 :pref01_test02 :pref01_test03
104 10 20 Hello
105 -- should fail: bad variable name
106 select 10 as "bad name"
107 \gset
108 invalid variable name: "bad name"
109 select 97 as "EOF", 'ok' as _foo \gset IGNORE
110 attempt to \gset into specially treated variable "IGNOREEOF" ignored
111 \echo :IGNORE_foo :IGNOREEOF
112 ok 0
113 -- multiple backslash commands in one line
114 select 1 as x, 2 as y \gset pref01_ \\ \echo :pref01_x
116 select 3 as x, 4 as y \gset pref01_ \echo :pref01_x \echo :pref01_y
119 select 5 as x, 6 as y \gset pref01_ \\ \g \echo :pref01_x :pref01_y
120  x | y 
121 ---+---
122  5 | 6
123 (1 row)
125 5 6
126 select 7 as x, 8 as y \g \gset pref01_ \echo :pref01_x :pref01_y
127  x | y 
128 ---+---
129  7 | 8
130 (1 row)
132 7 8
133 -- NULL should unset the variable
134 \set var2 xyz
135 select 1 as var1, NULL as var2, 3 as var3 \gset
136 \echo :var1 :var2 :var3
137 1 :var2 3
138 -- \gset requires just one tuple
139 select 10 as test01, 20 as test02 from generate_series(1,3) \gset
140 more than one row returned for \gset
141 select 10 as test01, 20 as test02 from generate_series(1,0) \gset
142 no rows returned for \gset
143 -- \gset should work in FETCH_COUNT mode too
144 \set FETCH_COUNT 1
145 select 1 as x, 2 as y \gset pref01_ \\ \echo :pref01_x
147 select 3 as x, 4 as y \gset pref01_ \echo :pref01_x \echo :pref01_y
150 select 10 as test01, 20 as test02 from generate_series(1,3) \gset
151 more than one row returned for \gset
152 select 10 as test01, 20 as test02 from generate_series(1,0) \gset
153 no rows returned for \gset
154 \unset FETCH_COUNT
155 -- \gdesc
156 SELECT
157     NULL AS zero,
158     1 AS one,
159     2.0 AS two,
160     'three' AS three,
161     $1 AS four,
162     sin($2) as five,
163     'foo'::varchar(4) as six,
164     CURRENT_DATE AS now
165 \gdesc
166  Column |         Type         
167 --------+----------------------
168  zero   | text
169  one    | integer
170  two    | numeric
171  three  | text
172  four   | text
173  five   | double precision
174  six    | character varying(4)
175  now    | date
176 (8 rows)
178 -- should work with tuple-returning utilities, such as EXECUTE
179 PREPARE test AS SELECT 1 AS first, 2 AS second;
180 EXECUTE test \gdesc
181  Column |  Type   
182 --------+---------
183  first  | integer
184  second | integer
185 (2 rows)
187 EXPLAIN EXECUTE test \gdesc
188    Column   | Type 
189 ------------+------
190  QUERY PLAN | text
191 (1 row)
193 -- should fail cleanly - syntax error
194 SELECT 1 + \gdesc
195 ERROR:  syntax error at end of input
196 LINE 1: SELECT 1 + 
197                    ^
198 -- check behavior with empty results
199 SELECT \gdesc
200 The command has no result, or the result has no columns.
201 CREATE TABLE bububu(a int) \gdesc
202 The command has no result, or the result has no columns.
203 -- subject command should not have executed
204 TABLE bububu;  -- fail
205 ERROR:  relation "bububu" does not exist
206 LINE 1: TABLE bububu;
207               ^
208 -- query buffer should remain unchanged
209 SELECT 1 AS x, 'Hello', 2 AS y, true AS "dirty\name"
210 \gdesc
211    Column   |  Type   
212 ------------+---------
213  x          | integer
214  ?column?   | text
215  y          | integer
216  dirty\name | boolean
217 (4 rows)
220  x | ?column? | y | dirty\name 
221 ---+----------+---+------------
222  1 | Hello    | 2 | t
223 (1 row)
225 -- all on one line
226 SELECT 3 AS x, 'Hello', 4 AS y, true AS "dirty\name" \gdesc \g
227    Column   |  Type   
228 ------------+---------
229  x          | integer
230  ?column?   | text
231  y          | integer
232  dirty\name | boolean
233 (4 rows)
235  x | ?column? | y | dirty\name 
236 ---+----------+---+------------
237  3 | Hello    | 4 | t
238 (1 row)
240 -- \gexec
241 create temporary table gexec_test(a int, b text, c date, d float);
242 select format('create index on gexec_test(%I)', attname)
243 from pg_attribute
244 where attrelid = 'gexec_test'::regclass and attnum > 0
245 order by attnum
246 \gexec
247 create index on gexec_test(a)
248 create index on gexec_test(b)
249 create index on gexec_test(c)
250 create index on gexec_test(d)
251 -- \gexec should work in FETCH_COUNT mode too
252 -- (though the fetch limit applies to the executed queries not the meta query)
253 \set FETCH_COUNT 1
254 select 'select 1 as ones', 'select x.y, x.y*2 as double from generate_series(1,4) as x(y)'
255 union all
256 select 'drop table gexec_test', NULL
257 union all
258 select 'drop table gexec_test', 'select ''2000-01-01''::date as party_over'
259 \gexec
260 select 1 as ones
261  ones 
262 ------
263     1
264 (1 row)
266 select x.y, x.y*2 as double from generate_series(1,4) as x(y)
267  y | double 
268 ---+--------
269  1 |      2
270  2 |      4
271  3 |      6
272  4 |      8
273 (4 rows)
275 drop table gexec_test
276 drop table gexec_test
277 ERROR:  table "gexec_test" does not exist
278 select '2000-01-01'::date as party_over
279  party_over 
280 ------------
281  01-01-2000
282 (1 row)
284 \unset FETCH_COUNT
285 -- show all pset options
286 \pset
287 border                   1
288 columns                  0
289 csv_fieldsep             ','
290 expanded                 off
291 fieldsep                 '|'
292 fieldsep_zero            off
293 footer                   on
294 format                   aligned
295 linestyle                ascii
296 null                     ''
297 numericlocale            off
298 pager                    1
299 pager_min_lines          0
300 recordsep                '\n'
301 recordsep_zero           off
302 tableattr                
303 title                    
304 tuples_only              off
305 unicode_border_linestyle single
306 unicode_column_linestyle single
307 unicode_header_linestyle single
308 -- test multi-line headers, wrapping, and newline indicators
309 -- in aligned, unaligned, and wrapped formats
310 prepare q as select array_to_string(array_agg(repeat('x',2*n)),E'\n') as "ab
312 c", array_to_string(array_agg(repeat('y',20-2*n)),E'\n') as "a
313 bc" from generate_series(1,10) as n(n) group by n>1 order by n>1;
314 \pset linestyle ascii
315 \pset expanded off
316 \pset columns 40
317 \pset border 0
318 \pset format unaligned
319 execute q;
324 xx|yyyyyyyyyyyyyyyyyy
325 xxxx
326 xxxxxx
327 xxxxxxxx
328 xxxxxxxxxx
329 xxxxxxxxxxxx
330 xxxxxxxxxxxxxx
331 xxxxxxxxxxxxxxxx
332 xxxxxxxxxxxxxxxxxx
333 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
334 yyyyyyyyyyyyyy
335 yyyyyyyyyyyy
336 yyyyyyyyyy
337 yyyyyyyy
338 yyyyyy
339 yyyy
342 (2 rows)
343 \pset format aligned
344 execute q;
345          ab         +        a         +
346                     +        bc         
347          c                              
348 -------------------- ------------------
349 xx                   yyyyyyyyyyyyyyyyyy
350 xxxx                +yyyyyyyyyyyyyyyy  +
351 xxxxxx              +yyyyyyyyyyyyyy    +
352 xxxxxxxx            +yyyyyyyyyyyy      +
353 xxxxxxxxxx          +yyyyyyyyyy        +
354 xxxxxxxxxxxx        +yyyyyyyy          +
355 xxxxxxxxxxxxxx      +yyyyyy            +
356 xxxxxxxxxxxxxxxx    +yyyy              +
357 xxxxxxxxxxxxxxxxxx  +yy                +
358 xxxxxxxxxxxxxxxxxxxx 
359 (2 rows)
361 \pset format wrapped
362 execute q;
363          ab         +        a         +
364                     +        bc         
365          c                              
366 -------------------- ------------------
367 xx                   yyyyyyyyyyyyyyyyyy
368 xxxx                +yyyyyyyyyyyyyyyy  +
369 xxxxxx              +yyyyyyyyyyyyyy    +
370 xxxxxxxx            +yyyyyyyyyyyy      +
371 xxxxxxxxxx          +yyyyyyyyyy        +
372 xxxxxxxxxxxx        +yyyyyyyy          +
373 xxxxxxxxxxxxxx      +yyyyyy            +
374 xxxxxxxxxxxxxxxx    +yyyy              +
375 xxxxxxxxxxxxxxxxxx  +yy                +
376 xxxxxxxxxxxxxxxxxxxx 
377 (2 rows)
379 \pset border 1
380 \pset format unaligned
381 execute q;
386 xx|yyyyyyyyyyyyyyyyyy
387 xxxx
388 xxxxxx
389 xxxxxxxx
390 xxxxxxxxxx
391 xxxxxxxxxxxx
392 xxxxxxxxxxxxxx
393 xxxxxxxxxxxxxxxx
394 xxxxxxxxxxxxxxxxxx
395 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
396 yyyyyyyyyyyyyy
397 yyyyyyyyyyyy
398 yyyyyyyyyy
399 yyyyyyyy
400 yyyyyy
401 yyyy
404 (2 rows)
405 \pset format aligned
406 execute q;
407           ab         +|         a         +
408                      +|         bc         
409           c           |                    
410 ----------------------+--------------------
411  xx                   | yyyyyyyyyyyyyyyyyy
412  xxxx                +| yyyyyyyyyyyyyyyy  +
413  xxxxxx              +| yyyyyyyyyyyyyy    +
414  xxxxxxxx            +| yyyyyyyyyyyy      +
415  xxxxxxxxxx          +| yyyyyyyyyy        +
416  xxxxxxxxxxxx        +| yyyyyyyy          +
417  xxxxxxxxxxxxxx      +| yyyyyy            +
418  xxxxxxxxxxxxxxxx    +| yyyy              +
419  xxxxxxxxxxxxxxxxxx  +| yy                +
420  xxxxxxxxxxxxxxxxxxxx | 
421 (2 rows)
423 \pset format wrapped
424 execute q;
425         ab        +|         a         +
426                   +|         bc         
427          c         |                    
428 -------------------+--------------------
429  xx                | yyyyyyyyyyyyyyyyyy
430  xxxx             +| yyyyyyyyyyyyyyyy  +
431  xxxxxx           +| yyyyyyyyyyyyyy    +
432  xxxxxxxx         +| yyyyyyyyyyyy      +
433  xxxxxxxxxx       +| yyyyyyyyyy        +
434  xxxxxxxxxxxx     +| yyyyyyyy          +
435  xxxxxxxxxxxxxx   +| yyyyyy            +
436  xxxxxxxxxxxxxxxx +| yyyy              +
437  xxxxxxxxxxxxxxxxx.| yy                +
438 .x                +| 
439  xxxxxxxxxxxxxxxxx.| 
440 .xxx               | 
441 (2 rows)
443 \pset border 2
444 \pset format unaligned
445 execute q;
450 xx|yyyyyyyyyyyyyyyyyy
451 xxxx
452 xxxxxx
453 xxxxxxxx
454 xxxxxxxxxx
455 xxxxxxxxxxxx
456 xxxxxxxxxxxxxx
457 xxxxxxxxxxxxxxxx
458 xxxxxxxxxxxxxxxxxx
459 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
460 yyyyyyyyyyyyyy
461 yyyyyyyyyyyy
462 yyyyyyyyyy
463 yyyyyyyy
464 yyyyyy
465 yyyy
468 (2 rows)
469 \pset format aligned
470 execute q;
471 +----------------------+--------------------+
472 |          ab         +|         a         +|
473 |                     +|         bc         |
474 |          c           |                    |
475 +----------------------+--------------------+
476 | xx                   | yyyyyyyyyyyyyyyyyy |
477 | xxxx                +| yyyyyyyyyyyyyyyy  +|
478 | xxxxxx              +| yyyyyyyyyyyyyy    +|
479 | xxxxxxxx            +| yyyyyyyyyyyy      +|
480 | xxxxxxxxxx          +| yyyyyyyyyy        +|
481 | xxxxxxxxxxxx        +| yyyyyyyy          +|
482 | xxxxxxxxxxxxxx      +| yyyyyy            +|
483 | xxxxxxxxxxxxxxxx    +| yyyy              +|
484 | xxxxxxxxxxxxxxxxxx  +| yy                +|
485 | xxxxxxxxxxxxxxxxxxxx |                    |
486 +----------------------+--------------------+
487 (2 rows)
489 \pset format wrapped
490 execute q;
491 +-----------------+--------------------+
492 |       ab       +|         a         +|
493 |                +|         bc         |
494 |        c        |                    |
495 +-----------------+--------------------+
496 | xx              | yyyyyyyyyyyyyyyyyy |
497 | xxxx           +| yyyyyyyyyyyyyyyy  +|
498 | xxxxxx         +| yyyyyyyyyyyyyy    +|
499 | xxxxxxxx       +| yyyyyyyyyyyy      +|
500 | xxxxxxxxxx     +| yyyyyyyyyy        +|
501 | xxxxxxxxxxxx   +| yyyyyyyy          +|
502 | xxxxxxxxxxxxxx +| yyyyyy            +|
503 | xxxxxxxxxxxxxxx.| yyyy              +|
504 |.x              +| yy                +|
505 | xxxxxxxxxxxxxxx.|                    |
506 |.xxx            +|                    |
507 | xxxxxxxxxxxxxxx.|                    |
508 |.xxxxx           |                    |
509 +-----------------+--------------------+
510 (2 rows)
512 \pset expanded on
513 \pset columns 20
514 \pset border 0
515 \pset format unaligned
516 execute q;
519 c|xx
521 bc|yyyyyyyyyyyyyyyyyy
525 c|xxxx
526 xxxxxx
527 xxxxxxxx
528 xxxxxxxxxx
529 xxxxxxxxxxxx
530 xxxxxxxxxxxxxx
531 xxxxxxxxxxxxxxxx
532 xxxxxxxxxxxxxxxxxx
533 xxxxxxxxxxxxxxxxxxxx
535 bc|yyyyyyyyyyyyyyyy
536 yyyyyyyyyyyyyy
537 yyyyyyyyyyyy
538 yyyyyyyyyy
539 yyyyyyyy
540 yyyyyy
541 yyyy
544 \pset format aligned
545 execute q;
546 * Record 1            
547 ab+ xx
548   +
549 c  
550 a + yyyyyyyyyyyyyyyyyy
551 bc 
552 * Record 2            
553 ab+ xxxx                +
554   + xxxxxx              +
555 c   xxxxxxxx            +
556     xxxxxxxxxx          +
557     xxxxxxxxxxxx        +
558     xxxxxxxxxxxxxx      +
559     xxxxxxxxxxxxxxxx    +
560     xxxxxxxxxxxxxxxxxx  +
561     xxxxxxxxxxxxxxxxxxxx
562 a + yyyyyyyyyyyyyyyy    +
563 bc  yyyyyyyyyyyyyy      +
564     yyyyyyyyyyyy        +
565     yyyyyyyyyy          +
566     yyyyyyyy            +
567     yyyyyy              +
568     yyyy                +
569     yy                  +
570     
572 \pset format wrapped
573 execute q;
574 * Record 1       
575 ab+ xx
576   +
577 c  
578 a + yyyyyyyyyyyyyyy.
579 bc .yyy
580 * Record 2       
581 ab+ xxxx           +
582   + xxxxxx         +
583 c   xxxxxxxx       +
584     xxxxxxxxxx     +
585     xxxxxxxxxxxx   +
586     xxxxxxxxxxxxxx +
587     xxxxxxxxxxxxxxx.
588    .x              +
589     xxxxxxxxxxxxxxx.
590    .xxx            +
591     xxxxxxxxxxxxxxx.
592    .xxxxx
593 a + yyyyyyyyyyyyyyy.
594 bc .y              +
595     yyyyyyyyyyyyyy +
596     yyyyyyyyyyyy   +
597     yyyyyyyyyy     +
598     yyyyyyyy       +
599     yyyyyy         +
600     yyyy           +
601     yy             +
602     
604 \pset border 1
605 \pset format unaligned
606 execute q;
609 c|xx
611 bc|yyyyyyyyyyyyyyyyyy
615 c|xxxx
616 xxxxxx
617 xxxxxxxx
618 xxxxxxxxxx
619 xxxxxxxxxxxx
620 xxxxxxxxxxxxxx
621 xxxxxxxxxxxxxxxx
622 xxxxxxxxxxxxxxxxxx
623 xxxxxxxxxxxxxxxxxxxx
625 bc|yyyyyyyyyyyyyyyy
626 yyyyyyyyyyyyyy
627 yyyyyyyyyyyy
628 yyyyyyyyyy
629 yyyyyyyy
630 yyyyyy
631 yyyy
634 \pset format aligned
635 execute q;
636 -[ RECORD 1 ]------------
637 ab+| xx
638   +|
639 c  |
640 a +| yyyyyyyyyyyyyyyyyy
641 bc |
642 -[ RECORD 2 ]------------
643 ab+| xxxx                +
644   +| xxxxxx              +
645 c  | xxxxxxxx            +
646    | xxxxxxxxxx          +
647    | xxxxxxxxxxxx        +
648    | xxxxxxxxxxxxxx      +
649    | xxxxxxxxxxxxxxxx    +
650    | xxxxxxxxxxxxxxxxxx  +
651    | xxxxxxxxxxxxxxxxxxxx
652 a +| yyyyyyyyyyyyyyyy    +
653 bc | yyyyyyyyyyyyyy      +
654    | yyyyyyyyyyyy        +
655    | yyyyyyyyyy          +
656    | yyyyyyyy            +
657    | yyyyyy              +
658    | yyyy                +
659    | yy                  +
660    | 
662 \pset format wrapped
663 execute q;
664 -[ RECORD 1 ]------
665 ab+| xx
666   +|
667 c  |
668 a +| yyyyyyyyyyyyyy.
669 bc |.yyyy
670 -[ RECORD 2 ]------
671 ab+| xxxx          +
672   +| xxxxxx        +
673 c  | xxxxxxxx      +
674    | xxxxxxxxxx    +
675    | xxxxxxxxxxxx  +
676    | xxxxxxxxxxxxxx+
677    | xxxxxxxxxxxxxx.
678    |.xx            +
679    | xxxxxxxxxxxxxx.
680    |.xxxx          +
681    | xxxxxxxxxxxxxx.
682    |.xxxxxx
683 a +| yyyyyyyyyyyyyy.
684 bc |.yy            +
685    | yyyyyyyyyyyyyy+
686    | yyyyyyyyyyyy  +
687    | yyyyyyyyyy    +
688    | yyyyyyyy      +
689    | yyyyyy        +
690    | yyyy          +
691    | yy            +
692    | 
694 \pset border 2
695 \pset format unaligned
696 execute q;
699 c|xx
701 bc|yyyyyyyyyyyyyyyyyy
705 c|xxxx
706 xxxxxx
707 xxxxxxxx
708 xxxxxxxxxx
709 xxxxxxxxxxxx
710 xxxxxxxxxxxxxx
711 xxxxxxxxxxxxxxxx
712 xxxxxxxxxxxxxxxxxx
713 xxxxxxxxxxxxxxxxxxxx
715 bc|yyyyyyyyyyyyyyyy
716 yyyyyyyyyyyyyy
717 yyyyyyyyyyyy
718 yyyyyyyyyy
719 yyyyyyyy
720 yyyyyy
721 yyyy
724 \pset format aligned
725 execute q;
726 +-[ RECORD 1 ]--------------+
727 | ab+| xx                   |
728 |   +|                      |
729 | c  |                      |
730 | a +| yyyyyyyyyyyyyyyyyy   |
731 | bc |                      |
732 +-[ RECORD 2 ]--------------+
733 | ab+| xxxx                +|
734 |   +| xxxxxx              +|
735 | c  | xxxxxxxx            +|
736 |    | xxxxxxxxxx          +|
737 |    | xxxxxxxxxxxx        +|
738 |    | xxxxxxxxxxxxxx      +|
739 |    | xxxxxxxxxxxxxxxx    +|
740 |    | xxxxxxxxxxxxxxxxxx  +|
741 |    | xxxxxxxxxxxxxxxxxxxx |
742 | a +| yyyyyyyyyyyyyyyy    +|
743 | bc | yyyyyyyyyyyyyy      +|
744 |    | yyyyyyyyyyyy        +|
745 |    | yyyyyyyyyy          +|
746 |    | yyyyyyyy            +|
747 |    | yyyyyy              +|
748 |    | yyyy                +|
749 |    | yy                  +|
750 |    |                      |
751 +----+----------------------+
753 \pset format wrapped
754 execute q;
755 +-[ RECORD 1 ]-----+
756 | ab+| xx          |
757 |   +|             |
758 | c  |             |
759 | a +| yyyyyyyyyyy.|
760 | bc |.yyyyyyy     |
761 +-[ RECORD 2 ]-----+
762 | ab+| xxxx       +|
763 |   +| xxxxxx     +|
764 | c  | xxxxxxxx   +|
765 |    | xxxxxxxxxx +|
766 |    | xxxxxxxxxxx.|
767 |    |.x          +|
768 |    | xxxxxxxxxxx.|
769 |    |.xxx        +|
770 |    | xxxxxxxxxxx.|
771 |    |.xxxxx      +|
772 |    | xxxxxxxxxxx.|
773 |    |.xxxxxxx    +|
774 |    | xxxxxxxxxxx.|
775 |    |.xxxxxxxxx   |
776 | a +| yyyyyyyyyyy.|
777 | bc |.yyyyy      +|
778 |    | yyyyyyyyyyy.|
779 |    |.yyy        +|
780 |    | yyyyyyyyyyy.|
781 |    |.y          +|
782 |    | yyyyyyyyyy +|
783 |    | yyyyyyyy   +|
784 |    | yyyyyy     +|
785 |    | yyyy       +|
786 |    | yy         +|
787 |    |             |
788 +----+-------------+
790 \pset linestyle old-ascii
791 \pset expanded off
792 \pset columns 40
793 \pset border 0
794 \pset format unaligned
795 execute q;
800 xx|yyyyyyyyyyyyyyyyyy
801 xxxx
802 xxxxxx
803 xxxxxxxx
804 xxxxxxxxxx
805 xxxxxxxxxxxx
806 xxxxxxxxxxxxxx
807 xxxxxxxxxxxxxxxx
808 xxxxxxxxxxxxxxxxxx
809 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
810 yyyyyyyyyyyyyy
811 yyyyyyyyyyyy
812 yyyyyyyyyy
813 yyyyyyyy
814 yyyyyy
815 yyyy
818 (2 rows)
819 \pset format aligned
820 execute q;
821          ab                  a         
822                     +        bc        
823          c          +                  
824 -------------------- ------------------
825 xx                   yyyyyyyyyyyyyyyyyy
826 xxxx                 yyyyyyyyyyyyyyyy   
827 xxxxxx               yyyyyyyyyyyyyy     
828 xxxxxxxx             yyyyyyyyyyyy       
829 xxxxxxxxxx           yyyyyyyyyy         
830 xxxxxxxxxxxx         yyyyyyyy           
831 xxxxxxxxxxxxxx       yyyyyy             
832 xxxxxxxxxxxxxxxx     yyyy               
833 xxxxxxxxxxxxxxxxxx   yy                 
834 xxxxxxxxxxxxxxxxxxxx 
835 (2 rows)
837 \pset format wrapped
838 execute q;
839          ab                  a         
840                     +        bc        
841          c          +                  
842 -------------------- ------------------
843 xx                   yyyyyyyyyyyyyyyyyy
844 xxxx                 yyyyyyyyyyyyyyyy   
845 xxxxxx               yyyyyyyyyyyyyy     
846 xxxxxxxx             yyyyyyyyyyyy       
847 xxxxxxxxxx           yyyyyyyyyy         
848 xxxxxxxxxxxx         yyyyyyyy           
849 xxxxxxxxxxxxxx       yyyyyy             
850 xxxxxxxxxxxxxxxx     yyyy               
851 xxxxxxxxxxxxxxxxxx   yy                 
852 xxxxxxxxxxxxxxxxxxxx 
853 (2 rows)
855 \pset border 1
856 \pset format unaligned
857 execute q;
862 xx|yyyyyyyyyyyyyyyyyy
863 xxxx
864 xxxxxx
865 xxxxxxxx
866 xxxxxxxxxx
867 xxxxxxxxxxxx
868 xxxxxxxxxxxxxx
869 xxxxxxxxxxxxxxxx
870 xxxxxxxxxxxxxxxxxx
871 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
872 yyyyyyyyyyyyyy
873 yyyyyyyyyyyy
874 yyyyyyyyyy
875 yyyyyyyy
876 yyyyyy
877 yyyy
880 (2 rows)
881 \pset format aligned
882 execute q;
883           ab          |         a          
884 +                     |+        bc         
885 +         c           |+                   
886 ----------------------+--------------------
887  xx                   | yyyyyyyyyyyyyyyyyy
888  xxxx                 | yyyyyyyyyyyyyyyy   
889  xxxxxx               : yyyyyyyyyyyyyy     
890  xxxxxxxx             : yyyyyyyyyyyy       
891  xxxxxxxxxx           : yyyyyyyyyy         
892  xxxxxxxxxxxx         : yyyyyyyy           
893  xxxxxxxxxxxxxx       : yyyyyy             
894  xxxxxxxxxxxxxxxx     : yyyy               
895  xxxxxxxxxxxxxxxxxx   : yy                 
896  xxxxxxxxxxxxxxxxxxxx : 
897 (2 rows)
899 \pset format wrapped
900 execute q;
901         ab         |         a          
902 +                  |+        bc         
903 +        c         |+                   
904 -------------------+--------------------
905  xx                | yyyyyyyyyyyyyyyyyy
906  xxxx              | yyyyyyyyyyyyyyyy   
907  xxxxxx            : yyyyyyyyyyyyyy     
908  xxxxxxxx          : yyyyyyyyyyyy       
909  xxxxxxxxxx        : yyyyyyyyyy         
910  xxxxxxxxxxxx      : yyyyyyyy           
911  xxxxxxxxxxxxxx    : yyyyyy             
912  xxxxxxxxxxxxxxxx  : yyyy               
913  xxxxxxxxxxxxxxxxx : yy                 
914  x                 : 
915  xxxxxxxxxxxxxxxxx   
916  xxx                 
917 (2 rows)
919 \pset border 2
920 \pset format unaligned
921 execute q;
926 xx|yyyyyyyyyyyyyyyyyy
927 xxxx
928 xxxxxx
929 xxxxxxxx
930 xxxxxxxxxx
931 xxxxxxxxxxxx
932 xxxxxxxxxxxxxx
933 xxxxxxxxxxxxxxxx
934 xxxxxxxxxxxxxxxxxx
935 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
936 yyyyyyyyyyyyyy
937 yyyyyyyyyyyy
938 yyyyyyyyyy
939 yyyyyyyy
940 yyyyyy
941 yyyy
944 (2 rows)
945 \pset format aligned
946 execute q;
947 +----------------------+--------------------+
948 |          ab          |         a          |
949 |+                     |+        bc         |
950 |+         c           |+                   |
951 +----------------------+--------------------+
952 | xx                   | yyyyyyyyyyyyyyyyyy |
953 | xxxx                 | yyyyyyyyyyyyyyyy   |
954 | xxxxxx               : yyyyyyyyyyyyyy     |
955 | xxxxxxxx             : yyyyyyyyyyyy       |
956 | xxxxxxxxxx           : yyyyyyyyyy         |
957 | xxxxxxxxxxxx         : yyyyyyyy           |
958 | xxxxxxxxxxxxxx       : yyyyyy             |
959 | xxxxxxxxxxxxxxxx     : yyyy               |
960 | xxxxxxxxxxxxxxxxxx   : yy                 |
961 | xxxxxxxxxxxxxxxxxxxx :                    |
962 +----------------------+--------------------+
963 (2 rows)
965 \pset format wrapped
966 execute q;
967 +-----------------+--------------------+
968 |       ab        |         a          |
969 |+                |+        bc         |
970 |+       c        |+                   |
971 +-----------------+--------------------+
972 | xx              | yyyyyyyyyyyyyyyyyy |
973 | xxxx            | yyyyyyyyyyyyyyyy   |
974 | xxxxxx          : yyyyyyyyyyyyyy     |
975 | xxxxxxxx        : yyyyyyyyyyyy       |
976 | xxxxxxxxxx      : yyyyyyyyyy         |
977 | xxxxxxxxxxxx    : yyyyyyyy           |
978 | xxxxxxxxxxxxxx  : yyyyyy             |
979 | xxxxxxxxxxxxxxx : yyyy               |
980 | x               : yy                 |
981 | xxxxxxxxxxxxxxx :                    |
982 | xxx                                  |
983 | xxxxxxxxxxxxxxx                      |
984 | xxxxx                                |
985 +-----------------+--------------------+
986 (2 rows)
988 \pset expanded on
989 \pset columns 20
990 \pset border 0
991 \pset format unaligned
992 execute q;
995 c|xx
997 bc|yyyyyyyyyyyyyyyyyy
1001 c|xxxx
1002 xxxxxx
1003 xxxxxxxx
1004 xxxxxxxxxx
1005 xxxxxxxxxxxx
1006 xxxxxxxxxxxxxx
1007 xxxxxxxxxxxxxxxx
1008 xxxxxxxxxxxxxxxxxx
1009 xxxxxxxxxxxxxxxxxxxx
1011 bc|yyyyyyyyyyyyyyyy
1012 yyyyyyyyyyyyyy
1013 yyyyyyyyyyyy
1014 yyyyyyyyyy
1015 yyyyyyyy
1016 yyyyyy
1017 yyyy
1020 \pset format aligned
1021 execute q;
1022 * Record 1             
1023  ab xx
1024 +  
1025 +c 
1026  a  yyyyyyyyyyyyyyyyyy
1028 * Record 2             
1029  ab xxxx
1030 +   xxxxxx
1031 +c  xxxxxxxx
1032     xxxxxxxxxx
1033     xxxxxxxxxxxx
1034     xxxxxxxxxxxxxx
1035     xxxxxxxxxxxxxxxx
1036     xxxxxxxxxxxxxxxxxx
1037     xxxxxxxxxxxxxxxxxxxx
1038  a  yyyyyyyyyyyyyyyy
1039 +bc yyyyyyyyyyyyyy
1040     yyyyyyyyyyyy
1041     yyyyyyyyyy
1042     yyyyyyyy
1043     yyyyyy
1044     yyyy
1045     yy
1046     
1048 \pset format wrapped
1049 execute q;
1050 * Record 1         
1051  ab xx
1052 +  
1053 +c 
1054  a  yyyyyyyyyyyyyyyy
1055 +bc yy
1056 * Record 2         
1057  ab xxxx
1058 +   xxxxxx
1059 +c  xxxxxxxx
1060     xxxxxxxxxx
1061     xxxxxxxxxxxx
1062     xxxxxxxxxxxxxx
1063     xxxxxxxxxxxxxxxx
1064     xxxxxxxxxxxxxxxx
1065     xx
1066     xxxxxxxxxxxxxxxx
1067     xxxx
1068  a  yyyyyyyyyyyyyyyy
1069 +bc yyyyyyyyyyyyyy
1070     yyyyyyyyyyyy
1071     yyyyyyyyyy
1072     yyyyyyyy
1073     yyyyyy
1074     yyyy
1075     yy
1076     
1078 \pset border 1
1079 \pset format unaligned
1080 execute q;
1083 c|xx
1085 bc|yyyyyyyyyyyyyyyyyy
1089 c|xxxx
1090 xxxxxx
1091 xxxxxxxx
1092 xxxxxxxxxx
1093 xxxxxxxxxxxx
1094 xxxxxxxxxxxxxx
1095 xxxxxxxxxxxxxxxx
1096 xxxxxxxxxxxxxxxxxx
1097 xxxxxxxxxxxxxxxxxxxx
1099 bc|yyyyyyyyyyyyyyyy
1100 yyyyyyyyyyyyyy
1101 yyyyyyyyyyyy
1102 yyyyyyyyyy
1103 yyyyyyyy
1104 yyyyyy
1105 yyyy
1108 \pset format aligned
1109 execute q;
1110 -[ RECORD 1 ]-------------
1111  ab | xx
1112 +   ;
1113 +c  ;
1114  a  | yyyyyyyyyyyyyyyyyy
1115 +bc ;
1116 -[ RECORD 2 ]-------------
1117  ab | xxxx
1118 +   : xxxxxx
1119 +c  : xxxxxxxx
1120     : xxxxxxxxxx
1121     : xxxxxxxxxxxx
1122     : xxxxxxxxxxxxxx
1123     : xxxxxxxxxxxxxxxx
1124     : xxxxxxxxxxxxxxxxxx
1125     : xxxxxxxxxxxxxxxxxxxx
1126  a  | yyyyyyyyyyyyyyyy
1127 +bc : yyyyyyyyyyyyyy
1128     : yyyyyyyyyyyy
1129     : yyyyyyyyyy
1130     : yyyyyyyy
1131     : yyyyyy
1132     : yyyy
1133     : yy
1134     : 
1136 \pset format wrapped
1137 execute q;
1138 -[ RECORD 1 ]-------
1139  ab | xx
1140 +   ;
1141 +c  ;
1142  a  | yyyyyyyyyyyyyy
1143 +bc ; yyyy
1144 -[ RECORD 2 ]-------
1145  ab | xxxx
1146 +   : xxxxxx
1147 +c  : xxxxxxxx
1148     : xxxxxxxxxx
1149     : xxxxxxxxxxxx
1150     : xxxxxxxxxxxxxx
1151     : xxxxxxxxxxxxxx
1152     ; xx
1153     : xxxxxxxxxxxxxx
1154     ; xxxx
1155     : xxxxxxxxxxxxxx
1156     ; xxxxxx
1157  a  | yyyyyyyyyyyyyy
1158 +bc ; yy
1159     : yyyyyyyyyyyyyy
1160     : yyyyyyyyyyyy
1161     : yyyyyyyyyy
1162     : yyyyyyyy
1163     : yyyyyy
1164     : yyyy
1165     : yy
1166     : 
1168 \pset border 2
1169 \pset format unaligned
1170 execute q;
1173 c|xx
1175 bc|yyyyyyyyyyyyyyyyyy
1179 c|xxxx
1180 xxxxxx
1181 xxxxxxxx
1182 xxxxxxxxxx
1183 xxxxxxxxxxxx
1184 xxxxxxxxxxxxxx
1185 xxxxxxxxxxxxxxxx
1186 xxxxxxxxxxxxxxxxxx
1187 xxxxxxxxxxxxxxxxxxxx
1189 bc|yyyyyyyyyyyyyyyy
1190 yyyyyyyyyyyyyy
1191 yyyyyyyyyyyy
1192 yyyyyyyyyy
1193 yyyyyyyy
1194 yyyyyy
1195 yyyy
1198 \pset format aligned
1199 execute q;
1200 +-[ RECORD 1 ]--------------+
1201 | ab | xx                   |
1202 |+   ;                      |
1203 |+c  ;                      |
1204 | a  | yyyyyyyyyyyyyyyyyy   |
1205 |+bc ;                      |
1206 +-[ RECORD 2 ]--------------+
1207 | ab | xxxx                 |
1208 |+   : xxxxxx               |
1209 |+c  : xxxxxxxx             |
1210 |    : xxxxxxxxxx           |
1211 |    : xxxxxxxxxxxx         |
1212 |    : xxxxxxxxxxxxxx       |
1213 |    : xxxxxxxxxxxxxxxx     |
1214 |    : xxxxxxxxxxxxxxxxxx   |
1215 |    : xxxxxxxxxxxxxxxxxxxx |
1216 | a  | yyyyyyyyyyyyyyyy     |
1217 |+bc : yyyyyyyyyyyyyy       |
1218 |    : yyyyyyyyyyyy         |
1219 |    : yyyyyyyyyy           |
1220 |    : yyyyyyyy             |
1221 |    : yyyyyy               |
1222 |    : yyyy                 |
1223 |    : yy                   |
1224 |    :                      |
1225 +----+----------------------+
1227 \pset format wrapped
1228 execute q;
1229 +-[ RECORD 1 ]-----+
1230 | ab | xx          |
1231 |+   ;             |
1232 |+c  ;             |
1233 | a  | yyyyyyyyyyy |
1234 |+bc ; yyyyyyy     |
1235 +-[ RECORD 2 ]-----+
1236 | ab | xxxx        |
1237 |+   : xxxxxx      |
1238 |+c  : xxxxxxxx    |
1239 |    : xxxxxxxxxx  |
1240 |    : xxxxxxxxxxx |
1241 |    ; x           |
1242 |    : xxxxxxxxxxx |
1243 |    ; xxx         |
1244 |    : xxxxxxxxxxx |
1245 |    ; xxxxx       |
1246 |    : xxxxxxxxxxx |
1247 |    ; xxxxxxx     |
1248 |    : xxxxxxxxxxx |
1249 |    ; xxxxxxxxx   |
1250 | a  | yyyyyyyyyyy |
1251 |+bc ; yyyyy       |
1252 |    : yyyyyyyyyyy |
1253 |    ; yyy         |
1254 |    : yyyyyyyyyyy |
1255 |    ; y           |
1256 |    : yyyyyyyyyy  |
1257 |    : yyyyyyyy    |
1258 |    : yyyyyy      |
1259 |    : yyyy        |
1260 |    : yy          |
1261 |    :             |
1262 +----+-------------+
1264 deallocate q;
1265 -- test single-line header and data
1266 prepare q as select repeat('x',2*n) as "0123456789abcdef", repeat('y',20-2*n) as "0123456789" from generate_series(1,10) as n;
1267 \pset linestyle ascii
1268 \pset expanded off
1269 \pset columns 40
1270 \pset border 0
1271 \pset format unaligned
1272 execute q;
1273 0123456789abcdef|0123456789
1274 xx|yyyyyyyyyyyyyyyyyy
1275 xxxx|yyyyyyyyyyyyyyyy
1276 xxxxxx|yyyyyyyyyyyyyy
1277 xxxxxxxx|yyyyyyyyyyyy
1278 xxxxxxxxxx|yyyyyyyyyy
1279 xxxxxxxxxxxx|yyyyyyyy
1280 xxxxxxxxxxxxxx|yyyyyy
1281 xxxxxxxxxxxxxxxx|yyyy
1282 xxxxxxxxxxxxxxxxxx|yy
1283 xxxxxxxxxxxxxxxxxxxx|
1284 (10 rows)
1285 \pset format aligned
1286 execute q;
1287   0123456789abcdef       0123456789     
1288 -------------------- ------------------
1289 xx                   yyyyyyyyyyyyyyyyyy
1290 xxxx                 yyyyyyyyyyyyyyyy
1291 xxxxxx               yyyyyyyyyyyyyy
1292 xxxxxxxx             yyyyyyyyyyyy
1293 xxxxxxxxxx           yyyyyyyyyy
1294 xxxxxxxxxxxx         yyyyyyyy
1295 xxxxxxxxxxxxxx       yyyyyy
1296 xxxxxxxxxxxxxxxx     yyyy
1297 xxxxxxxxxxxxxxxxxx   yy
1298 xxxxxxxxxxxxxxxxxxxx 
1299 (10 rows)
1301 \pset format wrapped
1302 execute q;
1303   0123456789abcdef       0123456789     
1304 -------------------- ------------------
1305 xx                   yyyyyyyyyyyyyyyyyy
1306 xxxx                 yyyyyyyyyyyyyyyy
1307 xxxxxx               yyyyyyyyyyyyyy
1308 xxxxxxxx             yyyyyyyyyyyy
1309 xxxxxxxxxx           yyyyyyyyyy
1310 xxxxxxxxxxxx         yyyyyyyy
1311 xxxxxxxxxxxxxx       yyyyyy
1312 xxxxxxxxxxxxxxxx     yyyy
1313 xxxxxxxxxxxxxxxxxx   yy
1314 xxxxxxxxxxxxxxxxxxxx 
1315 (10 rows)
1317 \pset border 1
1318 \pset format unaligned
1319 execute q;
1320 0123456789abcdef|0123456789
1321 xx|yyyyyyyyyyyyyyyyyy
1322 xxxx|yyyyyyyyyyyyyyyy
1323 xxxxxx|yyyyyyyyyyyyyy
1324 xxxxxxxx|yyyyyyyyyyyy
1325 xxxxxxxxxx|yyyyyyyyyy
1326 xxxxxxxxxxxx|yyyyyyyy
1327 xxxxxxxxxxxxxx|yyyyyy
1328 xxxxxxxxxxxxxxxx|yyyy
1329 xxxxxxxxxxxxxxxxxx|yy
1330 xxxxxxxxxxxxxxxxxxxx|
1331 (10 rows)
1332 \pset format aligned
1333 execute q;
1334    0123456789abcdef   |     0123456789     
1335 ----------------------+--------------------
1336  xx                   | yyyyyyyyyyyyyyyyyy
1337  xxxx                 | yyyyyyyyyyyyyyyy
1338  xxxxxx               | yyyyyyyyyyyyyy
1339  xxxxxxxx             | yyyyyyyyyyyy
1340  xxxxxxxxxx           | yyyyyyyyyy
1341  xxxxxxxxxxxx         | yyyyyyyy
1342  xxxxxxxxxxxxxx       | yyyyyy
1343  xxxxxxxxxxxxxxxx     | yyyy
1344  xxxxxxxxxxxxxxxxxx   | yy
1345  xxxxxxxxxxxxxxxxxxxx | 
1346 (10 rows)
1348 \pset format wrapped
1349 execute q;
1350   0123456789abcdef   |    0123456789    
1351 ---------------------+------------------
1352  xx                  | yyyyyyyyyyyyyyyy.
1353                      |.yy
1354  xxxx                | yyyyyyyyyyyyyyyy
1355  xxxxxx              | yyyyyyyyyyyyyy
1356  xxxxxxxx            | yyyyyyyyyyyy
1357  xxxxxxxxxx          | yyyyyyyyyy
1358  xxxxxxxxxxxx        | yyyyyyyy
1359  xxxxxxxxxxxxxx      | yyyyyy
1360  xxxxxxxxxxxxxxxx    | yyyy
1361  xxxxxxxxxxxxxxxxxx  | yy
1362  xxxxxxxxxxxxxxxxxxx.| 
1363 .x                   | 
1364 (10 rows)
1366 \pset border 2
1367 \pset format unaligned
1368 execute q;
1369 0123456789abcdef|0123456789
1370 xx|yyyyyyyyyyyyyyyyyy
1371 xxxx|yyyyyyyyyyyyyyyy
1372 xxxxxx|yyyyyyyyyyyyyy
1373 xxxxxxxx|yyyyyyyyyyyy
1374 xxxxxxxxxx|yyyyyyyyyy
1375 xxxxxxxxxxxx|yyyyyyyy
1376 xxxxxxxxxxxxxx|yyyyyy
1377 xxxxxxxxxxxxxxxx|yyyy
1378 xxxxxxxxxxxxxxxxxx|yy
1379 xxxxxxxxxxxxxxxxxxxx|
1380 (10 rows)
1381 \pset format aligned
1382 execute q;
1383 +----------------------+--------------------+
1384 |   0123456789abcdef   |     0123456789     |
1385 +----------------------+--------------------+
1386 | xx                   | yyyyyyyyyyyyyyyyyy |
1387 | xxxx                 | yyyyyyyyyyyyyyyy   |
1388 | xxxxxx               | yyyyyyyyyyyyyy     |
1389 | xxxxxxxx             | yyyyyyyyyyyy       |
1390 | xxxxxxxxxx           | yyyyyyyyyy         |
1391 | xxxxxxxxxxxx         | yyyyyyyy           |
1392 | xxxxxxxxxxxxxx       | yyyyyy             |
1393 | xxxxxxxxxxxxxxxx     | yyyy               |
1394 | xxxxxxxxxxxxxxxxxx   | yy                 |
1395 | xxxxxxxxxxxxxxxxxxxx |                    |
1396 +----------------------+--------------------+
1397 (10 rows)
1399 \pset format wrapped
1400 execute q;
1401 +--------------------+-----------------+
1402 |  0123456789abcdef  |   0123456789    |
1403 +--------------------+-----------------+
1404 | xx                 | yyyyyyyyyyyyyyy.|
1405 |                    |.yyy             |
1406 | xxxx               | yyyyyyyyyyyyyyy.|
1407 |                    |.y               |
1408 | xxxxxx             | yyyyyyyyyyyyyy  |
1409 | xxxxxxxx           | yyyyyyyyyyyy    |
1410 | xxxxxxxxxx         | yyyyyyyyyy      |
1411 | xxxxxxxxxxxx       | yyyyyyyy        |
1412 | xxxxxxxxxxxxxx     | yyyyyy          |
1413 | xxxxxxxxxxxxxxxx   | yyyy            |
1414 | xxxxxxxxxxxxxxxxxx | yy              |
1415 | xxxxxxxxxxxxxxxxxx.|                 |
1416 |.xx                 |                 |
1417 +--------------------+-----------------+
1418 (10 rows)
1420 \pset expanded on
1421 \pset columns 30
1422 \pset border 0
1423 \pset format unaligned
1424 execute q;
1425 0123456789abcdef|xx
1426 0123456789|yyyyyyyyyyyyyyyyyy
1428 0123456789abcdef|xxxx
1429 0123456789|yyyyyyyyyyyyyyyy
1431 0123456789abcdef|xxxxxx
1432 0123456789|yyyyyyyyyyyyyy
1434 0123456789abcdef|xxxxxxxx
1435 0123456789|yyyyyyyyyyyy
1437 0123456789abcdef|xxxxxxxxxx
1438 0123456789|yyyyyyyyyy
1440 0123456789abcdef|xxxxxxxxxxxx
1441 0123456789|yyyyyyyy
1443 0123456789abcdef|xxxxxxxxxxxxxx
1444 0123456789|yyyyyy
1446 0123456789abcdef|xxxxxxxxxxxxxxxx
1447 0123456789|yyyy
1449 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1450 0123456789|yy
1452 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1453 0123456789|
1454 \pset format aligned
1455 execute q;
1456 * Record 1                          
1457 0123456789abcdef xx
1458 0123456789       yyyyyyyyyyyyyyyyyy
1459 * Record 2                          
1460 0123456789abcdef xxxx
1461 0123456789       yyyyyyyyyyyyyyyy
1462 * Record 3                          
1463 0123456789abcdef xxxxxx
1464 0123456789       yyyyyyyyyyyyyy
1465 * Record 4                          
1466 0123456789abcdef xxxxxxxx
1467 0123456789       yyyyyyyyyyyy
1468 * Record 5                          
1469 0123456789abcdef xxxxxxxxxx
1470 0123456789       yyyyyyyyyy
1471 * Record 6                          
1472 0123456789abcdef xxxxxxxxxxxx
1473 0123456789       yyyyyyyy
1474 * Record 7                          
1475 0123456789abcdef xxxxxxxxxxxxxx
1476 0123456789       yyyyyy
1477 * Record 8                          
1478 0123456789abcdef xxxxxxxxxxxxxxxx
1479 0123456789       yyyy
1480 * Record 9                          
1481 0123456789abcdef xxxxxxxxxxxxxxxxxx
1482 0123456789       yy
1483 * Record 10                         
1484 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
1485 0123456789       
1487 \pset format wrapped
1488 execute q;
1489 * Record 1                  
1490 0123456789abcdef xx
1491 0123456789       yyyyyyyyyyyy.
1492                 .yyyyyy
1493 * Record 2                  
1494 0123456789abcdef xxxx
1495 0123456789       yyyyyyyyyyyy.
1496                 .yyyy
1497 * Record 3                  
1498 0123456789abcdef xxxxxx
1499 0123456789       yyyyyyyyyyyy.
1500                 .yy
1501 * Record 4                  
1502 0123456789abcdef xxxxxxxx
1503 0123456789       yyyyyyyyyyyy
1504 * Record 5                  
1505 0123456789abcdef xxxxxxxxxx
1506 0123456789       yyyyyyyyyy
1507 * Record 6                  
1508 0123456789abcdef xxxxxxxxxxxx
1509 0123456789       yyyyyyyy
1510 * Record 7                  
1511 0123456789abcdef xxxxxxxxxxxx.
1512                 .xx
1513 0123456789       yyyyyy
1514 * Record 8                  
1515 0123456789abcdef xxxxxxxxxxxx.
1516                 .xxxx
1517 0123456789       yyyy
1518 * Record 9                  
1519 0123456789abcdef xxxxxxxxxxxx.
1520                 .xxxxxx
1521 0123456789       yy
1522 * Record 10                 
1523 0123456789abcdef xxxxxxxxxxxx.
1524                 .xxxxxxxx
1525 0123456789       
1527 \pset border 1
1528 \pset format unaligned
1529 execute q;
1530 0123456789abcdef|xx
1531 0123456789|yyyyyyyyyyyyyyyyyy
1533 0123456789abcdef|xxxx
1534 0123456789|yyyyyyyyyyyyyyyy
1536 0123456789abcdef|xxxxxx
1537 0123456789|yyyyyyyyyyyyyy
1539 0123456789abcdef|xxxxxxxx
1540 0123456789|yyyyyyyyyyyy
1542 0123456789abcdef|xxxxxxxxxx
1543 0123456789|yyyyyyyyyy
1545 0123456789abcdef|xxxxxxxxxxxx
1546 0123456789|yyyyyyyy
1548 0123456789abcdef|xxxxxxxxxxxxxx
1549 0123456789|yyyyyy
1551 0123456789abcdef|xxxxxxxxxxxxxxxx
1552 0123456789|yyyy
1554 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1555 0123456789|yy
1557 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1558 0123456789|
1559 \pset format aligned
1560 execute q;
1561 -[ RECORD 1 ]----+---------------------
1562 0123456789abcdef | xx
1563 0123456789       | yyyyyyyyyyyyyyyyyy
1564 -[ RECORD 2 ]----+---------------------
1565 0123456789abcdef | xxxx
1566 0123456789       | yyyyyyyyyyyyyyyy
1567 -[ RECORD 3 ]----+---------------------
1568 0123456789abcdef | xxxxxx
1569 0123456789       | yyyyyyyyyyyyyy
1570 -[ RECORD 4 ]----+---------------------
1571 0123456789abcdef | xxxxxxxx
1572 0123456789       | yyyyyyyyyyyy
1573 -[ RECORD 5 ]----+---------------------
1574 0123456789abcdef | xxxxxxxxxx
1575 0123456789       | yyyyyyyyyy
1576 -[ RECORD 6 ]----+---------------------
1577 0123456789abcdef | xxxxxxxxxxxx
1578 0123456789       | yyyyyyyy
1579 -[ RECORD 7 ]----+---------------------
1580 0123456789abcdef | xxxxxxxxxxxxxx
1581 0123456789       | yyyyyy
1582 -[ RECORD 8 ]----+---------------------
1583 0123456789abcdef | xxxxxxxxxxxxxxxx
1584 0123456789       | yyyy
1585 -[ RECORD 9 ]----+---------------------
1586 0123456789abcdef | xxxxxxxxxxxxxxxxxx
1587 0123456789       | yy
1588 -[ RECORD 10 ]---+---------------------
1589 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
1590 0123456789       | 
1592 \pset format wrapped
1593 execute q;
1594 -[ RECORD 1 ]----+-----------
1595 0123456789abcdef | xx
1596 0123456789       | yyyyyyyyyy.
1597                  |.yyyyyyyy
1598 -[ RECORD 2 ]----+-----------
1599 0123456789abcdef | xxxx
1600 0123456789       | yyyyyyyyyy.
1601                  |.yyyyyy
1602 -[ RECORD 3 ]----+-----------
1603 0123456789abcdef | xxxxxx
1604 0123456789       | yyyyyyyyyy.
1605                  |.yyyy
1606 -[ RECORD 4 ]----+-----------
1607 0123456789abcdef | xxxxxxxx
1608 0123456789       | yyyyyyyyyy.
1609                  |.yy
1610 -[ RECORD 5 ]----+-----------
1611 0123456789abcdef | xxxxxxxxxx
1612 0123456789       | yyyyyyyyyy
1613 -[ RECORD 6 ]----+-----------
1614 0123456789abcdef | xxxxxxxxxx.
1615                  |.xx
1616 0123456789       | yyyyyyyy
1617 -[ RECORD 7 ]----+-----------
1618 0123456789abcdef | xxxxxxxxxx.
1619                  |.xxxx
1620 0123456789       | yyyyyy
1621 -[ RECORD 8 ]----+-----------
1622 0123456789abcdef | xxxxxxxxxx.
1623                  |.xxxxxx
1624 0123456789       | yyyy
1625 -[ RECORD 9 ]----+-----------
1626 0123456789abcdef | xxxxxxxxxx.
1627                  |.xxxxxxxx
1628 0123456789       | yy
1629 -[ RECORD 10 ]---+-----------
1630 0123456789abcdef | xxxxxxxxxx.
1631                  |.xxxxxxxxxx
1632 0123456789       | 
1634 \pset border 2
1635 \pset format unaligned
1636 execute q;
1637 0123456789abcdef|xx
1638 0123456789|yyyyyyyyyyyyyyyyyy
1640 0123456789abcdef|xxxx
1641 0123456789|yyyyyyyyyyyyyyyy
1643 0123456789abcdef|xxxxxx
1644 0123456789|yyyyyyyyyyyyyy
1646 0123456789abcdef|xxxxxxxx
1647 0123456789|yyyyyyyyyyyy
1649 0123456789abcdef|xxxxxxxxxx
1650 0123456789|yyyyyyyyyy
1652 0123456789abcdef|xxxxxxxxxxxx
1653 0123456789|yyyyyyyy
1655 0123456789abcdef|xxxxxxxxxxxxxx
1656 0123456789|yyyyyy
1658 0123456789abcdef|xxxxxxxxxxxxxxxx
1659 0123456789|yyyy
1661 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1662 0123456789|yy
1664 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1665 0123456789|
1666 \pset format aligned
1667 execute q;
1668 +-[ RECORD 1 ]-----+----------------------+
1669 | 0123456789abcdef | xx                   |
1670 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
1671 +-[ RECORD 2 ]-----+----------------------+
1672 | 0123456789abcdef | xxxx                 |
1673 | 0123456789       | yyyyyyyyyyyyyyyy     |
1674 +-[ RECORD 3 ]-----+----------------------+
1675 | 0123456789abcdef | xxxxxx               |
1676 | 0123456789       | yyyyyyyyyyyyyy       |
1677 +-[ RECORD 4 ]-----+----------------------+
1678 | 0123456789abcdef | xxxxxxxx             |
1679 | 0123456789       | yyyyyyyyyyyy         |
1680 +-[ RECORD 5 ]-----+----------------------+
1681 | 0123456789abcdef | xxxxxxxxxx           |
1682 | 0123456789       | yyyyyyyyyy           |
1683 +-[ RECORD 6 ]-----+----------------------+
1684 | 0123456789abcdef | xxxxxxxxxxxx         |
1685 | 0123456789       | yyyyyyyy             |
1686 +-[ RECORD 7 ]-----+----------------------+
1687 | 0123456789abcdef | xxxxxxxxxxxxxx       |
1688 | 0123456789       | yyyyyy               |
1689 +-[ RECORD 8 ]-----+----------------------+
1690 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
1691 | 0123456789       | yyyy                 |
1692 +-[ RECORD 9 ]-----+----------------------+
1693 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
1694 | 0123456789       | yy                   |
1695 +-[ RECORD 10 ]----+----------------------+
1696 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
1697 | 0123456789       |                      |
1698 +------------------+----------------------+
1700 \pset format wrapped
1701 execute q;
1702 +-[ RECORD 1 ]-----+---------+
1703 | 0123456789abcdef | xx      |
1704 | 0123456789       | yyyyyyy.|
1705 |                  |.yyyyyyy.|
1706 |                  |.yyyy    |
1707 +-[ RECORD 2 ]-----+---------+
1708 | 0123456789abcdef | xxxx    |
1709 | 0123456789       | yyyyyyy.|
1710 |                  |.yyyyyyy.|
1711 |                  |.yy      |
1712 +-[ RECORD 3 ]-----+---------+
1713 | 0123456789abcdef | xxxxxx  |
1714 | 0123456789       | yyyyyyy.|
1715 |                  |.yyyyyyy |
1716 +-[ RECORD 4 ]-----+---------+
1717 | 0123456789abcdef | xxxxxxx.|
1718 |                  |.x       |
1719 | 0123456789       | yyyyyyy.|
1720 |                  |.yyyyy   |
1721 +-[ RECORD 5 ]-----+---------+
1722 | 0123456789abcdef | xxxxxxx.|
1723 |                  |.xxx     |
1724 | 0123456789       | yyyyyyy.|
1725 |                  |.yyy     |
1726 +-[ RECORD 6 ]-----+---------+
1727 | 0123456789abcdef | xxxxxxx.|
1728 |                  |.xxxxx   |
1729 | 0123456789       | yyyyyyy.|
1730 |                  |.y       |
1731 +-[ RECORD 7 ]-----+---------+
1732 | 0123456789abcdef | xxxxxxx.|
1733 |                  |.xxxxxxx |
1734 | 0123456789       | yyyyyy  |
1735 +-[ RECORD 8 ]-----+---------+
1736 | 0123456789abcdef | xxxxxxx.|
1737 |                  |.xxxxxxx.|
1738 |                  |.xx      |
1739 | 0123456789       | yyyy    |
1740 +-[ RECORD 9 ]-----+---------+
1741 | 0123456789abcdef | xxxxxxx.|
1742 |                  |.xxxxxxx.|
1743 |                  |.xxxx    |
1744 | 0123456789       | yy      |
1745 +-[ RECORD 10 ]----+---------+
1746 | 0123456789abcdef | xxxxxxx.|
1747 |                  |.xxxxxxx.|
1748 |                  |.xxxxxx  |
1749 | 0123456789       |         |
1750 +------------------+---------+
1752 \pset expanded on
1753 \pset columns 20
1754 \pset border 0
1755 \pset format unaligned
1756 execute q;
1757 0123456789abcdef|xx
1758 0123456789|yyyyyyyyyyyyyyyyyy
1760 0123456789abcdef|xxxx
1761 0123456789|yyyyyyyyyyyyyyyy
1763 0123456789abcdef|xxxxxx
1764 0123456789|yyyyyyyyyyyyyy
1766 0123456789abcdef|xxxxxxxx
1767 0123456789|yyyyyyyyyyyy
1769 0123456789abcdef|xxxxxxxxxx
1770 0123456789|yyyyyyyyyy
1772 0123456789abcdef|xxxxxxxxxxxx
1773 0123456789|yyyyyyyy
1775 0123456789abcdef|xxxxxxxxxxxxxx
1776 0123456789|yyyyyy
1778 0123456789abcdef|xxxxxxxxxxxxxxxx
1779 0123456789|yyyy
1781 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1782 0123456789|yy
1784 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1785 0123456789|
1786 \pset format aligned
1787 execute q;
1788 * Record 1                          
1789 0123456789abcdef xx
1790 0123456789       yyyyyyyyyyyyyyyyyy
1791 * Record 2                          
1792 0123456789abcdef xxxx
1793 0123456789       yyyyyyyyyyyyyyyy
1794 * Record 3                          
1795 0123456789abcdef xxxxxx
1796 0123456789       yyyyyyyyyyyyyy
1797 * Record 4                          
1798 0123456789abcdef xxxxxxxx
1799 0123456789       yyyyyyyyyyyy
1800 * Record 5                          
1801 0123456789abcdef xxxxxxxxxx
1802 0123456789       yyyyyyyyyy
1803 * Record 6                          
1804 0123456789abcdef xxxxxxxxxxxx
1805 0123456789       yyyyyyyy
1806 * Record 7                          
1807 0123456789abcdef xxxxxxxxxxxxxx
1808 0123456789       yyyyyy
1809 * Record 8                          
1810 0123456789abcdef xxxxxxxxxxxxxxxx
1811 0123456789       yyyy
1812 * Record 9                          
1813 0123456789abcdef xxxxxxxxxxxxxxxxxx
1814 0123456789       yy
1815 * Record 10                         
1816 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
1817 0123456789       
1819 \pset format wrapped
1820 execute q;
1821 * Record 1         
1822 0123456789abcdef xx
1823 0123456789       yyy.
1824                 .yyy.
1825                 .yyy.
1826                 .yyy.
1827                 .yyy.
1828                 .yyy
1829 * Record 2         
1830 0123456789abcdef xxx.
1831                 .x
1832 0123456789       yyy.
1833                 .yyy.
1834                 .yyy.
1835                 .yyy.
1836                 .yyy.
1837                 .y
1838 * Record 3         
1839 0123456789abcdef xxx.
1840                 .xxx
1841 0123456789       yyy.
1842                 .yyy.
1843                 .yyy.
1844                 .yyy.
1845                 .yy
1846 * Record 4         
1847 0123456789abcdef xxx.
1848                 .xxx.
1849                 .xx
1850 0123456789       yyy.
1851                 .yyy.
1852                 .yyy.
1853                 .yyy
1854 * Record 5         
1855 0123456789abcdef xxx.
1856                 .xxx.
1857                 .xxx.
1858                 .x
1859 0123456789       yyy.
1860                 .yyy.
1861                 .yyy.
1862                 .y
1863 * Record 6         
1864 0123456789abcdef xxx.
1865                 .xxx.
1866                 .xxx.
1867                 .xxx
1868 0123456789       yyy.
1869                 .yyy.
1870                 .yy
1871 * Record 7         
1872 0123456789abcdef xxx.
1873                 .xxx.
1874                 .xxx.
1875                 .xxx.
1876                 .xx
1877 0123456789       yyy.
1878                 .yyy
1879 * Record 8         
1880 0123456789abcdef xxx.
1881                 .xxx.
1882                 .xxx.
1883                 .xxx.
1884                 .xxx.
1885                 .x
1886 0123456789       yyy.
1887                 .y
1888 * Record 9         
1889 0123456789abcdef xxx.
1890                 .xxx.
1891                 .xxx.
1892                 .xxx.
1893                 .xxx.
1894                 .xxx
1895 0123456789       yy
1896 * Record 10        
1897 0123456789abcdef xxx.
1898                 .xxx.
1899                 .xxx.
1900                 .xxx.
1901                 .xxx.
1902                 .xxx.
1903                 .xx
1904 0123456789       
1906 \pset border 1
1907 \pset format unaligned
1908 execute q;
1909 0123456789abcdef|xx
1910 0123456789|yyyyyyyyyyyyyyyyyy
1912 0123456789abcdef|xxxx
1913 0123456789|yyyyyyyyyyyyyyyy
1915 0123456789abcdef|xxxxxx
1916 0123456789|yyyyyyyyyyyyyy
1918 0123456789abcdef|xxxxxxxx
1919 0123456789|yyyyyyyyyyyy
1921 0123456789abcdef|xxxxxxxxxx
1922 0123456789|yyyyyyyyyy
1924 0123456789abcdef|xxxxxxxxxxxx
1925 0123456789|yyyyyyyy
1927 0123456789abcdef|xxxxxxxxxxxxxx
1928 0123456789|yyyyyy
1930 0123456789abcdef|xxxxxxxxxxxxxxxx
1931 0123456789|yyyy
1933 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1934 0123456789|yy
1936 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1937 0123456789|
1938 \pset format aligned
1939 execute q;
1940 -[ RECORD 1 ]----+---------------------
1941 0123456789abcdef | xx
1942 0123456789       | yyyyyyyyyyyyyyyyyy
1943 -[ RECORD 2 ]----+---------------------
1944 0123456789abcdef | xxxx
1945 0123456789       | yyyyyyyyyyyyyyyy
1946 -[ RECORD 3 ]----+---------------------
1947 0123456789abcdef | xxxxxx
1948 0123456789       | yyyyyyyyyyyyyy
1949 -[ RECORD 4 ]----+---------------------
1950 0123456789abcdef | xxxxxxxx
1951 0123456789       | yyyyyyyyyyyy
1952 -[ RECORD 5 ]----+---------------------
1953 0123456789abcdef | xxxxxxxxxx
1954 0123456789       | yyyyyyyyyy
1955 -[ RECORD 6 ]----+---------------------
1956 0123456789abcdef | xxxxxxxxxxxx
1957 0123456789       | yyyyyyyy
1958 -[ RECORD 7 ]----+---------------------
1959 0123456789abcdef | xxxxxxxxxxxxxx
1960 0123456789       | yyyyyy
1961 -[ RECORD 8 ]----+---------------------
1962 0123456789abcdef | xxxxxxxxxxxxxxxx
1963 0123456789       | yyyy
1964 -[ RECORD 9 ]----+---------------------
1965 0123456789abcdef | xxxxxxxxxxxxxxxxxx
1966 0123456789       | yy
1967 -[ RECORD 10 ]---+---------------------
1968 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
1969 0123456789       | 
1971 \pset format wrapped
1972 execute q;
1973 -[ RECORD 1 ]----+----
1974 0123456789abcdef | xx
1975 0123456789       | yyy.
1976                  |.yyy.
1977                  |.yyy.
1978                  |.yyy.
1979                  |.yyy.
1980                  |.yyy
1981 -[ RECORD 2 ]----+----
1982 0123456789abcdef | xxx.
1983                  |.x
1984 0123456789       | yyy.
1985                  |.yyy.
1986                  |.yyy.
1987                  |.yyy.
1988                  |.yyy.
1989                  |.y
1990 -[ RECORD 3 ]----+----
1991 0123456789abcdef | xxx.
1992                  |.xxx
1993 0123456789       | yyy.
1994                  |.yyy.
1995                  |.yyy.
1996                  |.yyy.
1997                  |.yy
1998 -[ RECORD 4 ]----+----
1999 0123456789abcdef | xxx.
2000                  |.xxx.
2001                  |.xx
2002 0123456789       | yyy.
2003                  |.yyy.
2004                  |.yyy.
2005                  |.yyy
2006 -[ RECORD 5 ]----+----
2007 0123456789abcdef | xxx.
2008                  |.xxx.
2009                  |.xxx.
2010                  |.x
2011 0123456789       | yyy.
2012                  |.yyy.
2013                  |.yyy.
2014                  |.y
2015 -[ RECORD 6 ]----+----
2016 0123456789abcdef | xxx.
2017                  |.xxx.
2018                  |.xxx.
2019                  |.xxx
2020 0123456789       | yyy.
2021                  |.yyy.
2022                  |.yy
2023 -[ RECORD 7 ]----+----
2024 0123456789abcdef | xxx.
2025                  |.xxx.
2026                  |.xxx.
2027                  |.xxx.
2028                  |.xx
2029 0123456789       | yyy.
2030                  |.yyy
2031 -[ RECORD 8 ]----+----
2032 0123456789abcdef | xxx.
2033                  |.xxx.
2034                  |.xxx.
2035                  |.xxx.
2036                  |.xxx.
2037                  |.x
2038 0123456789       | yyy.
2039                  |.y
2040 -[ RECORD 9 ]----+----
2041 0123456789abcdef | xxx.
2042                  |.xxx.
2043                  |.xxx.
2044                  |.xxx.
2045                  |.xxx.
2046                  |.xxx
2047 0123456789       | yy
2048 -[ RECORD 10 ]---+----
2049 0123456789abcdef | xxx.
2050                  |.xxx.
2051                  |.xxx.
2052                  |.xxx.
2053                  |.xxx.
2054                  |.xxx.
2055                  |.xx
2056 0123456789       | 
2058 \pset border 2
2059 \pset format unaligned
2060 execute q;
2061 0123456789abcdef|xx
2062 0123456789|yyyyyyyyyyyyyyyyyy
2064 0123456789abcdef|xxxx
2065 0123456789|yyyyyyyyyyyyyyyy
2067 0123456789abcdef|xxxxxx
2068 0123456789|yyyyyyyyyyyyyy
2070 0123456789abcdef|xxxxxxxx
2071 0123456789|yyyyyyyyyyyy
2073 0123456789abcdef|xxxxxxxxxx
2074 0123456789|yyyyyyyyyy
2076 0123456789abcdef|xxxxxxxxxxxx
2077 0123456789|yyyyyyyy
2079 0123456789abcdef|xxxxxxxxxxxxxx
2080 0123456789|yyyyyy
2082 0123456789abcdef|xxxxxxxxxxxxxxxx
2083 0123456789|yyyy
2085 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2086 0123456789|yy
2088 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2089 0123456789|
2090 \pset format aligned
2091 execute q;
2092 +-[ RECORD 1 ]-----+----------------------+
2093 | 0123456789abcdef | xx                   |
2094 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
2095 +-[ RECORD 2 ]-----+----------------------+
2096 | 0123456789abcdef | xxxx                 |
2097 | 0123456789       | yyyyyyyyyyyyyyyy     |
2098 +-[ RECORD 3 ]-----+----------------------+
2099 | 0123456789abcdef | xxxxxx               |
2100 | 0123456789       | yyyyyyyyyyyyyy       |
2101 +-[ RECORD 4 ]-----+----------------------+
2102 | 0123456789abcdef | xxxxxxxx             |
2103 | 0123456789       | yyyyyyyyyyyy         |
2104 +-[ RECORD 5 ]-----+----------------------+
2105 | 0123456789abcdef | xxxxxxxxxx           |
2106 | 0123456789       | yyyyyyyyyy           |
2107 +-[ RECORD 6 ]-----+----------------------+
2108 | 0123456789abcdef | xxxxxxxxxxxx         |
2109 | 0123456789       | yyyyyyyy             |
2110 +-[ RECORD 7 ]-----+----------------------+
2111 | 0123456789abcdef | xxxxxxxxxxxxxx       |
2112 | 0123456789       | yyyyyy               |
2113 +-[ RECORD 8 ]-----+----------------------+
2114 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
2115 | 0123456789       | yyyy                 |
2116 +-[ RECORD 9 ]-----+----------------------+
2117 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
2118 | 0123456789       | yy                   |
2119 +-[ RECORD 10 ]----+----------------------+
2120 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
2121 | 0123456789       |                      |
2122 +------------------+----------------------+
2124 \pset format wrapped
2125 execute q;
2126 +-[ RECORD 1 ]-----+-----+
2127 | 0123456789abcdef | xx  |
2128 | 0123456789       | yyy.|
2129 |                  |.yyy.|
2130 |                  |.yyy.|
2131 |                  |.yyy.|
2132 |                  |.yyy.|
2133 |                  |.yyy |
2134 +-[ RECORD 2 ]-----+-----+
2135 | 0123456789abcdef | xxx.|
2136 |                  |.x   |
2137 | 0123456789       | yyy.|
2138 |                  |.yyy.|
2139 |                  |.yyy.|
2140 |                  |.yyy.|
2141 |                  |.yyy.|
2142 |                  |.y   |
2143 +-[ RECORD 3 ]-----+-----+
2144 | 0123456789abcdef | xxx.|
2145 |                  |.xxx |
2146 | 0123456789       | yyy.|
2147 |                  |.yyy.|
2148 |                  |.yyy.|
2149 |                  |.yyy.|
2150 |                  |.yy  |
2151 +-[ RECORD 4 ]-----+-----+
2152 | 0123456789abcdef | xxx.|
2153 |                  |.xxx.|
2154 |                  |.xx  |
2155 | 0123456789       | yyy.|
2156 |                  |.yyy.|
2157 |                  |.yyy.|
2158 |                  |.yyy |
2159 +-[ RECORD 5 ]-----+-----+
2160 | 0123456789abcdef | xxx.|
2161 |                  |.xxx.|
2162 |                  |.xxx.|
2163 |                  |.x   |
2164 | 0123456789       | yyy.|
2165 |                  |.yyy.|
2166 |                  |.yyy.|
2167 |                  |.y   |
2168 +-[ RECORD 6 ]-----+-----+
2169 | 0123456789abcdef | xxx.|
2170 |                  |.xxx.|
2171 |                  |.xxx.|
2172 |                  |.xxx |
2173 | 0123456789       | yyy.|
2174 |                  |.yyy.|
2175 |                  |.yy  |
2176 +-[ RECORD 7 ]-----+-----+
2177 | 0123456789abcdef | xxx.|
2178 |                  |.xxx.|
2179 |                  |.xxx.|
2180 |                  |.xxx.|
2181 |                  |.xx  |
2182 | 0123456789       | yyy.|
2183 |                  |.yyy |
2184 +-[ RECORD 8 ]-----+-----+
2185 | 0123456789abcdef | xxx.|
2186 |                  |.xxx.|
2187 |                  |.xxx.|
2188 |                  |.xxx.|
2189 |                  |.xxx.|
2190 |                  |.x   |
2191 | 0123456789       | yyy.|
2192 |                  |.y   |
2193 +-[ RECORD 9 ]-----+-----+
2194 | 0123456789abcdef | xxx.|
2195 |                  |.xxx.|
2196 |                  |.xxx.|
2197 |                  |.xxx.|
2198 |                  |.xxx.|
2199 |                  |.xxx |
2200 | 0123456789       | yy  |
2201 +-[ RECORD 10 ]----+-----+
2202 | 0123456789abcdef | xxx.|
2203 |                  |.xxx.|
2204 |                  |.xxx.|
2205 |                  |.xxx.|
2206 |                  |.xxx.|
2207 |                  |.xxx.|
2208 |                  |.xx  |
2209 | 0123456789       |     |
2210 +------------------+-----+
2212 \pset linestyle old-ascii
2213 \pset expanded off
2214 \pset columns 40
2215 \pset border 0
2216 \pset format unaligned
2217 execute q;
2218 0123456789abcdef|0123456789
2219 xx|yyyyyyyyyyyyyyyyyy
2220 xxxx|yyyyyyyyyyyyyyyy
2221 xxxxxx|yyyyyyyyyyyyyy
2222 xxxxxxxx|yyyyyyyyyyyy
2223 xxxxxxxxxx|yyyyyyyyyy
2224 xxxxxxxxxxxx|yyyyyyyy
2225 xxxxxxxxxxxxxx|yyyyyy
2226 xxxxxxxxxxxxxxxx|yyyy
2227 xxxxxxxxxxxxxxxxxx|yy
2228 xxxxxxxxxxxxxxxxxxxx|
2229 (10 rows)
2230 \pset format aligned
2231 execute q;
2232   0123456789abcdef       0123456789    
2233 -------------------- ------------------
2234 xx                   yyyyyyyyyyyyyyyyyy
2235 xxxx                 yyyyyyyyyyyyyyyy
2236 xxxxxx               yyyyyyyyyyyyyy
2237 xxxxxxxx             yyyyyyyyyyyy
2238 xxxxxxxxxx           yyyyyyyyyy
2239 xxxxxxxxxxxx         yyyyyyyy
2240 xxxxxxxxxxxxxx       yyyyyy
2241 xxxxxxxxxxxxxxxx     yyyy
2242 xxxxxxxxxxxxxxxxxx   yy
2243 xxxxxxxxxxxxxxxxxxxx 
2244 (10 rows)
2246 \pset format wrapped
2247 execute q;
2248   0123456789abcdef       0123456789    
2249 -------------------- ------------------
2250 xx                   yyyyyyyyyyyyyyyyyy
2251 xxxx                 yyyyyyyyyyyyyyyy
2252 xxxxxx               yyyyyyyyyyyyyy
2253 xxxxxxxx             yyyyyyyyyyyy
2254 xxxxxxxxxx           yyyyyyyyyy
2255 xxxxxxxxxxxx         yyyyyyyy
2256 xxxxxxxxxxxxxx       yyyyyy
2257 xxxxxxxxxxxxxxxx     yyyy
2258 xxxxxxxxxxxxxxxxxx   yy
2259 xxxxxxxxxxxxxxxxxxxx 
2260 (10 rows)
2262 \pset border 1
2263 \pset format unaligned
2264 execute q;
2265 0123456789abcdef|0123456789
2266 xx|yyyyyyyyyyyyyyyyyy
2267 xxxx|yyyyyyyyyyyyyyyy
2268 xxxxxx|yyyyyyyyyyyyyy
2269 xxxxxxxx|yyyyyyyyyyyy
2270 xxxxxxxxxx|yyyyyyyyyy
2271 xxxxxxxxxxxx|yyyyyyyy
2272 xxxxxxxxxxxxxx|yyyyyy
2273 xxxxxxxxxxxxxxxx|yyyy
2274 xxxxxxxxxxxxxxxxxx|yy
2275 xxxxxxxxxxxxxxxxxxxx|
2276 (10 rows)
2277 \pset format aligned
2278 execute q;
2279    0123456789abcdef   |     0123456789     
2280 ----------------------+--------------------
2281  xx                   | yyyyyyyyyyyyyyyyyy
2282  xxxx                 | yyyyyyyyyyyyyyyy
2283  xxxxxx               | yyyyyyyyyyyyyy
2284  xxxxxxxx             | yyyyyyyyyyyy
2285  xxxxxxxxxx           | yyyyyyyyyy
2286  xxxxxxxxxxxx         | yyyyyyyy
2287  xxxxxxxxxxxxxx       | yyyyyy
2288  xxxxxxxxxxxxxxxx     | yyyy
2289  xxxxxxxxxxxxxxxxxx   | yy
2290  xxxxxxxxxxxxxxxxxxxx | 
2291 (10 rows)
2293 \pset format wrapped
2294 execute q;
2295   0123456789abcdef   |    0123456789    
2296 ---------------------+------------------
2297  xx                  | yyyyyyyyyyyyyyyy 
2298                      ; yy
2299  xxxx                | yyyyyyyyyyyyyyyy
2300  xxxxxx              | yyyyyyyyyyyyyy
2301  xxxxxxxx            | yyyyyyyyyyyy
2302  xxxxxxxxxx          | yyyyyyyyyy
2303  xxxxxxxxxxxx        | yyyyyyyy
2304  xxxxxxxxxxxxxx      | yyyyyy
2305  xxxxxxxxxxxxxxxx    | yyyy
2306  xxxxxxxxxxxxxxxxxx  | yy
2307  xxxxxxxxxxxxxxxxxxx | 
2308  x                     
2309 (10 rows)
2311 \pset border 2
2312 \pset format unaligned
2313 execute q;
2314 0123456789abcdef|0123456789
2315 xx|yyyyyyyyyyyyyyyyyy
2316 xxxx|yyyyyyyyyyyyyyyy
2317 xxxxxx|yyyyyyyyyyyyyy
2318 xxxxxxxx|yyyyyyyyyyyy
2319 xxxxxxxxxx|yyyyyyyyyy
2320 xxxxxxxxxxxx|yyyyyyyy
2321 xxxxxxxxxxxxxx|yyyyyy
2322 xxxxxxxxxxxxxxxx|yyyy
2323 xxxxxxxxxxxxxxxxxx|yy
2324 xxxxxxxxxxxxxxxxxxxx|
2325 (10 rows)
2326 \pset format aligned
2327 execute q;
2328 +----------------------+--------------------+
2329 |   0123456789abcdef   |     0123456789     |
2330 +----------------------+--------------------+
2331 | xx                   | yyyyyyyyyyyyyyyyyy |
2332 | xxxx                 | yyyyyyyyyyyyyyyy   |
2333 | xxxxxx               | yyyyyyyyyyyyyy     |
2334 | xxxxxxxx             | yyyyyyyyyyyy       |
2335 | xxxxxxxxxx           | yyyyyyyyyy         |
2336 | xxxxxxxxxxxx         | yyyyyyyy           |
2337 | xxxxxxxxxxxxxx       | yyyyyy             |
2338 | xxxxxxxxxxxxxxxx     | yyyy               |
2339 | xxxxxxxxxxxxxxxxxx   | yy                 |
2340 | xxxxxxxxxxxxxxxxxxxx |                    |
2341 +----------------------+--------------------+
2342 (10 rows)
2344 \pset format wrapped
2345 execute q;
2346 +--------------------+-----------------+
2347 |  0123456789abcdef  |   0123456789    |
2348 +--------------------+-----------------+
2349 | xx                 | yyyyyyyyyyyyyyy |
2350 |                    ; yyy             |
2351 | xxxx               | yyyyyyyyyyyyyyy |
2352 |                    ; y               |
2353 | xxxxxx             | yyyyyyyyyyyyyy  |
2354 | xxxxxxxx           | yyyyyyyyyyyy    |
2355 | xxxxxxxxxx         | yyyyyyyyyy      |
2356 | xxxxxxxxxxxx       | yyyyyyyy        |
2357 | xxxxxxxxxxxxxx     | yyyyyy          |
2358 | xxxxxxxxxxxxxxxx   | yyyy            |
2359 | xxxxxxxxxxxxxxxxxx | yy              |
2360 | xxxxxxxxxxxxxxxxxx |                 |
2361 | xx                                   |
2362 +--------------------+-----------------+
2363 (10 rows)
2365 \pset expanded on
2366 \pset border 0
2367 \pset format unaligned
2368 execute q;
2369 0123456789abcdef|xx
2370 0123456789|yyyyyyyyyyyyyyyyyy
2372 0123456789abcdef|xxxx
2373 0123456789|yyyyyyyyyyyyyyyy
2375 0123456789abcdef|xxxxxx
2376 0123456789|yyyyyyyyyyyyyy
2378 0123456789abcdef|xxxxxxxx
2379 0123456789|yyyyyyyyyyyy
2381 0123456789abcdef|xxxxxxxxxx
2382 0123456789|yyyyyyyyyy
2384 0123456789abcdef|xxxxxxxxxxxx
2385 0123456789|yyyyyyyy
2387 0123456789abcdef|xxxxxxxxxxxxxx
2388 0123456789|yyyyyy
2390 0123456789abcdef|xxxxxxxxxxxxxxxx
2391 0123456789|yyyy
2393 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2394 0123456789|yy
2396 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2397 0123456789|
2398 \pset format aligned
2399 execute q;
2400 * Record 1                          
2401 0123456789abcdef xx
2402 0123456789       yyyyyyyyyyyyyyyyyy
2403 * Record 2                          
2404 0123456789abcdef xxxx
2405 0123456789       yyyyyyyyyyyyyyyy
2406 * Record 3                          
2407 0123456789abcdef xxxxxx
2408 0123456789       yyyyyyyyyyyyyy
2409 * Record 4                          
2410 0123456789abcdef xxxxxxxx
2411 0123456789       yyyyyyyyyyyy
2412 * Record 5                          
2413 0123456789abcdef xxxxxxxxxx
2414 0123456789       yyyyyyyyyy
2415 * Record 6                          
2416 0123456789abcdef xxxxxxxxxxxx
2417 0123456789       yyyyyyyy
2418 * Record 7                          
2419 0123456789abcdef xxxxxxxxxxxxxx
2420 0123456789       yyyyyy
2421 * Record 8                          
2422 0123456789abcdef xxxxxxxxxxxxxxxx
2423 0123456789       yyyy
2424 * Record 9                          
2425 0123456789abcdef xxxxxxxxxxxxxxxxxx
2426 0123456789       yy
2427 * Record 10                         
2428 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
2429 0123456789       
2431 \pset format wrapped
2432 execute q;
2433 * Record 1                          
2434 0123456789abcdef xx
2435 0123456789       yyyyyyyyyyyyyyyyyy
2436 * Record 2                          
2437 0123456789abcdef xxxx
2438 0123456789       yyyyyyyyyyyyyyyy
2439 * Record 3                          
2440 0123456789abcdef xxxxxx
2441 0123456789       yyyyyyyyyyyyyy
2442 * Record 4                          
2443 0123456789abcdef xxxxxxxx
2444 0123456789       yyyyyyyyyyyy
2445 * Record 5                          
2446 0123456789abcdef xxxxxxxxxx
2447 0123456789       yyyyyyyyyy
2448 * Record 6                          
2449 0123456789abcdef xxxxxxxxxxxx
2450 0123456789       yyyyyyyy
2451 * Record 7                          
2452 0123456789abcdef xxxxxxxxxxxxxx
2453 0123456789       yyyyyy
2454 * Record 8                          
2455 0123456789abcdef xxxxxxxxxxxxxxxx
2456 0123456789       yyyy
2457 * Record 9                          
2458 0123456789abcdef xxxxxxxxxxxxxxxxxx
2459 0123456789       yy
2460 * Record 10                         
2461 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
2462 0123456789       
2464 \pset border 1
2465 \pset format unaligned
2466 execute q;
2467 0123456789abcdef|xx
2468 0123456789|yyyyyyyyyyyyyyyyyy
2470 0123456789abcdef|xxxx
2471 0123456789|yyyyyyyyyyyyyyyy
2473 0123456789abcdef|xxxxxx
2474 0123456789|yyyyyyyyyyyyyy
2476 0123456789abcdef|xxxxxxxx
2477 0123456789|yyyyyyyyyyyy
2479 0123456789abcdef|xxxxxxxxxx
2480 0123456789|yyyyyyyyyy
2482 0123456789abcdef|xxxxxxxxxxxx
2483 0123456789|yyyyyyyy
2485 0123456789abcdef|xxxxxxxxxxxxxx
2486 0123456789|yyyyyy
2488 0123456789abcdef|xxxxxxxxxxxxxxxx
2489 0123456789|yyyy
2491 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2492 0123456789|yy
2494 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2495 0123456789|
2496 \pset format aligned
2497 execute q;
2498 -[ RECORD 1 ]----+---------------------
2499 0123456789abcdef | xx
2500 0123456789       | yyyyyyyyyyyyyyyyyy
2501 -[ RECORD 2 ]----+---------------------
2502 0123456789abcdef | xxxx
2503 0123456789       | yyyyyyyyyyyyyyyy
2504 -[ RECORD 3 ]----+---------------------
2505 0123456789abcdef | xxxxxx
2506 0123456789       | yyyyyyyyyyyyyy
2507 -[ RECORD 4 ]----+---------------------
2508 0123456789abcdef | xxxxxxxx
2509 0123456789       | yyyyyyyyyyyy
2510 -[ RECORD 5 ]----+---------------------
2511 0123456789abcdef | xxxxxxxxxx
2512 0123456789       | yyyyyyyyyy
2513 -[ RECORD 6 ]----+---------------------
2514 0123456789abcdef | xxxxxxxxxxxx
2515 0123456789       | yyyyyyyy
2516 -[ RECORD 7 ]----+---------------------
2517 0123456789abcdef | xxxxxxxxxxxxxx
2518 0123456789       | yyyyyy
2519 -[ RECORD 8 ]----+---------------------
2520 0123456789abcdef | xxxxxxxxxxxxxxxx
2521 0123456789       | yyyy
2522 -[ RECORD 9 ]----+---------------------
2523 0123456789abcdef | xxxxxxxxxxxxxxxxxx
2524 0123456789       | yy
2525 -[ RECORD 10 ]---+---------------------
2526 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
2527 0123456789       | 
2529 \pset format wrapped
2530 execute q;
2531 -[ RECORD 1 ]----+---------------------
2532 0123456789abcdef | xx
2533 0123456789       | yyyyyyyyyyyyyyyyyy
2534 -[ RECORD 2 ]----+---------------------
2535 0123456789abcdef | xxxx
2536 0123456789       | yyyyyyyyyyyyyyyy
2537 -[ RECORD 3 ]----+---------------------
2538 0123456789abcdef | xxxxxx
2539 0123456789       | yyyyyyyyyyyyyy
2540 -[ RECORD 4 ]----+---------------------
2541 0123456789abcdef | xxxxxxxx
2542 0123456789       | yyyyyyyyyyyy
2543 -[ RECORD 5 ]----+---------------------
2544 0123456789abcdef | xxxxxxxxxx
2545 0123456789       | yyyyyyyyyy
2546 -[ RECORD 6 ]----+---------------------
2547 0123456789abcdef | xxxxxxxxxxxx
2548 0123456789       | yyyyyyyy
2549 -[ RECORD 7 ]----+---------------------
2550 0123456789abcdef | xxxxxxxxxxxxxx
2551 0123456789       | yyyyyy
2552 -[ RECORD 8 ]----+---------------------
2553 0123456789abcdef | xxxxxxxxxxxxxxxx
2554 0123456789       | yyyy
2555 -[ RECORD 9 ]----+---------------------
2556 0123456789abcdef | xxxxxxxxxxxxxxxxxx
2557 0123456789       | yy
2558 -[ RECORD 10 ]---+---------------------
2559 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
2560 0123456789       | 
2562 \pset border 2
2563 \pset format unaligned
2564 execute q;
2565 0123456789abcdef|xx
2566 0123456789|yyyyyyyyyyyyyyyyyy
2568 0123456789abcdef|xxxx
2569 0123456789|yyyyyyyyyyyyyyyy
2571 0123456789abcdef|xxxxxx
2572 0123456789|yyyyyyyyyyyyyy
2574 0123456789abcdef|xxxxxxxx
2575 0123456789|yyyyyyyyyyyy
2577 0123456789abcdef|xxxxxxxxxx
2578 0123456789|yyyyyyyyyy
2580 0123456789abcdef|xxxxxxxxxxxx
2581 0123456789|yyyyyyyy
2583 0123456789abcdef|xxxxxxxxxxxxxx
2584 0123456789|yyyyyy
2586 0123456789abcdef|xxxxxxxxxxxxxxxx
2587 0123456789|yyyy
2589 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2590 0123456789|yy
2592 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2593 0123456789|
2594 \pset format aligned
2595 execute q;
2596 +-[ RECORD 1 ]-----+----------------------+
2597 | 0123456789abcdef | xx                   |
2598 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
2599 +-[ RECORD 2 ]-----+----------------------+
2600 | 0123456789abcdef | xxxx                 |
2601 | 0123456789       | yyyyyyyyyyyyyyyy     |
2602 +-[ RECORD 3 ]-----+----------------------+
2603 | 0123456789abcdef | xxxxxx               |
2604 | 0123456789       | yyyyyyyyyyyyyy       |
2605 +-[ RECORD 4 ]-----+----------------------+
2606 | 0123456789abcdef | xxxxxxxx             |
2607 | 0123456789       | yyyyyyyyyyyy         |
2608 +-[ RECORD 5 ]-----+----------------------+
2609 | 0123456789abcdef | xxxxxxxxxx           |
2610 | 0123456789       | yyyyyyyyyy           |
2611 +-[ RECORD 6 ]-----+----------------------+
2612 | 0123456789abcdef | xxxxxxxxxxxx         |
2613 | 0123456789       | yyyyyyyy             |
2614 +-[ RECORD 7 ]-----+----------------------+
2615 | 0123456789abcdef | xxxxxxxxxxxxxx       |
2616 | 0123456789       | yyyyyy               |
2617 +-[ RECORD 8 ]-----+----------------------+
2618 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
2619 | 0123456789       | yyyy                 |
2620 +-[ RECORD 9 ]-----+----------------------+
2621 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
2622 | 0123456789       | yy                   |
2623 +-[ RECORD 10 ]----+----------------------+
2624 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
2625 | 0123456789       |                      |
2626 +------------------+----------------------+
2628 \pset format wrapped
2629 execute q;
2630 +-[ RECORD 1 ]-----+-------------------+
2631 | 0123456789abcdef | xx                |
2632 | 0123456789       | yyyyyyyyyyyyyyyyy |
2633 |                  ; y                 |
2634 +-[ RECORD 2 ]-----+-------------------+
2635 | 0123456789abcdef | xxxx              |
2636 | 0123456789       | yyyyyyyyyyyyyyyy  |
2637 +-[ RECORD 3 ]-----+-------------------+
2638 | 0123456789abcdef | xxxxxx            |
2639 | 0123456789       | yyyyyyyyyyyyyy    |
2640 +-[ RECORD 4 ]-----+-------------------+
2641 | 0123456789abcdef | xxxxxxxx          |
2642 | 0123456789       | yyyyyyyyyyyy      |
2643 +-[ RECORD 5 ]-----+-------------------+
2644 | 0123456789abcdef | xxxxxxxxxx        |
2645 | 0123456789       | yyyyyyyyyy        |
2646 +-[ RECORD 6 ]-----+-------------------+
2647 | 0123456789abcdef | xxxxxxxxxxxx      |
2648 | 0123456789       | yyyyyyyy          |
2649 +-[ RECORD 7 ]-----+-------------------+
2650 | 0123456789abcdef | xxxxxxxxxxxxxx    |
2651 | 0123456789       | yyyyyy            |
2652 +-[ RECORD 8 ]-----+-------------------+
2653 | 0123456789abcdef | xxxxxxxxxxxxxxxx  |
2654 | 0123456789       | yyyy              |
2655 +-[ RECORD 9 ]-----+-------------------+
2656 | 0123456789abcdef | xxxxxxxxxxxxxxxxx |
2657 |                  ; x                 |
2658 | 0123456789       | yy                |
2659 +-[ RECORD 10 ]----+-------------------+
2660 | 0123456789abcdef | xxxxxxxxxxxxxxxxx |
2661 |                  ; xxx               |
2662 | 0123456789       |                   |
2663 +------------------+-------------------+
2665 deallocate q;
2666 \pset linestyle ascii
2667 \pset border 1
2668 -- support table for output-format tests (useful to create a footer)
2669 create table psql_serial_tab (id serial);
2670 -- test header/footer/tuples_only behavior in aligned/unaligned/wrapped cases
2671 \pset format aligned
2672 \pset expanded off
2673 \d psql_serial_tab_id_seq
2674                Sequence "public.psql_serial_tab_id_seq"
2675   Type   | Start | Minimum |  Maximum   | Increment | Cycles? | Cache 
2676 ---------+-------+---------+------------+-----------+---------+-------
2677  integer |     1 |       1 | 2147483647 |         1 | no      |     1
2678 Owned by: public.psql_serial_tab.id
2680 \pset tuples_only true
2681 \df exp
2682  pg_catalog | exp  | double precision | double precision    | func
2683  pg_catalog | exp  | numeric          | numeric             | func
2685 \pset tuples_only false
2686 \pset expanded on
2687 \d psql_serial_tab_id_seq
2688 Sequence "public.psql_serial_tab_id_seq"
2689 -[ RECORD 1 ]---------
2690 Type      | integer
2691 Start     | 1
2692 Minimum   | 1
2693 Maximum   | 2147483647
2694 Increment | 1
2695 Cycles?   | no
2696 Cache     | 1
2698 Owned by: public.psql_serial_tab.id
2700 \pset tuples_only true
2701 \df exp
2702 Schema              | pg_catalog
2703 Name                | exp
2704 Result data type    | double precision
2705 Argument data types | double precision
2706 Type                | func
2707 --------------------+-----------------
2708 Schema              | pg_catalog
2709 Name                | exp
2710 Result data type    | numeric
2711 Argument data types | numeric
2712 Type                | func
2714 \pset tuples_only false
2715 -- empty table is a special case for this format
2716 select 1 where false;
2717 (0 rows)
2719 \pset format unaligned
2720 \pset expanded off
2721 \d psql_serial_tab_id_seq
2722 Sequence "public.psql_serial_tab_id_seq"
2723 Type|Start|Minimum|Maximum|Increment|Cycles?|Cache
2724 integer|1|1|2147483647|1|no|1
2725 Owned by: public.psql_serial_tab.id
2726 \pset tuples_only true
2727 \df exp
2728 pg_catalog|exp|double precision|double precision|func
2729 pg_catalog|exp|numeric|numeric|func
2730 \pset tuples_only false
2731 \pset expanded on
2732 \d psql_serial_tab_id_seq
2733 Sequence "public.psql_serial_tab_id_seq"
2735 Type|integer
2736 Start|1
2737 Minimum|1
2738 Maximum|2147483647
2739 Increment|1
2740 Cycles?|no
2741 Cache|1
2743 Owned by: public.psql_serial_tab.id
2744 \pset tuples_only true
2745 \df exp
2746 Schema|pg_catalog
2747 Name|exp
2748 Result data type|double precision
2749 Argument data types|double precision
2750 Type|func
2752 Schema|pg_catalog
2753 Name|exp
2754 Result data type|numeric
2755 Argument data types|numeric
2756 Type|func
2757 \pset tuples_only false
2758 \pset format wrapped
2759 \pset expanded off
2760 \d psql_serial_tab_id_seq
2761                Sequence "public.psql_serial_tab_id_seq"
2762   Type   | Start | Minimum |  Maximum   | Increment | Cycles? | Cache 
2763 ---------+-------+---------+------------+-----------+---------+-------
2764  integer |     1 |       1 | 2147483647 |         1 | no      |     1
2765 Owned by: public.psql_serial_tab.id
2767 \pset tuples_only true
2768 \df exp
2769  pg_catalog | exp  | double precision | double precision    | func
2770  pg_catalog | exp  | numeric          | numeric             | func
2772 \pset tuples_only false
2773 \pset expanded on
2774 \d psql_serial_tab_id_seq
2775 Sequence "public.psql_serial_tab_id_seq"
2776 -[ RECORD 1 ]---------
2777 Type      | integer
2778 Start     | 1
2779 Minimum   | 1
2780 Maximum   | 2147483647
2781 Increment | 1
2782 Cycles?   | no
2783 Cache     | 1
2785 Owned by: public.psql_serial_tab.id
2787 \pset tuples_only true
2788 \df exp
2789 Schema              | pg_catalog
2790 Name                | exp
2791 Result data type    | double precision
2792 Argument data types | double precision
2793 Type                | func
2794 --------------------+-----------------
2795 Schema              | pg_catalog
2796 Name                | exp
2797 Result data type    | numeric
2798 Argument data types | numeric
2799 Type                | func
2801 \pset tuples_only false
2802 -- check conditional am display
2803 \pset expanded off
2804 CREATE SCHEMA tableam_display;
2805 CREATE ROLE regress_display_role;
2806 ALTER SCHEMA tableam_display OWNER TO regress_display_role;
2807 SET search_path TO tableam_display;
2808 CREATE ACCESS METHOD heap_psql TYPE TABLE HANDLER heap_tableam_handler;
2809 SET ROLE TO regress_display_role;
2810 -- Use only relations with a physical size of zero.
2811 CREATE TABLE tbl_heap_psql(f1 int, f2 char(100)) using heap_psql;
2812 CREATE TABLE tbl_heap(f1 int, f2 char(100)) using heap;
2813 CREATE VIEW view_heap_psql AS SELECT f1 from tbl_heap_psql;
2814 CREATE MATERIALIZED VIEW mat_view_heap_psql USING heap_psql AS SELECT f1 from tbl_heap_psql;
2815 \d+ tbl_heap_psql
2816                               Table "tableam_display.tbl_heap_psql"
2817  Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
2818 --------+----------------+-----------+----------+---------+----------+--------------+-------------
2819  f1     | integer        |           |          |         | plain    |              | 
2820  f2     | character(100) |           |          |         | extended |              | 
2822 \d+ tbl_heap
2823                                  Table "tableam_display.tbl_heap"
2824  Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
2825 --------+----------------+-----------+----------+---------+----------+--------------+-------------
2826  f1     | integer        |           |          |         | plain    |              | 
2827  f2     | character(100) |           |          |         | extended |              | 
2829 \set HIDE_TABLEAM off
2830 \d+ tbl_heap_psql
2831                               Table "tableam_display.tbl_heap_psql"
2832  Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
2833 --------+----------------+-----------+----------+---------+----------+--------------+-------------
2834  f1     | integer        |           |          |         | plain    |              | 
2835  f2     | character(100) |           |          |         | extended |              | 
2836 Access method: heap_psql
2838 \d+ tbl_heap
2839                                  Table "tableam_display.tbl_heap"
2840  Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
2841 --------+----------------+-----------+----------+---------+----------+--------------+-------------
2842  f1     | integer        |           |          |         | plain    |              | 
2843  f2     | character(100) |           |          |         | extended |              | 
2844 Access method: heap
2846 -- AM is displayed for tables, indexes and materialized views.
2848                                                            List of relations
2849      Schema      |        Name        |       Type        |        Owner         | Persistence | Access method |  Size   | Description 
2850 -----------------+--------------------+-------------------+----------------------+-------------+---------------+---------+-------------
2851  tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent   | heap_psql     | 0 bytes | 
2852  tableam_display | tbl_heap           | table             | regress_display_role | permanent   | heap          | 0 bytes | 
2853  tableam_display | tbl_heap_psql      | table             | regress_display_role | permanent   | heap_psql     | 0 bytes | 
2854  tableam_display | view_heap_psql     | view              | regress_display_role | permanent   |               | 0 bytes | 
2855 (4 rows)
2857 \dt+
2858                                                   List of relations
2859      Schema      |     Name      | Type  |        Owner         | Persistence | Access method |  Size   | Description 
2860 -----------------+---------------+-------+----------------------+-------------+---------------+---------+-------------
2861  tableam_display | tbl_heap      | table | regress_display_role | permanent   | heap          | 0 bytes | 
2862  tableam_display | tbl_heap_psql | table | regress_display_role | permanent   | heap_psql     | 0 bytes | 
2863 (2 rows)
2865 \dm+
2866                                                            List of relations
2867      Schema      |        Name        |       Type        |        Owner         | Persistence | Access method |  Size   | Description 
2868 -----------------+--------------------+-------------------+----------------------+-------------+---------------+---------+-------------
2869  tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent   | heap_psql     | 0 bytes | 
2870 (1 row)
2872 -- But not for views and sequences.
2873 \dv+
2874                                           List of relations
2875      Schema      |      Name      | Type |        Owner         | Persistence |  Size   | Description 
2876 -----------------+----------------+------+----------------------+-------------+---------+-------------
2877  tableam_display | view_heap_psql | view | regress_display_role | permanent   | 0 bytes | 
2878 (1 row)
2880 \set HIDE_TABLEAM on
2882                                                    List of relations
2883      Schema      |        Name        |       Type        |        Owner         | Persistence |  Size   | Description 
2884 -----------------+--------------------+-------------------+----------------------+-------------+---------+-------------
2885  tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent   | 0 bytes | 
2886  tableam_display | tbl_heap           | table             | regress_display_role | permanent   | 0 bytes | 
2887  tableam_display | tbl_heap_psql      | table             | regress_display_role | permanent   | 0 bytes | 
2888  tableam_display | view_heap_psql     | view              | regress_display_role | permanent   | 0 bytes | 
2889 (4 rows)
2891 RESET ROLE;
2892 RESET search_path;
2893 DROP SCHEMA tableam_display CASCADE;
2894 NOTICE:  drop cascades to 4 other objects
2895 DETAIL:  drop cascades to table tableam_display.tbl_heap_psql
2896 drop cascades to table tableam_display.tbl_heap
2897 drop cascades to view tableam_display.view_heap_psql
2898 drop cascades to materialized view tableam_display.mat_view_heap_psql
2899 DROP ACCESS METHOD heap_psql;
2900 DROP ROLE regress_display_role;
2901 -- test numericlocale (as best we can without control of psql's locale)
2902 \pset format aligned
2903 \pset expanded off
2904 \pset numericlocale true
2905 select n, -n as m, n * 111 as x, '1e90'::float8 as f
2906 from generate_series(0,3) n;
2907  n | m  |  x  |   f   
2908 ---+----+-----+-------
2909  0 |  0 |   0 | 1e+90
2910  1 | -1 | 111 | 1e+90
2911  2 | -2 | 222 | 1e+90
2912  3 | -3 | 333 | 1e+90
2913 (4 rows)
2915 \pset numericlocale false
2916 -- test asciidoc output format
2917 \pset format asciidoc
2918 \pset border 1
2919 \pset expanded off
2920 \d psql_serial_tab_id_seq
2922 .Sequence "public.psql_serial_tab_id_seq"
2923 [options="header",cols="<l,>l,>l,>l,>l,<l,>l",frame="none"]
2924 |====
2925 ^l|Type ^l|Start ^l|Minimum ^l|Maximum ^l|Increment ^l|Cycles? ^l|Cache
2926 |integer |1 |1 |2147483647 |1 |no |1
2927 |====
2929 ....
2930 Owned by: public.psql_serial_tab.id
2931 ....
2932 \pset tuples_only true
2933 \df exp
2935 [cols="<l,<l,<l,<l,<l",frame="none"]
2936 |====
2937 |pg_catalog |exp |double precision |double precision |func
2938 |pg_catalog |exp |numeric |numeric |func
2939 |====
2940 \pset tuples_only false
2941 \pset expanded on
2942 \d psql_serial_tab_id_seq
2944 .Sequence "public.psql_serial_tab_id_seq"
2945 [cols="h,l",frame="none"]
2946 |====
2947 2+^|Record 1
2948 <l|Type <l|integer
2949 <l|Start >l|1
2950 <l|Minimum >l|1
2951 <l|Maximum >l|2147483647
2952 <l|Increment >l|1
2953 <l|Cycles? <l|no
2954 <l|Cache >l|1
2955 |====
2957 ....
2958 Owned by: public.psql_serial_tab.id
2959 ....
2960 \pset tuples_only true
2961 \df exp
2963 [cols="h,l",frame="none"]
2964 |====
2966 <l|Schema <l|pg_catalog
2967 <l|Name <l|exp
2968 <l|Result data type <l|double precision
2969 <l|Argument data types <l|double precision
2970 <l|Type <l|func
2972 <l|Schema <l|pg_catalog
2973 <l|Name <l|exp
2974 <l|Result data type <l|numeric
2975 <l|Argument data types <l|numeric
2976 <l|Type <l|func
2977 |====
2978 \pset tuples_only false
2979 prepare q as
2980   select 'some|text' as "a|title", '        ' as "empty ", n as int
2981   from generate_series(1,2) as n;
2982 \pset expanded off
2983 \pset border 0
2984 execute q;
2986 [options="header",cols="<l,<l,>l",frame="none",grid="none"]
2987 |====
2988 ^l|a\|title ^l|empty  ^l|int
2989 |some\|text |  |1
2990 |some\|text |  |2
2991 |====
2993 ....
2994 (2 rows)
2995 ....
2996 \pset border 1
2997 execute q;
2999 [options="header",cols="<l,<l,>l",frame="none"]
3000 |====
3001 ^l|a\|title ^l|empty  ^l|int
3002 |some\|text |  |1
3003 |some\|text |  |2
3004 |====
3006 ....
3007 (2 rows)
3008 ....
3009 \pset border 2
3010 execute q;
3012 [options="header",cols="<l,<l,>l",frame="all",grid="all"]
3013 |====
3014 ^l|a\|title ^l|empty  ^l|int
3015 |some\|text |  |1
3016 |some\|text |  |2
3017 |====
3019 ....
3020 (2 rows)
3021 ....
3022 \pset expanded on
3023 \pset border 0
3024 execute q;
3026 [cols="h,l",frame="none",grid="none"]
3027 |====
3028 2+^|Record 1
3029 <l|a\|title <l|some\|text
3030 <l|empty  <l| 
3031 <l|int >l|1
3032 2+^|Record 2
3033 <l|a\|title <l|some\|text
3034 <l|empty  <l| 
3035 <l|int >l|2
3036 |====
3037 \pset border 1
3038 execute q;
3040 [cols="h,l",frame="none"]
3041 |====
3042 2+^|Record 1
3043 <l|a\|title <l|some\|text
3044 <l|empty  <l| 
3045 <l|int >l|1
3046 2+^|Record 2
3047 <l|a\|title <l|some\|text
3048 <l|empty  <l| 
3049 <l|int >l|2
3050 |====
3051 \pset border 2
3052 execute q;
3054 [cols="h,l",frame="all",grid="all"]
3055 |====
3056 2+^|Record 1
3057 <l|a\|title <l|some\|text
3058 <l|empty  <l| 
3059 <l|int >l|1
3060 2+^|Record 2
3061 <l|a\|title <l|some\|text
3062 <l|empty  <l| 
3063 <l|int >l|2
3064 |====
3065 deallocate q;
3066 -- test csv output format
3067 \pset format csv
3068 \pset border 1
3069 \pset expanded off
3070 \d psql_serial_tab_id_seq
3071 Type,Start,Minimum,Maximum,Increment,Cycles?,Cache
3072 integer,1,1,2147483647,1,no,1
3073 \pset tuples_only true
3074 \df exp
3075 pg_catalog,exp,double precision,double precision,func
3076 pg_catalog,exp,numeric,numeric,func
3077 \pset tuples_only false
3078 \pset expanded on
3079 \d psql_serial_tab_id_seq
3080 Type,integer
3081 Start,1
3082 Minimum,1
3083 Maximum,2147483647
3084 Increment,1
3085 Cycles?,no
3086 Cache,1
3087 \pset tuples_only true
3088 \df exp
3089 Schema,pg_catalog
3090 Name,exp
3091 Result data type,double precision
3092 Argument data types,double precision
3093 Type,func
3094 Schema,pg_catalog
3095 Name,exp
3096 Result data type,numeric
3097 Argument data types,numeric
3098 Type,func
3099 \pset tuples_only false
3100 prepare q as
3101   select 'some"text' as "a""title", E'  <foo>\n<bar>' as "junk",
3102          '   ' as "empty", n as int
3103   from generate_series(1,2) as n;
3104 \pset expanded off
3105 execute q;
3106 "a""title",junk,empty,int
3107 "some""text","  <foo>
3108 <bar>",   ,1
3109 "some""text","  <foo>
3110 <bar>",   ,2
3111 \pset expanded on
3112 execute q;
3113 "a""title","some""text"
3114 junk,"  <foo>
3115 <bar>"
3116 empty,   
3117 int,1
3118 "a""title","some""text"
3119 junk,"  <foo>
3120 <bar>"
3121 empty,   
3122 int,2
3123 deallocate q;
3124 -- special cases
3125 \pset expanded off
3126 select 'comma,comma' as comma, 'semi;semi' as semi;
3127 comma,semi
3128 "comma,comma",semi;semi
3129 \pset csv_fieldsep ';'
3130 select 'comma,comma' as comma, 'semi;semi' as semi;
3131 comma;semi
3132 comma,comma;"semi;semi"
3133 select '\.' as data;
3134 data
3135 "\."
3136 \pset csv_fieldsep '.'
3137 select '\' as d1, '' as d2;
3138 "d1"."d2"
3139 "\".""
3140 -- illegal csv separators
3141 \pset csv_fieldsep ''
3142 \pset: csv_fieldsep must be a single one-byte character
3143 \pset csv_fieldsep '\0'
3144 \pset: csv_fieldsep must be a single one-byte character
3145 \pset csv_fieldsep '\n'
3146 \pset: csv_fieldsep cannot be a double quote, a newline, or a carriage return
3147 \pset csv_fieldsep '\r'
3148 \pset: csv_fieldsep cannot be a double quote, a newline, or a carriage return
3149 \pset csv_fieldsep '"'
3150 \pset: csv_fieldsep cannot be a double quote, a newline, or a carriage return
3151 \pset csv_fieldsep ',,'
3152 \pset: csv_fieldsep must be a single one-byte character
3153 \pset csv_fieldsep ','
3154 -- test html output format
3155 \pset format html
3156 \pset border 1
3157 \pset expanded off
3158 \d psql_serial_tab_id_seq
3159 <table border="1">
3160   <caption>Sequence &quot;public.psql_serial_tab_id_seq&quot;</caption>
3161   <tr>
3162     <th align="center">Type</th>
3163     <th align="center">Start</th>
3164     <th align="center">Minimum</th>
3165     <th align="center">Maximum</th>
3166     <th align="center">Increment</th>
3167     <th align="center">Cycles?</th>
3168     <th align="center">Cache</th>
3169   </tr>
3170   <tr valign="top">
3171     <td align="left">integer</td>
3172     <td align="right">1</td>
3173     <td align="right">1</td>
3174     <td align="right">2147483647</td>
3175     <td align="right">1</td>
3176     <td align="left">no</td>
3177     <td align="right">1</td>
3178   </tr>
3179 </table>
3180 <p>Owned by: public.psql_serial_tab.id<br />
3181 </p>
3182 \pset tuples_only true
3183 \df exp
3184 <table border="1">
3185   <tr valign="top">
3186     <td align="left">pg_catalog</td>
3187     <td align="left">exp</td>
3188     <td align="left">double precision</td>
3189     <td align="left">double precision</td>
3190     <td align="left">func</td>
3191   </tr>
3192   <tr valign="top">
3193     <td align="left">pg_catalog</td>
3194     <td align="left">exp</td>
3195     <td align="left">numeric</td>
3196     <td align="left">numeric</td>
3197     <td align="left">func</td>
3198   </tr>
3199 </table>
3201 \pset tuples_only false
3202 \pset expanded on
3203 \d psql_serial_tab_id_seq
3204 <table border="1">
3205   <caption>Sequence &quot;public.psql_serial_tab_id_seq&quot;</caption>
3207   <tr><td colspan="2" align="center">Record 1</td></tr>
3208   <tr valign="top">
3209     <th>Type</th>
3210     <td align="left">integer</td>
3211   </tr>
3212   <tr valign="top">
3213     <th>Start</th>
3214     <td align="right">1</td>
3215   </tr>
3216   <tr valign="top">
3217     <th>Minimum</th>
3218     <td align="right">1</td>
3219   </tr>
3220   <tr valign="top">
3221     <th>Maximum</th>
3222     <td align="right">2147483647</td>
3223   </tr>
3224   <tr valign="top">
3225     <th>Increment</th>
3226     <td align="right">1</td>
3227   </tr>
3228   <tr valign="top">
3229     <th>Cycles?</th>
3230     <td align="left">no</td>
3231   </tr>
3232   <tr valign="top">
3233     <th>Cache</th>
3234     <td align="right">1</td>
3235   </tr>
3236 </table>
3237 <p>Owned by: public.psql_serial_tab.id<br />
3238 </p>
3239 \pset tuples_only true
3240 \df exp
3241 <table border="1">
3243   <tr><td colspan="2">&nbsp;</td></tr>
3244   <tr valign="top">
3245     <th>Schema</th>
3246     <td align="left">pg_catalog</td>
3247   </tr>
3248   <tr valign="top">
3249     <th>Name</th>
3250     <td align="left">exp</td>
3251   </tr>
3252   <tr valign="top">
3253     <th>Result data type</th>
3254     <td align="left">double precision</td>
3255   </tr>
3256   <tr valign="top">
3257     <th>Argument data types</th>
3258     <td align="left">double precision</td>
3259   </tr>
3260   <tr valign="top">
3261     <th>Type</th>
3262     <td align="left">func</td>
3263   </tr>
3265   <tr><td colspan="2">&nbsp;</td></tr>
3266   <tr valign="top">
3267     <th>Schema</th>
3268     <td align="left">pg_catalog</td>
3269   </tr>
3270   <tr valign="top">
3271     <th>Name</th>
3272     <td align="left">exp</td>
3273   </tr>
3274   <tr valign="top">
3275     <th>Result data type</th>
3276     <td align="left">numeric</td>
3277   </tr>
3278   <tr valign="top">
3279     <th>Argument data types</th>
3280     <td align="left">numeric</td>
3281   </tr>
3282   <tr valign="top">
3283     <th>Type</th>
3284     <td align="left">func</td>
3285   </tr>
3286 </table>
3288 \pset tuples_only false
3289 prepare q as
3290   select 'some"text' as "a&title", E'  <foo>\n<bar>' as "junk",
3291          '   ' as "empty", n as int
3292   from generate_series(1,2) as n;
3293 \pset expanded off
3294 \pset border 0
3295 execute q;
3296 <table border="0">
3297   <tr>
3298     <th align="center">a&amp;title</th>
3299     <th align="center">junk</th>
3300     <th align="center">empty</th>
3301     <th align="center">int</th>
3302   </tr>
3303   <tr valign="top">
3304     <td align="left">some&quot;text</td>
3305     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3306 &lt;bar&gt;</td>
3307     <td align="left">&nbsp; </td>
3308     <td align="right">1</td>
3309   </tr>
3310   <tr valign="top">
3311     <td align="left">some&quot;text</td>
3312     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3313 &lt;bar&gt;</td>
3314     <td align="left">&nbsp; </td>
3315     <td align="right">2</td>
3316   </tr>
3317 </table>
3318 <p>(2 rows)<br />
3319 </p>
3320 \pset border 1
3321 execute q;
3322 <table border="1">
3323   <tr>
3324     <th align="center">a&amp;title</th>
3325     <th align="center">junk</th>
3326     <th align="center">empty</th>
3327     <th align="center">int</th>
3328   </tr>
3329   <tr valign="top">
3330     <td align="left">some&quot;text</td>
3331     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3332 &lt;bar&gt;</td>
3333     <td align="left">&nbsp; </td>
3334     <td align="right">1</td>
3335   </tr>
3336   <tr valign="top">
3337     <td align="left">some&quot;text</td>
3338     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3339 &lt;bar&gt;</td>
3340     <td align="left">&nbsp; </td>
3341     <td align="right">2</td>
3342   </tr>
3343 </table>
3344 <p>(2 rows)<br />
3345 </p>
3346 \pset tableattr foobar
3347 execute q;
3348 <table border="1" foobar>
3349   <tr>
3350     <th align="center">a&amp;title</th>
3351     <th align="center">junk</th>
3352     <th align="center">empty</th>
3353     <th align="center">int</th>
3354   </tr>
3355   <tr valign="top">
3356     <td align="left">some&quot;text</td>
3357     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3358 &lt;bar&gt;</td>
3359     <td align="left">&nbsp; </td>
3360     <td align="right">1</td>
3361   </tr>
3362   <tr valign="top">
3363     <td align="left">some&quot;text</td>
3364     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3365 &lt;bar&gt;</td>
3366     <td align="left">&nbsp; </td>
3367     <td align="right">2</td>
3368   </tr>
3369 </table>
3370 <p>(2 rows)<br />
3371 </p>
3372 \pset tableattr
3373 \pset expanded on
3374 \pset border 0
3375 execute q;
3376 <table border="0">
3378   <tr><td colspan="2" align="center">Record 1</td></tr>
3379   <tr valign="top">
3380     <th>a&amp;title</th>
3381     <td align="left">some&quot;text</td>
3382   </tr>
3383   <tr valign="top">
3384     <th>junk</th>
3385     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3386 &lt;bar&gt;</td>
3387   </tr>
3388   <tr valign="top">
3389     <th>empty</th>
3390     <td align="left">&nbsp; </td>
3391   </tr>
3392   <tr valign="top">
3393     <th>int</th>
3394     <td align="right">1</td>
3395   </tr>
3397   <tr><td colspan="2" align="center">Record 2</td></tr>
3398   <tr valign="top">
3399     <th>a&amp;title</th>
3400     <td align="left">some&quot;text</td>
3401   </tr>
3402   <tr valign="top">
3403     <th>junk</th>
3404     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3405 &lt;bar&gt;</td>
3406   </tr>
3407   <tr valign="top">
3408     <th>empty</th>
3409     <td align="left">&nbsp; </td>
3410   </tr>
3411   <tr valign="top">
3412     <th>int</th>
3413     <td align="right">2</td>
3414   </tr>
3415 </table>
3417 \pset border 1
3418 execute q;
3419 <table border="1">
3421   <tr><td colspan="2" align="center">Record 1</td></tr>
3422   <tr valign="top">
3423     <th>a&amp;title</th>
3424     <td align="left">some&quot;text</td>
3425   </tr>
3426   <tr valign="top">
3427     <th>junk</th>
3428     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3429 &lt;bar&gt;</td>
3430   </tr>
3431   <tr valign="top">
3432     <th>empty</th>
3433     <td align="left">&nbsp; </td>
3434   </tr>
3435   <tr valign="top">
3436     <th>int</th>
3437     <td align="right">1</td>
3438   </tr>
3440   <tr><td colspan="2" align="center">Record 2</td></tr>
3441   <tr valign="top">
3442     <th>a&amp;title</th>
3443     <td align="left">some&quot;text</td>
3444   </tr>
3445   <tr valign="top">
3446     <th>junk</th>
3447     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3448 &lt;bar&gt;</td>
3449   </tr>
3450   <tr valign="top">
3451     <th>empty</th>
3452     <td align="left">&nbsp; </td>
3453   </tr>
3454   <tr valign="top">
3455     <th>int</th>
3456     <td align="right">2</td>
3457   </tr>
3458 </table>
3460 \pset tableattr foobar
3461 execute q;
3462 <table border="1" foobar>
3464   <tr><td colspan="2" align="center">Record 1</td></tr>
3465   <tr valign="top">
3466     <th>a&amp;title</th>
3467     <td align="left">some&quot;text</td>
3468   </tr>
3469   <tr valign="top">
3470     <th>junk</th>
3471     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3472 &lt;bar&gt;</td>
3473   </tr>
3474   <tr valign="top">
3475     <th>empty</th>
3476     <td align="left">&nbsp; </td>
3477   </tr>
3478   <tr valign="top">
3479     <th>int</th>
3480     <td align="right">1</td>
3481   </tr>
3483   <tr><td colspan="2" align="center">Record 2</td></tr>
3484   <tr valign="top">
3485     <th>a&amp;title</th>
3486     <td align="left">some&quot;text</td>
3487   </tr>
3488   <tr valign="top">
3489     <th>junk</th>
3490     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3491 &lt;bar&gt;</td>
3492   </tr>
3493   <tr valign="top">
3494     <th>empty</th>
3495     <td align="left">&nbsp; </td>
3496   </tr>
3497   <tr valign="top">
3498     <th>int</th>
3499     <td align="right">2</td>
3500   </tr>
3501 </table>
3503 \pset tableattr
3504 deallocate q;
3505 -- test latex output format
3506 \pset format latex
3507 \pset border 1
3508 \pset expanded off
3509 \d psql_serial_tab_id_seq
3510 \begin{center}
3511 Sequence "public.psql\_serial\_tab\_id\_seq"
3512 \end{center}
3514 \begin{tabular}{l | r | r | r | r | l | r}
3515 \textit{Type} & \textit{Start} & \textit{Minimum} & \textit{Maximum} & \textit{Increment} & \textit{Cycles?} & \textit{Cache} \\
3516 \hline
3517 integer & 1 & 1 & 2147483647 & 1 & no & 1 \\
3518 \end{tabular}
3520 \noindent Owned by: public.psql\_serial\_tab.id \\
3522 \pset tuples_only true
3523 \df exp
3524 \begin{tabular}{l | l | l | l | l}
3525 pg\_catalog & exp & double precision & double precision & func \\
3526 pg\_catalog & exp & numeric & numeric & func \\
3527 \end{tabular}
3529 \noindent 
3530 \pset tuples_only false
3531 \pset expanded on
3532 \d psql_serial_tab_id_seq
3533 \begin{center}
3534 Sequence "public.psql\_serial\_tab\_id\_seq"
3535 \end{center}
3537 \begin{tabular}{c|l}
3538 \multicolumn{2}{c}{\textit{Record 1}} \\
3539 \hline
3540 Type & integer \\
3541 Start & 1 \\
3542 Minimum & 1 \\
3543 Maximum & 2147483647 \\
3544 Increment & 1 \\
3545 Cycles? & no \\
3546 Cache & 1 \\
3547 \end{tabular}
3549 \noindent Owned by: public.psql\_serial\_tab.id \\
3551 \pset tuples_only true
3552 \df exp
3553 \begin{tabular}{c|l}
3554 \hline
3555 Schema & pg\_catalog \\
3556 Name & exp \\
3557 Result data type & double precision \\
3558 Argument data types & double precision \\
3559 Type & func \\
3560 \hline
3561 Schema & pg\_catalog \\
3562 Name & exp \\
3563 Result data type & numeric \\
3564 Argument data types & numeric \\
3565 Type & func \\
3566 \end{tabular}
3568 \noindent 
3569 \pset tuples_only false
3570 prepare q as
3571   select 'some\more_text' as "a$title", E'  #<foo>%&^~|\n{bar}' as "junk",
3572          '   ' as "empty", n as int
3573   from generate_series(1,2) as n;
3574 \pset expanded off
3575 \pset border 0
3576 execute q;
3577 \begin{tabular}{lllr}
3578 \textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
3579 \hline
3580 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 1 \\
3581 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 2 \\
3582 \end{tabular}
3584 \noindent (2 rows) \\
3586 \pset border 1
3587 execute q;
3588 \begin{tabular}{l | l | l | r}
3589 \textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
3590 \hline
3591 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 1 \\
3592 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 2 \\
3593 \end{tabular}
3595 \noindent (2 rows) \\
3597 \pset border 2
3598 execute q;
3599 \begin{tabular}{| l | l | l | r |}
3600 \hline
3601 \textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
3602 \hline
3603 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 1 \\
3604 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 2 \\
3605 \hline
3606 \end{tabular}
3608 \noindent (2 rows) \\
3610 \pset border 3
3611 execute q;
3612 \begin{tabular}{| l | l | l | r |}
3613 \hline
3614 \textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
3615 \hline
3616 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 1 \\
3617 \hline
3618 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 2 \\
3619 \hline
3620 \end{tabular}
3622 \noindent (2 rows) \\
3624 \pset expanded on
3625 \pset border 0
3626 execute q;
3627 \begin{tabular}{cl}
3628 \multicolumn{2}{c}{\textit{Record 1}} \\
3629 a\$title & some\textbackslash{}more\_text \\
3630 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3631 empty &     \\
3632 int & 1 \\
3633 \multicolumn{2}{c}{\textit{Record 2}} \\
3634 a\$title & some\textbackslash{}more\_text \\
3635 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3636 empty &     \\
3637 int & 2 \\
3638 \end{tabular}
3640 \noindent 
3641 \pset border 1
3642 execute q;
3643 \begin{tabular}{c|l}
3644 \multicolumn{2}{c}{\textit{Record 1}} \\
3645 \hline
3646 a\$title & some\textbackslash{}more\_text \\
3647 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3648 empty &     \\
3649 int & 1 \\
3650 \multicolumn{2}{c}{\textit{Record 2}} \\
3651 \hline
3652 a\$title & some\textbackslash{}more\_text \\
3653 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3654 empty &     \\
3655 int & 2 \\
3656 \end{tabular}
3658 \noindent 
3659 \pset border 2
3660 execute q;
3661 \begin{tabular}{|c|l|}
3662 \hline
3663 \multicolumn{2}{|c|}{\textit{Record 1}} \\
3664 \hline
3665 a\$title & some\textbackslash{}more\_text \\
3666 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3667 empty &     \\
3668 int & 1 \\
3669 \hline
3670 \multicolumn{2}{|c|}{\textit{Record 2}} \\
3671 \hline
3672 a\$title & some\textbackslash{}more\_text \\
3673 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3674 empty &     \\
3675 int & 2 \\
3676 \hline
3677 \end{tabular}
3679 \noindent 
3680 \pset border 3
3681 execute q;
3682 \begin{tabular}{|c|l|}
3683 \hline
3684 \multicolumn{2}{|c|}{\textit{Record 1}} \\
3685 \hline
3686 a\$title & some\textbackslash{}more\_text \\
3687 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3688 empty &     \\
3689 int & 1 \\
3690 \hline
3691 \multicolumn{2}{|c|}{\textit{Record 2}} \\
3692 \hline
3693 a\$title & some\textbackslash{}more\_text \\
3694 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3695 empty &     \\
3696 int & 2 \\
3697 \hline
3698 \end{tabular}
3700 \noindent 
3701 deallocate q;
3702 -- test latex-longtable output format
3703 \pset format latex-longtable
3704 \pset border 1
3705 \pset expanded off
3706 \d psql_serial_tab_id_seq
3707 \begin{longtable}{l | r | r | r | r | l | r}
3708 \small\textbf{\textit{Type}} & \small\textbf{\textit{Start}} & \small\textbf{\textit{Minimum}} & \small\textbf{\textit{Maximum}} & \small\textbf{\textit{Increment}} & \small\textbf{\textit{Cycles?}} & \small\textbf{\textit{Cache}} \\
3709 \midrule
3710 \endfirsthead
3711 \small\textbf{\textit{Type}} & \small\textbf{\textit{Start}} & \small\textbf{\textit{Minimum}} & \small\textbf{\textit{Maximum}} & \small\textbf{\textit{Increment}} & \small\textbf{\textit{Cycles?}} & \small\textbf{\textit{Cache}} \\
3712 \midrule
3713 \endhead
3714 \caption[Sequence "public.psql\_serial\_tab\_id\_seq" (Continued)]{Sequence "public.psql\_serial\_tab\_id\_seq"}
3715 \endfoot
3716 \caption[Sequence "public.psql\_serial\_tab\_id\_seq"]{Sequence "public.psql\_serial\_tab\_id\_seq"}
3717 \endlastfoot
3718 \raggedright{integer}
3720 \raggedright{1}
3722 \raggedright{1}
3724 \raggedright{2147483647}
3726 \raggedright{1}
3728 \raggedright{no}
3730 \raggedright{1} \tabularnewline
3731 \end{longtable}
3732 \pset tuples_only true
3733 \df exp
3734 \begin{longtable}{l | l | l | l | l}
3735 \raggedright{pg\_catalog}
3737 \raggedright{exp}
3739 \raggedright{double precision}
3741 \raggedright{double precision}
3743 \raggedright{func} \tabularnewline
3744 \raggedright{pg\_catalog}
3746 \raggedright{exp}
3748 \raggedright{numeric}
3750 \raggedright{numeric}
3752 \raggedright{func} \tabularnewline
3753 \end{longtable}
3754 \pset tuples_only false
3755 \pset expanded on
3756 \d psql_serial_tab_id_seq
3757 \begin{center}
3758 Sequence "public.psql\_serial\_tab\_id\_seq"
3759 \end{center}
3761 \begin{tabular}{c|l}
3762 \multicolumn{2}{c}{\textit{Record 1}} \\
3763 \hline
3764 Type & integer \\
3765 Start & 1 \\
3766 Minimum & 1 \\
3767 Maximum & 2147483647 \\
3768 Increment & 1 \\
3769 Cycles? & no \\
3770 Cache & 1 \\
3771 \end{tabular}
3773 \noindent Owned by: public.psql\_serial\_tab.id \\
3775 \pset tuples_only true
3776 \df exp
3777 \begin{tabular}{c|l}
3778 \hline
3779 Schema & pg\_catalog \\
3780 Name & exp \\
3781 Result data type & double precision \\
3782 Argument data types & double precision \\
3783 Type & func \\
3784 \hline
3785 Schema & pg\_catalog \\
3786 Name & exp \\
3787 Result data type & numeric \\
3788 Argument data types & numeric \\
3789 Type & func \\
3790 \end{tabular}
3792 \noindent 
3793 \pset tuples_only false
3794 prepare q as
3795   select 'some\more_text' as "a$title", E'  #<foo>%&^~|\n{bar}' as "junk",
3796          '   ' as "empty", n as int
3797   from generate_series(1,2) as n;
3798 \pset expanded off
3799 \pset border 0
3800 execute q;
3801 \begin{longtable}{lllr}
3802 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3803 \midrule
3804 \endfirsthead
3805 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3806 \midrule
3807 \endhead
3808 \raggedright{some\textbackslash{}more\_text}
3810 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3812 \raggedright{   }
3814 \raggedright{1} \tabularnewline
3815 \raggedright{some\textbackslash{}more\_text}
3817 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3819 \raggedright{   }
3821 \raggedright{2} \tabularnewline
3822 \end{longtable}
3823 \pset border 1
3824 execute q;
3825 \begin{longtable}{l | l | l | r}
3826 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3827 \midrule
3828 \endfirsthead
3829 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3830 \midrule
3831 \endhead
3832 \raggedright{some\textbackslash{}more\_text}
3834 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3836 \raggedright{   }
3838 \raggedright{1} \tabularnewline
3839 \raggedright{some\textbackslash{}more\_text}
3841 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3843 \raggedright{   }
3845 \raggedright{2} \tabularnewline
3846 \end{longtable}
3847 \pset border 2
3848 execute q;
3849 \begin{longtable}{| l | l | l | r |}
3850 \toprule
3851 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3852 \midrule
3853 \endfirsthead
3854 \toprule
3855 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3856 \midrule
3857 \endhead
3858 \bottomrule
3859 \endfoot
3860 \bottomrule
3861 \endlastfoot
3862 \raggedright{some\textbackslash{}more\_text}
3864 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3866 \raggedright{   }
3868 \raggedright{1} \tabularnewline
3869 \raggedright{some\textbackslash{}more\_text}
3871 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3873 \raggedright{   }
3875 \raggedright{2} \tabularnewline
3876 \end{longtable}
3877 \pset border 3
3878 execute q;
3879 \begin{longtable}{| l | l | l | r |}
3880 \toprule
3881 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3882 \midrule
3883 \endfirsthead
3884 \toprule
3885 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3886 \endhead
3887 \bottomrule
3888 \endfoot
3889 \bottomrule
3890 \endlastfoot
3891 \raggedright{some\textbackslash{}more\_text}
3893 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3895 \raggedright{   }
3897 \raggedright{1} \tabularnewline
3898  \hline
3899 \raggedright{some\textbackslash{}more\_text}
3901 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3903 \raggedright{   }
3905 \raggedright{2} \tabularnewline
3906  \hline
3907 \end{longtable}
3908 \pset tableattr lr
3909 execute q;
3910 \begin{longtable}{| p{lr\textwidth} | p{lr\textwidth} | p{lr\textwidth} | r |}
3911 \toprule
3912 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3913 \midrule
3914 \endfirsthead
3915 \toprule
3916 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3917 \endhead
3918 \bottomrule
3919 \endfoot
3920 \bottomrule
3921 \endlastfoot
3922 \raggedright{some\textbackslash{}more\_text}
3924 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3926 \raggedright{   }
3928 \raggedright{1} \tabularnewline
3929  \hline
3930 \raggedright{some\textbackslash{}more\_text}
3932 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3934 \raggedright{   }
3936 \raggedright{2} \tabularnewline
3937  \hline
3938 \end{longtable}
3939 \pset tableattr
3940 \pset expanded on
3941 \pset border 0
3942 execute q;
3943 \begin{tabular}{cl}
3944 \multicolumn{2}{c}{\textit{Record 1}} \\
3945 a\$title & some\textbackslash{}more\_text \\
3946 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3947 empty &     \\
3948 int & 1 \\
3949 \multicolumn{2}{c}{\textit{Record 2}} \\
3950 a\$title & some\textbackslash{}more\_text \\
3951 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3952 empty &     \\
3953 int & 2 \\
3954 \end{tabular}
3956 \noindent 
3957 \pset border 1
3958 execute q;
3959 \begin{tabular}{c|l}
3960 \multicolumn{2}{c}{\textit{Record 1}} \\
3961 \hline
3962 a\$title & some\textbackslash{}more\_text \\
3963 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3964 empty &     \\
3965 int & 1 \\
3966 \multicolumn{2}{c}{\textit{Record 2}} \\
3967 \hline
3968 a\$title & some\textbackslash{}more\_text \\
3969 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3970 empty &     \\
3971 int & 2 \\
3972 \end{tabular}
3974 \noindent 
3975 \pset border 2
3976 execute q;
3977 \begin{tabular}{|c|l|}
3978 \hline
3979 \multicolumn{2}{|c|}{\textit{Record 1}} \\
3980 \hline
3981 a\$title & some\textbackslash{}more\_text \\
3982 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3983 empty &     \\
3984 int & 1 \\
3985 \hline
3986 \multicolumn{2}{|c|}{\textit{Record 2}} \\
3987 \hline
3988 a\$title & some\textbackslash{}more\_text \\
3989 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3990 empty &     \\
3991 int & 2 \\
3992 \hline
3993 \end{tabular}
3995 \noindent 
3996 \pset border 3
3997 execute q;
3998 \begin{tabular}{|c|l|}
3999 \hline
4000 \multicolumn{2}{|c|}{\textit{Record 1}} \\
4001 \hline
4002 a\$title & some\textbackslash{}more\_text \\
4003 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4004 empty &     \\
4005 int & 1 \\
4006 \hline
4007 \multicolumn{2}{|c|}{\textit{Record 2}} \\
4008 \hline
4009 a\$title & some\textbackslash{}more\_text \\
4010 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4011 empty &     \\
4012 int & 2 \\
4013 \hline
4014 \end{tabular}
4016 \noindent 
4017 \pset tableattr lr
4018 execute q;
4019 \begin{tabular}{|c|l|}
4020 \hline
4021 \multicolumn{2}{|c|}{\textit{Record 1}} \\
4022 \hline
4023 a\$title & some\textbackslash{}more\_text \\
4024 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4025 empty &     \\
4026 int & 1 \\
4027 \hline
4028 \multicolumn{2}{|c|}{\textit{Record 2}} \\
4029 \hline
4030 a\$title & some\textbackslash{}more\_text \\
4031 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4032 empty &     \\
4033 int & 2 \\
4034 \hline
4035 \end{tabular}
4037 \noindent 
4038 \pset tableattr
4039 deallocate q;
4040 -- test troff-ms output format
4041 \pset format troff-ms
4042 \pset border 1
4043 \pset expanded off
4044 \d psql_serial_tab_id_seq
4046 .DS C
4047 Sequence "public.psql_serial_tab_id_seq"
4051 center;
4052 l | r | r | r | r | l | r.
4053 \fIType\fP      \fIStart\fP     \fIMinimum\fP   \fIMaximum\fP   \fIIncrement\fP \fICycles?\fP   \fICache\fP
4055 integer 1       1       2147483647      1       no      1
4057 .DS L
4058 Owned by: public.psql_serial_tab.id
4060 \pset tuples_only true
4061 \df exp
4064 center;
4065 l | l | l | l | l.
4066 pg_catalog      exp     double precision        double precision        func
4067 pg_catalog      exp     numeric numeric func
4069 .DS L
4071 \pset tuples_only false
4072 \pset expanded on
4073 \d psql_serial_tab_id_seq
4075 .DS C
4076 Sequence "public.psql_serial_tab_id_seq"
4080 center;
4081 c s.
4082 \fIRecord 1\fP
4085 c | l.
4086 Type    integer
4087 Start   1
4088 Minimum 1
4089 Maximum 2147483647
4090 Increment       1
4091 Cycles? no
4092 Cache   1
4094 .DS L
4095 Owned by: public.psql_serial_tab.id
4097 \pset tuples_only true
4098 \df exp
4101 center;
4102 c l;
4104 Schema  pg_catalog
4105 Name    exp
4106 Result data type        double precision
4107 Argument data types     double precision
4108 Type    func
4110 Schema  pg_catalog
4111 Name    exp
4112 Result data type        numeric
4113 Argument data types     numeric
4114 Type    func
4116 .DS L
4118 \pset tuples_only false
4119 prepare q as
4120   select 'some\text' as "a\title", E'  <foo>\n<bar>' as "junk",
4121          '   ' as "empty", n as int
4122   from generate_series(1,2) as n;
4123 \pset expanded off
4124 \pset border 0
4125 execute q;
4128 center;
4129 lllr.
4130 \fIa\(rstitle\fP        \fIjunk\fP      \fIempty\fP     \fIint\fP
4132 some\(rstext      <foo>
4133 <bar>           1
4134 some\(rstext      <foo>
4135 <bar>           2
4137 .DS L
4138 (2 rows)
4140 \pset border 1
4141 execute q;
4144 center;
4145 l | l | l | r.
4146 \fIa\(rstitle\fP        \fIjunk\fP      \fIempty\fP     \fIint\fP
4148 some\(rstext      <foo>
4149 <bar>           1
4150 some\(rstext      <foo>
4151 <bar>           2
4153 .DS L
4154 (2 rows)
4156 \pset border 2
4157 execute q;
4160 center box;
4161 l | l | l | r.
4162 \fIa\(rstitle\fP        \fIjunk\fP      \fIempty\fP     \fIint\fP
4164 some\(rstext      <foo>
4165 <bar>           1
4166 some\(rstext      <foo>
4167 <bar>           2
4169 .DS L
4170 (2 rows)
4172 \pset expanded on
4173 \pset border 0
4174 execute q;
4177 center;
4178 c s.
4179 \fIRecord 1\fP
4181 c l.
4182 a\(rstitle      some\(rstext
4183 junk      <foo>
4184 <bar>
4185 empty      
4186 int     1
4188 c s.
4189 \fIRecord 2\fP
4191 c l.
4192 a\(rstitle      some\(rstext
4193 junk      <foo>
4194 <bar>
4195 empty      
4196 int     2
4198 .DS L
4200 \pset border 1
4201 execute q;
4204 center;
4205 c s.
4206 \fIRecord 1\fP
4209 c | l.
4210 a\(rstitle      some\(rstext
4211 junk      <foo>
4212 <bar>
4213 empty      
4214 int     1
4216 c s.
4217 \fIRecord 2\fP
4220 c | l.
4221 a\(rstitle      some\(rstext
4222 junk      <foo>
4223 <bar>
4224 empty      
4225 int     2
4227 .DS L
4229 \pset border 2
4230 execute q;
4233 center box;
4234 c s.
4235 \fIRecord 1\fP
4238 c l.
4239 a\(rstitle      some\(rstext
4240 junk      <foo>
4241 <bar>
4242 empty      
4243 int     1
4246 c s.
4247 \fIRecord 2\fP
4250 c l.
4251 a\(rstitle      some\(rstext
4252 junk      <foo>
4253 <bar>
4254 empty      
4255 int     2
4257 .DS L
4259 deallocate q;
4260 -- check ambiguous format requests
4261 \pset format a
4262 \pset: ambiguous abbreviation "a" matches both "aligned" and "asciidoc"
4263 \pset format l
4264 -- clean up after output format tests
4265 drop table psql_serial_tab;
4266 \pset format aligned
4267 \pset expanded off
4268 \pset border 1
4269 -- \echo and allied features
4270 \echo this is a test
4271 this is a test
4272 \echo -n without newline
4273 without newline\echo with -n newline
4274 with -n newline
4275 \echo '-n' with newline
4276 -n with newline
4277 \set foo bar
4278 \echo foo = :foo
4279 foo = bar
4280 \qecho this is a test
4281 this is a test
4282 \qecho foo = :foo
4283 foo = bar
4284 \warn this is a test
4285 this is a test
4286 \warn foo = :foo
4287 foo = bar
4288 -- tests for \if ... \endif
4289 \if true
4290   select 'okay';
4291  ?column? 
4292 ----------
4293  okay
4294 (1 row)
4296   select 'still okay';
4297   ?column?  
4298 ------------
4299  still okay
4300 (1 row)
4302 \else
4303   not okay;
4304   still not okay
4305 \endif
4306 -- at this point query buffer should still have last valid line
4308   ?column?  
4309 ------------
4310  still okay
4311 (1 row)
4313 -- \if should work okay on part of a query
4314 select
4315   \if true
4316     42
4317   \else
4318     (bogus
4319   \endif
4320   forty_two;
4321  forty_two 
4322 -----------
4323         42
4324 (1 row)
4326 select \if false \\ (bogus \else \\ 42 \endif \\ forty_two;
4327  forty_two 
4328 -----------
4329         42
4330 (1 row)
4332 -- test a large nested if using a variety of true-equivalents
4333 \if true
4334         \if 1
4335                 \if yes
4336                         \if on
4337                                 \echo 'all true'
4338 all true
4339                         \else
4340                                 \echo 'should not print #1-1'
4341                         \endif
4342                 \else
4343                         \echo 'should not print #1-2'
4344                 \endif
4345         \else
4346                 \echo 'should not print #1-3'
4347         \endif
4348 \else
4349         \echo 'should not print #1-4'
4350 \endif
4351 -- test a variety of false-equivalents in an if/elif/else structure
4352 \if false
4353         \echo 'should not print #2-1'
4354 \elif 0
4355         \echo 'should not print #2-2'
4356 \elif no
4357         \echo 'should not print #2-3'
4358 \elif off
4359         \echo 'should not print #2-4'
4360 \else
4361         \echo 'all false'
4362 all false
4363 \endif
4364 -- test true-false elif after initial true branch
4365 \if true
4366         \echo 'should print #2-5'
4367 should print #2-5
4368 \elif true
4369         \echo 'should not print #2-6'
4370 \elif false
4371         \echo 'should not print #2-7'
4372 \else
4373         \echo 'should not print #2-8'
4374 \endif
4375 -- test simple true-then-else
4376 \if true
4377         \echo 'first thing true'
4378 first thing true
4379 \else
4380         \echo 'should not print #3-1'
4381 \endif
4382 -- test simple false-true-else
4383 \if false
4384         \echo 'should not print #4-1'
4385 \elif true
4386         \echo 'second thing true'
4387 second thing true
4388 \else
4389         \echo 'should not print #5-1'
4390 \endif
4391 -- invalid boolean expressions are false
4392 \if invalid boolean expression
4393 unrecognized value "invalid boolean expression" for "\if expression": Boolean expected
4394         \echo 'will not print #6-1'
4395 \else
4396         \echo 'will print anyway #6-2'
4397 will print anyway #6-2
4398 \endif
4399 -- test un-matched endif
4400 \endif
4401 \endif: no matching \if
4402 -- test un-matched else
4403 \else
4404 \else: no matching \if
4405 -- test un-matched elif
4406 \elif
4407 \elif: no matching \if
4408 -- test double-else error
4409 \if true
4410 \else
4411 \else
4412 \else: cannot occur after \else
4413 \endif
4414 -- test elif out-of-order
4415 \if false
4416 \else
4417 \elif
4418 \elif: cannot occur after \else
4419 \endif
4420 -- test if-endif matching in a false branch
4421 \if false
4422     \if false
4423         \echo 'should not print #7-1'
4424     \else
4425         \echo 'should not print #7-2'
4426     \endif
4427     \echo 'should not print #7-3'
4428 \else
4429     \echo 'should print #7-4'
4430 should print #7-4
4431 \endif
4432 -- show that vars and backticks are not expanded when ignoring extra args
4433 \set foo bar
4434 \echo :foo :'foo' :"foo"
4435 bar 'bar' "bar"
4436 \pset fieldsep | `nosuchcommand` :foo :'foo' :"foo"
4437 \pset: extra argument "nosuchcommand" ignored
4438 \pset: extra argument ":foo" ignored
4439 \pset: extra argument ":'foo'" ignored
4440 \pset: extra argument ":"foo"" ignored
4441 -- show that vars and backticks are not expanded and commands are ignored
4442 -- when in a false if-branch
4443 \set try_to_quit '\\q'
4444 \if false
4445         :try_to_quit
4446         \echo `nosuchcommand` :foo :'foo' :"foo"
4447         \pset fieldsep | `nosuchcommand` :foo :'foo' :"foo"
4448         \a
4449         \C arg1
4450         \c arg1 arg2 arg3 arg4
4451         \cd arg1
4452         \conninfo
4453         \copy arg1 arg2 arg3 arg4 arg5 arg6
4454         \copyright
4455         SELECT 1 as one, 2, 3 \crosstabview
4456         \dt arg1
4457         \e arg1 arg2
4458         \ef whole_line
4459         \ev whole_line
4460         \echo arg1 arg2 arg3 arg4 arg5
4461         \echo arg1
4462         \encoding arg1
4463         \errverbose
4464         \f arg1
4465         \g arg1
4466         \gx arg1
4467         \gexec
4468         SELECT 1 AS one \gset
4469         \h
4470         \?
4471         \html
4472         \i arg1
4473         \ir arg1
4474         \l arg1
4475         \lo arg1 arg2
4476 invalid command \lo
4477         \lo_list
4478         \o arg1
4479         \p
4480         \password arg1
4481         \prompt arg1 arg2
4482         \pset arg1 arg2
4483         \q
4484         \reset
4485         \s arg1
4486         \set arg1 arg2 arg3 arg4 arg5 arg6 arg7
4487         \setenv arg1 arg2
4488         \sf whole_line
4489         \sv whole_line
4490         \t arg1
4491         \T arg1
4492         \timing arg1
4493         \unset arg1
4494         \w arg1
4495         \watch arg1
4496         \x arg1
4497         -- \else here is eaten as part of OT_FILEPIPE argument
4498         \w |/no/such/file \else
4499         -- \endif here is eaten as part of whole-line argument
4500         \! whole_line \endif
4501         \z
4502 \else
4503         \echo 'should print #8-1'
4504 should print #8-1
4505 \endif
4506 -- :{?...} defined variable test
4507 \set i 1
4508 \if :{?i}
4509   \echo '#9-1 ok, variable i is defined'
4510 #9-1 ok, variable i is defined
4511 \else
4512   \echo 'should not print #9-2'
4513 \endif
4514 \if :{?no_such_variable}
4515   \echo 'should not print #10-1'
4516 \else
4517   \echo '#10-2 ok, variable no_such_variable is not defined'
4518 #10-2 ok, variable no_such_variable is not defined
4519 \endif
4520 SELECT :{?i} AS i_is_defined;
4521  i_is_defined 
4522 --------------
4524 (1 row)
4526 SELECT NOT :{?no_such_var} AS no_such_var_is_not_defined;
4527  no_such_var_is_not_defined 
4528 ----------------------------
4530 (1 row)
4532 -- SHOW_CONTEXT
4533 \set SHOW_CONTEXT never
4534 do $$
4535 begin
4536   raise notice 'foo';
4537   raise exception 'bar';
4538 end $$;
4539 NOTICE:  foo
4540 ERROR:  bar
4541 \set SHOW_CONTEXT errors
4542 do $$
4543 begin
4544   raise notice 'foo';
4545   raise exception 'bar';
4546 end $$;
4547 NOTICE:  foo
4548 ERROR:  bar
4549 CONTEXT:  PL/pgSQL function inline_code_block line 4 at RAISE
4550 \set SHOW_CONTEXT always
4551 do $$
4552 begin
4553   raise notice 'foo';
4554   raise exception 'bar';
4555 end $$;
4556 NOTICE:  foo
4557 CONTEXT:  PL/pgSQL function inline_code_block line 3 at RAISE
4558 ERROR:  bar
4559 CONTEXT:  PL/pgSQL function inline_code_block line 4 at RAISE
4560 -- test printing and clearing the query buffer
4561 SELECT 1;
4562  ?column? 
4563 ----------
4564         1
4565 (1 row)
4568 SELECT 1;
4569 SELECT 2 \r
4571 SELECT 1;
4572 SELECT 3 \p
4573 SELECT 3 
4574 UNION SELECT 4 \p
4575 SELECT 3 
4576 UNION SELECT 4 
4577 UNION SELECT 5
4578 ORDER BY 1;
4579  ?column? 
4580 ----------
4581         3
4582         4
4583         5
4584 (3 rows)
4588 SELECT 3 
4589 UNION SELECT 4 
4590 UNION SELECT 5
4591 ORDER BY 1;
4592 -- tests for special result variables
4593 -- working query, 2 rows selected
4594 SELECT 1 AS stuff UNION SELECT 2;
4595  stuff 
4596 -------
4597      1
4598      2
4599 (2 rows)
4601 \echo 'error:' :ERROR
4602 error: false
4603 \echo 'error code:' :SQLSTATE
4604 error code: 00000
4605 \echo 'number of rows:' :ROW_COUNT
4606 number of rows: 2
4607 -- syntax error
4608 SELECT 1 UNION;
4609 ERROR:  syntax error at or near ";"
4610 LINE 1: SELECT 1 UNION;
4611                       ^
4612 \echo 'error:' :ERROR
4613 error: true
4614 \echo 'error code:' :SQLSTATE
4615 error code: 42601
4616 \echo 'number of rows:' :ROW_COUNT
4617 number of rows: 0
4618 \echo 'last error message:' :LAST_ERROR_MESSAGE
4619 last error message: syntax error at or near ";"
4620 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4621 last error code: 42601
4622 -- empty query
4624 \echo 'error:' :ERROR
4625 error: false
4626 \echo 'error code:' :SQLSTATE
4627 error code: 00000
4628 \echo 'number of rows:' :ROW_COUNT
4629 number of rows: 0
4630 -- must have kept previous values
4631 \echo 'last error message:' :LAST_ERROR_MESSAGE
4632 last error message: syntax error at or near ";"
4633 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4634 last error code: 42601
4635 -- other query error
4636 DROP TABLE this_table_does_not_exist;
4637 ERROR:  table "this_table_does_not_exist" does not exist
4638 \echo 'error:' :ERROR
4639 error: true
4640 \echo 'error code:' :SQLSTATE
4641 error code: 42P01
4642 \echo 'number of rows:' :ROW_COUNT
4643 number of rows: 0
4644 \echo 'last error message:' :LAST_ERROR_MESSAGE
4645 last error message: table "this_table_does_not_exist" does not exist
4646 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4647 last error code: 42P01
4648 -- nondefault verbosity error settings (except verbose, which is too unstable)
4649 \set VERBOSITY terse
4650 SELECT 1 UNION;
4651 ERROR:  syntax error at or near ";" at character 15
4652 \echo 'error:' :ERROR
4653 error: true
4654 \echo 'error code:' :SQLSTATE
4655 error code: 42601
4656 \echo 'last error message:' :LAST_ERROR_MESSAGE
4657 last error message: syntax error at or near ";"
4658 \set VERBOSITY sqlstate
4659 SELECT 1/0;
4660 ERROR:  22012
4661 \echo 'error:' :ERROR
4662 error: true
4663 \echo 'error code:' :SQLSTATE
4664 error code: 22012
4665 \echo 'last error message:' :LAST_ERROR_MESSAGE
4666 last error message: division by zero
4667 \set VERBOSITY default
4668 -- working \gdesc
4669 SELECT 3 AS three, 4 AS four \gdesc
4670  Column |  Type   
4671 --------+---------
4672  three  | integer
4673  four   | integer
4674 (2 rows)
4676 \echo 'error:' :ERROR
4677 error: false
4678 \echo 'error code:' :SQLSTATE
4679 error code: 00000
4680 \echo 'number of rows:' :ROW_COUNT
4681 number of rows: 2
4682 -- \gdesc with an error
4683 SELECT 4 AS \gdesc
4684 ERROR:  syntax error at end of input
4685 LINE 1: SELECT 4 AS 
4686                     ^
4687 \echo 'error:' :ERROR
4688 error: true
4689 \echo 'error code:' :SQLSTATE
4690 error code: 42601
4691 \echo 'number of rows:' :ROW_COUNT
4692 number of rows: 0
4693 \echo 'last error message:' :LAST_ERROR_MESSAGE
4694 last error message: syntax error at end of input
4695 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4696 last error code: 42601
4697 -- check row count for a cursor-fetched query
4698 \set FETCH_COUNT 10
4699 select unique2 from tenk1 order by unique2 limit 19;
4700  unique2 
4701 ---------
4702        0
4703        1
4704        2
4705        3
4706        4
4707        5
4708        6
4709        7
4710        8
4711        9
4712       10
4713       11
4714       12
4715       13
4716       14
4717       15
4718       16
4719       17
4720       18
4721 (19 rows)
4723 \echo 'error:' :ERROR
4724 error: false
4725 \echo 'error code:' :SQLSTATE
4726 error code: 00000
4727 \echo 'number of rows:' :ROW_COUNT
4728 number of rows: 19
4729 -- cursor-fetched query with an error after the first group
4730 select 1/(15-unique2) from tenk1 order by unique2 limit 19;
4731  ?column? 
4732 ----------
4733         0
4734         0
4735         0
4736         0
4737         0
4738         0
4739         0
4740         0
4741         0
4742         0
4743 ERROR:  division by zero
4744 \echo 'error:' :ERROR
4745 error: true
4746 \echo 'error code:' :SQLSTATE
4747 error code: 22012
4748 \echo 'number of rows:' :ROW_COUNT
4749 number of rows: 0
4750 \echo 'last error message:' :LAST_ERROR_MESSAGE
4751 last error message: division by zero
4752 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4753 last error code: 22012
4754 \unset FETCH_COUNT
4755 create schema testpart;
4756 create role regress_partitioning_role;
4757 alter schema testpart owner to regress_partitioning_role;
4758 set role to regress_partitioning_role;
4759 -- run test inside own schema and hide other partitions
4760 set search_path to testpart;
4761 create table testtable_apple(logdate date);
4762 create table testtable_orange(logdate date);
4763 create index testtable_apple_index on testtable_apple(logdate);
4764 create index testtable_orange_index on testtable_orange(logdate);
4765 create table testpart_apple(logdate date) partition by range(logdate);
4766 create table testpart_orange(logdate date) partition by range(logdate);
4767 create index testpart_apple_index on testpart_apple(logdate);
4768 create index testpart_orange_index on testpart_orange(logdate);
4769 -- only partition related object should be displayed
4770 \dP test*apple*
4771                                          List of partitioned relations
4772   Schema  |         Name         |           Owner           |       Type        | Parent name |     Table      
4773 ----------+----------------------+---------------------------+-------------------+-------------+----------------
4774  testpart | testpart_apple       | regress_partitioning_role | partitioned table |             | 
4775  testpart | testpart_apple_index | regress_partitioning_role | partitioned index |             | testpart_apple
4776 (2 rows)
4778 \dPt test*apple*
4779                      List of partitioned tables
4780   Schema  |      Name      |           Owner           | Parent name 
4781 ----------+----------------+---------------------------+-------------
4782  testpart | testpart_apple | regress_partitioning_role | 
4783 (1 row)
4785 \dPi test*apple*
4786                                 List of partitioned indexes
4787   Schema  |         Name         |           Owner           | Parent name |     Table      
4788 ----------+----------------------+---------------------------+-------------+----------------
4789  testpart | testpart_apple_index | regress_partitioning_role |             | testpart_apple
4790 (1 row)
4792 drop table testtable_apple;
4793 drop table testtable_orange;
4794 drop table testpart_apple;
4795 drop table testpart_orange;
4796 create table parent_tab (id int) partition by range (id);
4797 create index parent_index on parent_tab (id);
4798 create table child_0_10 partition of parent_tab
4799   for values from (0) to (10);
4800 create table child_10_20 partition of parent_tab
4801   for values from (10) to (20);
4802 create table child_20_30 partition of parent_tab
4803   for values from (20) to (30);
4804 insert into parent_tab values (generate_series(0,29));
4805 create table child_30_40 partition of parent_tab
4806 for values from (30) to (40)
4807   partition by range(id);
4808 create table child_30_35 partition of child_30_40
4809   for values from (30) to (35);
4810 create table child_35_40 partition of child_30_40
4811    for values from (35) to (40);
4812 insert into parent_tab values (generate_series(30,39));
4813 \dPt
4814             List of partitioned tables
4815   Schema  |    Name    |           Owner           
4816 ----------+------------+---------------------------
4817  testpart | parent_tab | regress_partitioning_role
4818 (1 row)
4820 \dPi
4821                    List of partitioned indexes
4822   Schema  |     Name     |           Owner           |   Table    
4823 ----------+--------------+---------------------------+------------
4824  testpart | parent_index | regress_partitioning_role | parent_tab
4825 (1 row)
4827 \dP testpart.*
4828                                        List of partitioned relations
4829   Schema  |        Name        |           Owner           |       Type        | Parent name  |    Table    
4830 ----------+--------------------+---------------------------+-------------------+--------------+-------------
4831  testpart | parent_tab         | regress_partitioning_role | partitioned table |              | 
4832  testpart | child_30_40        | regress_partitioning_role | partitioned table | parent_tab   | 
4833  testpart | parent_index       | regress_partitioning_role | partitioned index |              | parent_tab
4834  testpart | child_30_40_id_idx | regress_partitioning_role | partitioned index | parent_index | child_30_40
4835 (4 rows)
4838                             List of partitioned relations
4839   Schema  |     Name     |           Owner           |       Type        |   Table    
4840 ----------+--------------+---------------------------+-------------------+------------
4841  testpart | parent_tab   | regress_partitioning_role | partitioned table | 
4842  testpart | parent_index | regress_partitioning_role | partitioned index | parent_tab
4843 (2 rows)
4845 \dPtn
4846                     List of partitioned tables
4847   Schema  |    Name     |           Owner           | Parent name 
4848 ----------+-------------+---------------------------+-------------
4849  testpart | parent_tab  | regress_partitioning_role | 
4850  testpart | child_30_40 | regress_partitioning_role | parent_tab
4851 (2 rows)
4853 \dPin
4854                               List of partitioned indexes
4855   Schema  |        Name        |           Owner           | Parent name  |    Table    
4856 ----------+--------------------+---------------------------+--------------+-------------
4857  testpart | parent_index       | regress_partitioning_role |              | parent_tab
4858  testpart | child_30_40_id_idx | regress_partitioning_role | parent_index | child_30_40
4859 (2 rows)
4861 \dPn
4862                                        List of partitioned relations
4863   Schema  |        Name        |           Owner           |       Type        | Parent name  |    Table    
4864 ----------+--------------------+---------------------------+-------------------+--------------+-------------
4865  testpart | parent_tab         | regress_partitioning_role | partitioned table |              | 
4866  testpart | child_30_40        | regress_partitioning_role | partitioned table | parent_tab   | 
4867  testpart | parent_index       | regress_partitioning_role | partitioned index |              | parent_tab
4868  testpart | child_30_40_id_idx | regress_partitioning_role | partitioned index | parent_index | child_30_40
4869 (4 rows)
4871 \dPn testpart.*
4872                                        List of partitioned relations
4873   Schema  |        Name        |           Owner           |       Type        | Parent name  |    Table    
4874 ----------+--------------------+---------------------------+-------------------+--------------+-------------
4875  testpart | parent_tab         | regress_partitioning_role | partitioned table |              | 
4876  testpart | child_30_40        | regress_partitioning_role | partitioned table | parent_tab   | 
4877  testpart | parent_index       | regress_partitioning_role | partitioned index |              | parent_tab
4878  testpart | child_30_40_id_idx | regress_partitioning_role | partitioned index | parent_index | child_30_40
4879 (4 rows)
4881 drop table parent_tab cascade;
4882 drop schema testpart;
4883 set search_path to default;
4884 set role to default;
4885 drop role regress_partitioning_role;
4886 -- \d on toast table (use pg_statistic's toast table, which has a known name)
4887 \d pg_toast.pg_toast_2619
4888 TOAST table "pg_toast.pg_toast_2619"
4889    Column   |  Type   
4890 ------------+---------
4891  chunk_id   | oid
4892  chunk_seq  | integer
4893  chunk_data | bytea
4894 Owning table: "pg_catalog.pg_statistic"
4895 Indexes:
4896     "pg_toast_2619_index" PRIMARY KEY, btree (chunk_id, chunk_seq)
4898 -- check printing info about access methods
4900 List of access methods
4901   Name  | Type  
4902 --------+-------
4903  brin   | Index
4904  btree  | Index
4905  gin    | Index
4906  gist   | Index
4907  hash   | Index
4908  heap   | Table
4909  heap2  | Table
4910  spgist | Index
4911 (8 rows)
4913 \dA *
4914 List of access methods
4915   Name  | Type  
4916 --------+-------
4917  brin   | Index
4918  btree  | Index
4919  gin    | Index
4920  gist   | Index
4921  hash   | Index
4922  heap   | Table
4923  heap2  | Table
4924  spgist | Index
4925 (8 rows)
4927 \dA h*
4928 List of access methods
4929  Name  | Type  
4930 -------+-------
4931  hash  | Index
4932  heap  | Table
4933  heap2 | Table
4934 (3 rows)
4936 \dA foo
4937 List of access methods
4938  Name | Type 
4939 ------+------
4940 (0 rows)
4942 \dA foo bar
4943 List of access methods
4944  Name | Type 
4945 ------+------
4946 (0 rows)
4948 \dA: extra argument "bar" ignored
4949 \dA+
4950                              List of access methods
4951   Name  | Type  |       Handler        |              Description               
4952 --------+-------+----------------------+----------------------------------------
4953  brin   | Index | brinhandler          | block range index (BRIN) access method
4954  btree  | Index | bthandler            | b-tree index access method
4955  gin    | Index | ginhandler           | GIN index access method
4956  gist   | Index | gisthandler          | GiST index access method
4957  hash   | Index | hashhandler          | hash index access method
4958  heap   | Table | heap_tableam_handler | heap table access method
4959  heap2  | Table | heap_tableam_handler | 
4960  spgist | Index | spghandler           | SP-GiST index access method
4961 (8 rows)
4963 \dA+ *
4964                              List of access methods
4965   Name  | Type  |       Handler        |              Description               
4966 --------+-------+----------------------+----------------------------------------
4967  brin   | Index | brinhandler          | block range index (BRIN) access method
4968  btree  | Index | bthandler            | b-tree index access method
4969  gin    | Index | ginhandler           | GIN index access method
4970  gist   | Index | gisthandler          | GiST index access method
4971  hash   | Index | hashhandler          | hash index access method
4972  heap   | Table | heap_tableam_handler | heap table access method
4973  heap2  | Table | heap_tableam_handler | 
4974  spgist | Index | spghandler           | SP-GiST index access method
4975 (8 rows)
4977 \dA+ h*
4978                      List of access methods
4979  Name  | Type  |       Handler        |       Description        
4980 -------+-------+----------------------+--------------------------
4981  hash  | Index | hashhandler          | hash index access method
4982  heap  | Table | heap_tableam_handler | heap table access method
4983  heap2 | Table | heap_tableam_handler | 
4984 (3 rows)
4986 \dA+ foo
4987        List of access methods
4988  Name | Type | Handler | Description 
4989 ------+------+---------+-------------
4990 (0 rows)
4992 \dAc brin pg*.oid*
4993                       List of operator classes
4994   AM  | Input type | Storage type |    Operator class    | Default? 
4995 ------+------------+--------------+----------------------+----------
4996  brin | oid        |              | oid_bloom_ops        | no
4997  brin | oid        |              | oid_minmax_multi_ops | no
4998  brin | oid        |              | oid_minmax_ops       | yes
4999 (3 rows)
5001 \dAf spgist
5002           List of operator families
5003    AM   | Operator family | Applicable types 
5004 --------+-----------------+------------------
5005  spgist | box_ops         | box
5006  spgist | kd_point_ops    | point
5007  spgist | network_ops     | inet
5008  spgist | poly_ops        | polygon
5009  spgist | quad_point_ops  | point
5010  spgist | range_ops       | anyrange
5011  spgist | text_ops        | text
5012 (7 rows)
5014 \dAf btree int4
5015               List of operator families
5016   AM   | Operator family |     Applicable types      
5017 -------+-----------------+---------------------------
5018  btree | integer_ops     | smallint, integer, bigint
5019 (1 row)
5021 \dAo+ btree float_ops
5022                                 List of operators of operator families
5023   AM   | Operator family |               Operator                | Strategy | Purpose | Sort opfamily 
5024 -------+-----------------+---------------------------------------+----------+---------+---------------
5025  btree | float_ops       | <(double precision,double precision)  |        1 | search  | 
5026  btree | float_ops       | <=(double precision,double precision) |        2 | search  | 
5027  btree | float_ops       | =(double precision,double precision)  |        3 | search  | 
5028  btree | float_ops       | >=(double precision,double precision) |        4 | search  | 
5029  btree | float_ops       | >(double precision,double precision)  |        5 | search  | 
5030  btree | float_ops       | <(real,real)                          |        1 | search  | 
5031  btree | float_ops       | <=(real,real)                         |        2 | search  | 
5032  btree | float_ops       | =(real,real)                          |        3 | search  | 
5033  btree | float_ops       | >=(real,real)                         |        4 | search  | 
5034  btree | float_ops       | >(real,real)                          |        5 | search  | 
5035  btree | float_ops       | <(double precision,real)              |        1 | search  | 
5036  btree | float_ops       | <=(double precision,real)             |        2 | search  | 
5037  btree | float_ops       | =(double precision,real)              |        3 | search  | 
5038  btree | float_ops       | >=(double precision,real)             |        4 | search  | 
5039  btree | float_ops       | >(double precision,real)              |        5 | search  | 
5040  btree | float_ops       | <(real,double precision)              |        1 | search  | 
5041  btree | float_ops       | <=(real,double precision)             |        2 | search  | 
5042  btree | float_ops       | =(real,double precision)              |        3 | search  | 
5043  btree | float_ops       | >=(real,double precision)             |        4 | search  | 
5044  btree | float_ops       | >(real,double precision)              |        5 | search  | 
5045 (20 rows)
5047 \dAo * pg_catalog.jsonb_path_ops
5048              List of operators of operator families
5049  AM  | Operator family |      Operator      | Strategy | Purpose 
5050 -----+-----------------+--------------------+----------+---------
5051  gin | jsonb_path_ops  | @>(jsonb,jsonb)    |        7 | search
5052  gin | jsonb_path_ops  | @?(jsonb,jsonpath) |       15 | search
5053  gin | jsonb_path_ops  | @@(jsonb,jsonpath) |       16 | search
5054 (3 rows)
5056 \dAp+ btree float_ops
5057                                                          List of support functions of operator families
5058   AM   | Operator family | Registered left type | Registered right type | Number |                                   Function                                   
5059 -------+-----------------+----------------------+-----------------------+--------+------------------------------------------------------------------------------
5060  btree | float_ops       | double precision     | double precision      |      1 | btfloat8cmp(double precision,double precision)
5061  btree | float_ops       | double precision     | double precision      |      2 | btfloat8sortsupport(internal)
5062  btree | float_ops       | double precision     | double precision      |      3 | in_range(double precision,double precision,double precision,boolean,boolean)
5063  btree | float_ops       | real                 | real                  |      1 | btfloat4cmp(real,real)
5064  btree | float_ops       | real                 | real                  |      2 | btfloat4sortsupport(internal)
5065  btree | float_ops       | double precision     | real                  |      1 | btfloat84cmp(double precision,real)
5066  btree | float_ops       | real                 | double precision      |      1 | btfloat48cmp(real,double precision)
5067  btree | float_ops       | real                 | double precision      |      3 | in_range(real,real,double precision,boolean,boolean)
5068 (8 rows)
5070 \dAp * pg_catalog.uuid_ops
5071                             List of support functions of operator families
5072   AM   | Operator family | Registered left type | Registered right type | Number |      Function      
5073 -------+-----------------+----------------------+-----------------------+--------+--------------------
5074  btree | uuid_ops        | uuid                 | uuid                  |      1 | uuid_cmp
5075  btree | uuid_ops        | uuid                 | uuid                  |      2 | uuid_sortsupport
5076  btree | uuid_ops        | uuid                 | uuid                  |      4 | btequalimage
5077  hash  | uuid_ops        | uuid                 | uuid                  |      1 | uuid_hash
5078  hash  | uuid_ops        | uuid                 | uuid                  |      2 | uuid_hash_extended
5079 (5 rows)
5081 -- check \df, \do with argument specifications
5082 \df *sqrt
5083                              List of functions
5084    Schema   |     Name     | Result data type | Argument data types | Type 
5085 ------------+--------------+------------------+---------------------+------
5086  pg_catalog | dsqrt        | double precision | double precision    | func
5087  pg_catalog | numeric_sqrt | numeric          | numeric             | func
5088  pg_catalog | sqrt         | double precision | double precision    | func
5089  pg_catalog | sqrt         | numeric          | numeric             | func
5090 (4 rows)
5092 \df *sqrt num*
5093                              List of functions
5094    Schema   |     Name     | Result data type | Argument data types | Type 
5095 ------------+--------------+------------------+---------------------+------
5096  pg_catalog | numeric_sqrt | numeric          | numeric             | func
5097  pg_catalog | sqrt         | numeric          | numeric             | func
5098 (2 rows)
5100 \df int*pl
5101                             List of functions
5102    Schema   |    Name     | Result data type | Argument data types | Type 
5103 ------------+-------------+------------------+---------------------+------
5104  pg_catalog | int24pl     | integer          | smallint, integer   | func
5105  pg_catalog | int28pl     | bigint           | smallint, bigint    | func
5106  pg_catalog | int2pl      | smallint         | smallint, smallint  | func
5107  pg_catalog | int42pl     | integer          | integer, smallint   | func
5108  pg_catalog | int48pl     | bigint           | integer, bigint     | func
5109  pg_catalog | int4pl      | integer          | integer, integer    | func
5110  pg_catalog | int82pl     | bigint           | bigint, smallint    | func
5111  pg_catalog | int84pl     | bigint           | bigint, integer     | func
5112  pg_catalog | int8pl      | bigint           | bigint, bigint      | func
5113  pg_catalog | interval_pl | interval         | interval, interval  | func
5114 (10 rows)
5116 \df int*pl int4
5117                           List of functions
5118    Schema   |  Name   | Result data type | Argument data types | Type 
5119 ------------+---------+------------------+---------------------+------
5120  pg_catalog | int42pl | integer          | integer, smallint   | func
5121  pg_catalog | int48pl | bigint           | integer, bigint     | func
5122  pg_catalog | int4pl  | integer          | integer, integer    | func
5123 (3 rows)
5125 \df int*pl * pg_catalog.int8
5126                           List of functions
5127    Schema   |  Name   | Result data type | Argument data types | Type 
5128 ------------+---------+------------------+---------------------+------
5129  pg_catalog | int28pl | bigint           | smallint, bigint    | func
5130  pg_catalog | int48pl | bigint           | integer, bigint     | func
5131  pg_catalog | int8pl  | bigint           | bigint, bigint      | func
5132 (3 rows)
5134 \df acl* aclitem[]
5135                                                                     List of functions
5136    Schema   |    Name     | Result data type |                                        Argument data types                                         | Type 
5137 ------------+-------------+------------------+----------------------------------------------------------------------------------------------------+------
5138  pg_catalog | aclcontains | boolean          | aclitem[], aclitem                                                                                 | func
5139  pg_catalog | aclexplode  | SETOF record     | acl aclitem[], OUT grantor oid, OUT grantee oid, OUT privilege_type text, OUT is_grantable boolean | func
5140  pg_catalog | aclinsert   | aclitem[]        | aclitem[], aclitem                                                                                 | func
5141  pg_catalog | aclremove   | aclitem[]        | aclitem[], aclitem                                                                                 | func
5142 (4 rows)
5144 \df has_database_privilege oid text
5145                                   List of functions
5146    Schema   |          Name          | Result data type | Argument data types | Type 
5147 ------------+------------------------+------------------+---------------------+------
5148  pg_catalog | has_database_privilege | boolean          | oid, text           | func
5149  pg_catalog | has_database_privilege | boolean          | oid, text, text     | func
5150 (2 rows)
5152 \df has_database_privilege oid text -
5153                                   List of functions
5154    Schema   |          Name          | Result data type | Argument data types | Type 
5155 ------------+------------------------+------------------+---------------------+------
5156  pg_catalog | has_database_privilege | boolean          | oid, text           | func
5157 (1 row)
5159 \dfa bit* small*
5160                           List of functions
5161    Schema   |  Name   | Result data type | Argument data types | Type 
5162 ------------+---------+------------------+---------------------+------
5163  pg_catalog | bit_and | smallint         | smallint            | agg
5164  pg_catalog | bit_or  | smallint         | smallint            | agg
5165  pg_catalog | bit_xor | smallint         | smallint            | agg
5166 (3 rows)
5168 \do - pg_catalog.int4
5169                                List of operators
5170    Schema   | Name | Left arg type | Right arg type | Result type | Description 
5171 ------------+------+---------------+----------------+-------------+-------------
5172  pg_catalog | -    |               | integer        | integer     | negate
5173 (1 row)
5175 \do && anyarray *
5176                                List of operators
5177    Schema   | Name | Left arg type | Right arg type | Result type | Description 
5178 ------------+------+---------------+----------------+-------------+-------------
5179  pg_catalog | &&   | anyarray      | anyarray       | boolean     | overlaps
5180 (1 row)