Revert "Don't truncate database and user names in startup packets."
[pgsql.git] / src / test / regress / expected / psql.out
blob36dc31c16c4c077440d70187832ff74f8d9f28b3
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 -- \parse (extended query protocol)
102 \parse
103 \parse: missing required argument
104 SELECT 1 \parse ''
105 SELECT 2 \parse stmt1
106 SELECT $1 \parse stmt2
107 SELECT $1, $2 \parse stmt3
108 -- \bind_named (extended query protocol)
109 \bind_named
110 \bind_named: missing required argument
111 \bind_named '' \g
112  ?column? 
113 ----------
114         1
115 (1 row)
117 \bind_named stmt1 \g
118  ?column? 
119 ----------
120         2
121 (1 row)
123 \bind_named stmt2 'foo' \g
124  ?column? 
125 ----------
126  foo
127 (1 row)
129 \bind_named stmt3 'foo' 'bar' \g
130  ?column? | ?column? 
131 ----------+----------
132  foo      | bar
133 (1 row)
135 -- Repeated calls.  The second call generates an error, cleaning up the
136 -- statement name set by the first call.
137 \bind_named stmt4
138 \bind_named
139 \bind_named: missing required argument
141 ERROR:  there is no parameter $1
142 LINE 1: SELECT $1, $2 
143                ^
144 -- Last \bind_named wins
145 \bind_named stmt2 'foo' \bind_named stmt3 'foo2' 'bar2' \g
146  ?column? | ?column? 
147 ----------+----------
148  foo2     | bar2
149 (1 row)
151 -- Multiple \g calls mean multiple executions
152 \bind_named stmt2 'foo3' \g \bind_named stmt3 'foo4' 'bar4' \g
153  ?column? 
154 ----------
155  foo3
156 (1 row)
158  ?column? | ?column? 
159 ----------+----------
160  foo4     | bar4
161 (1 row)
163 -- \close (extended query protocol)
164 \close
165 \close: missing required argument
166 \close ''
167 \close stmt2
168 \close stmt2
169 SELECT name, statement FROM pg_prepared_statements ORDER BY name;
170  name  |   statement    
171 -------+----------------
172  stmt1 | SELECT 2 
173  stmt3 | SELECT $1, $2 
174 (2 rows)
176 -- \bind (extended query protocol)
177 SELECT 1 \bind \g
178  ?column? 
179 ----------
180         1
181 (1 row)
183 SELECT $1 \bind 'foo' \g
184  ?column? 
185 ----------
186  foo
187 (1 row)
189 SELECT $1, $2 \bind 'foo' 'bar' \g
190  ?column? | ?column? 
191 ----------+----------
192  foo      | bar
193 (1 row)
195 -- last \bind wins
196 select $1::int as col \bind 'foo' \bind 2 \g
197  col 
198 -----
199    2
200 (1 row)
202 -- Multiple \g calls mean multiple executions
203 select $1::int as col \bind 1 \g \bind 2 \g
204  col 
205 -----
206    1
207 (1 row)
209  col 
210 -----
211    2
212 (1 row)
214 -- errors
215 -- parse error
216 SELECT foo \bind \g
217 ERROR:  column "foo" does not exist
218 LINE 1: SELECT foo 
219                ^
220 -- tcop error
221 SELECT 1 \; SELECT 2 \bind \g
222 ERROR:  cannot insert multiple commands into a prepared statement
223 -- bind error
224 SELECT $1, $2 \bind 'foo' \g
225 ERROR:  bind message supplies 1 parameters, but prepared statement "" requires 2
226 -- bind_named error
227 \bind_named stmt2 'baz' \g
228 ERROR:  prepared statement "stmt2" does not exist
229 \bind_named stmt3 'baz' \g
230 ERROR:  bind message supplies 1 parameters, but prepared statement "stmt3" requires 2
231 -- \gset
232 select 10 as test01, 20 as test02, 'Hello' as test03 \gset pref01_
233 \echo :pref01_test01 :pref01_test02 :pref01_test03
234 10 20 Hello
235 -- should fail: bad variable name
236 select 10 as "bad name"
237 \gset
238 invalid variable name: "bad name"
239 select 97 as "EOF", 'ok' as _foo \gset IGNORE
240 attempt to \gset into specially treated variable "IGNOREEOF" ignored
241 \echo :IGNORE_foo :IGNOREEOF
242 ok 0
243 -- multiple backslash commands in one line
244 select 1 as x, 2 as y \gset pref01_ \\ \echo :pref01_x
246 select 3 as x, 4 as y \gset pref01_ \echo :pref01_x \echo :pref01_y
249 select 5 as x, 6 as y \gset pref01_ \\ \g \echo :pref01_x :pref01_y
250  x | y 
251 ---+---
252  5 | 6
253 (1 row)
255 5 6
256 select 7 as x, 8 as y \g \gset pref01_ \echo :pref01_x :pref01_y
257  x | y 
258 ---+---
259  7 | 8
260 (1 row)
262 7 8
263 -- NULL should unset the variable
264 \set var2 xyz
265 select 1 as var1, NULL as var2, 3 as var3 \gset
266 \echo :var1 :var2 :var3
267 1 :var2 3
268 -- \gset requires just one tuple
269 select 10 as test01, 20 as test02 from generate_series(1,3) \gset
270 more than one row returned for \gset
271 select 10 as test01, 20 as test02 from generate_series(1,0) \gset
272 no rows returned for \gset
273 -- \gset returns no tuples
274 select a from generate_series(1, 10) as a where a = 11 \gset
275 no rows returned for \gset
276 \echo :ROW_COUNT
278 -- \gset should work in FETCH_COUNT mode too
279 \set FETCH_COUNT 1
280 select 1 as x, 2 as y \gset pref01_ \\ \echo :pref01_x
282 select 3 as x, 4 as y \gset pref01_ \echo :pref01_x \echo :pref01_y
285 select 10 as test01, 20 as test02 from generate_series(1,3) \gset
286 more than one row returned for \gset
287 select 10 as test01, 20 as test02 from generate_series(1,0) \gset
288 no rows returned for \gset
289 \unset FETCH_COUNT
290 -- \gdesc
291 SELECT
292     NULL AS zero,
293     1 AS one,
294     2.0 AS two,
295     'three' AS three,
296     $1 AS four,
297     sin($2) as five,
298     'foo'::varchar(4) as six,
299     CURRENT_DATE AS now
300 \gdesc
301  Column |         Type         
302 --------+----------------------
303  zero   | text
304  one    | integer
305  two    | numeric
306  three  | text
307  four   | text
308  five   | double precision
309  six    | character varying(4)
310  now    | date
311 (8 rows)
313 -- should work with tuple-returning utilities, such as EXECUTE
314 PREPARE test AS SELECT 1 AS first, 2 AS second;
315 EXECUTE test \gdesc
316  Column |  Type   
317 --------+---------
318  first  | integer
319  second | integer
320 (2 rows)
322 EXPLAIN EXECUTE test \gdesc
323    Column   | Type 
324 ------------+------
325  QUERY PLAN | text
326 (1 row)
328 -- should fail cleanly - syntax error
329 SELECT 1 + \gdesc
330 ERROR:  syntax error at end of input
331 LINE 1: SELECT 1 + 
332                    ^
333 -- check behavior with empty results
334 SELECT \gdesc
335 The command has no result, or the result has no columns.
336 CREATE TABLE bububu(a int) \gdesc
337 The command has no result, or the result has no columns.
338 -- subject command should not have executed
339 TABLE bububu;  -- fail
340 ERROR:  relation "bububu" does not exist
341 LINE 1: TABLE bububu;
342               ^
343 -- query buffer should remain unchanged
344 SELECT 1 AS x, 'Hello', 2 AS y, true AS "dirty\name"
345 \gdesc
346    Column   |  Type   
347 ------------+---------
348  x          | integer
349  ?column?   | text
350  y          | integer
351  dirty\name | boolean
352 (4 rows)
355  x | ?column? | y | dirty\name 
356 ---+----------+---+------------
357  1 | Hello    | 2 | t
358 (1 row)
360 -- all on one line
361 SELECT 3 AS x, 'Hello', 4 AS y, true AS "dirty\name" \gdesc \g
362    Column   |  Type   
363 ------------+---------
364  x          | integer
365  ?column?   | text
366  y          | integer
367  dirty\name | boolean
368 (4 rows)
370  x | ?column? | y | dirty\name 
371 ---+----------+---+------------
372  3 | Hello    | 4 | t
373 (1 row)
375 -- test for server bug #17983 with empty statement in aborted transaction
376 set search_path = default;
377 begin;
378 bogus;
379 ERROR:  syntax error at or near "bogus"
380 LINE 1: bogus;
381         ^
383 \gdesc
384 The command has no result, or the result has no columns.
385 rollback;
386 -- \gexec
387 create temporary table gexec_test(a int, b text, c date, d float);
388 select format('create index on gexec_test(%I)', attname)
389 from pg_attribute
390 where attrelid = 'gexec_test'::regclass and attnum > 0
391 order by attnum
392 \gexec
393 create index on gexec_test(a)
394 create index on gexec_test(b)
395 create index on gexec_test(c)
396 create index on gexec_test(d)
397 -- \gexec should work in FETCH_COUNT mode too
398 -- (though the fetch limit applies to the executed queries not the meta query)
399 \set FETCH_COUNT 1
400 select 'select 1 as ones', 'select x.y, x.y*2 as double from generate_series(1,4) as x(y)'
401 union all
402 select 'drop table gexec_test', NULL
403 union all
404 select 'drop table gexec_test', 'select ''2000-01-01''::date as party_over'
405 \gexec
406 select 1 as ones
407  ones 
408 ------
409     1
410 (1 row)
412 select x.y, x.y*2 as double from generate_series(1,4) as x(y)
413  y | double 
414 ---+--------
415  1 |      2
416  2 |      4
417  3 |      6
418  4 |      8
419 (4 rows)
421 drop table gexec_test
422 drop table gexec_test
423 ERROR:  table "gexec_test" does not exist
424 select '2000-01-01'::date as party_over
425  party_over 
426 ------------
427  01-01-2000
428 (1 row)
430 \unset FETCH_COUNT
431 -- \setenv, \getenv
432 -- ensure MYVAR isn't set
433 \setenv MYVAR
434 -- in which case, reading it doesn't change the target
435 \getenv res MYVAR
436 \echo :res
437 :res
438 -- now set it
439 \setenv MYVAR 'environment value'
440 \getenv res MYVAR
441 \echo :res
442 environment value
443 -- show all pset options
444 \pset
445 border                   1
446 columns                  0
447 csv_fieldsep             ','
448 expanded                 off
449 fieldsep                 '|'
450 fieldsep_zero            off
451 footer                   on
452 format                   aligned
453 linestyle                ascii
454 null                     ''
455 numericlocale            off
456 pager                    1
457 pager_min_lines          0
458 recordsep                '\n'
459 recordsep_zero           off
460 tableattr                
461 title                    
462 tuples_only              off
463 unicode_border_linestyle single
464 unicode_column_linestyle single
465 unicode_header_linestyle single
466 xheader_width            full
467 -- test multi-line headers, wrapping, and newline indicators
468 -- in aligned, unaligned, and wrapped formats
469 prepare q as select array_to_string(array_agg(repeat('x',2*n)),E'\n') as "ab
471 c", array_to_string(array_agg(repeat('y',20-2*n)),E'\n') as "a
472 bc" from generate_series(1,10) as n(n) group by n>1 order by n>1;
473 \pset linestyle ascii
474 \pset expanded off
475 \pset columns 40
476 \pset border 0
477 \pset format unaligned
478 execute q;
483 xx|yyyyyyyyyyyyyyyyyy
484 xxxx
485 xxxxxx
486 xxxxxxxx
487 xxxxxxxxxx
488 xxxxxxxxxxxx
489 xxxxxxxxxxxxxx
490 xxxxxxxxxxxxxxxx
491 xxxxxxxxxxxxxxxxxx
492 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
493 yyyyyyyyyyyyyy
494 yyyyyyyyyyyy
495 yyyyyyyyyy
496 yyyyyyyy
497 yyyyyy
498 yyyy
501 (2 rows)
502 \pset format aligned
503 execute q;
504          ab         +        a         +
505                     +        bc         
506          c                              
507 -------------------- ------------------
508 xx                   yyyyyyyyyyyyyyyyyy
509 xxxx                +yyyyyyyyyyyyyyyy  +
510 xxxxxx              +yyyyyyyyyyyyyy    +
511 xxxxxxxx            +yyyyyyyyyyyy      +
512 xxxxxxxxxx          +yyyyyyyyyy        +
513 xxxxxxxxxxxx        +yyyyyyyy          +
514 xxxxxxxxxxxxxx      +yyyyyy            +
515 xxxxxxxxxxxxxxxx    +yyyy              +
516 xxxxxxxxxxxxxxxxxx  +yy                +
517 xxxxxxxxxxxxxxxxxxxx 
518 (2 rows)
520 \pset format wrapped
521 execute q;
522          ab         +        a         +
523                     +        bc         
524          c                              
525 -------------------- ------------------
526 xx                   yyyyyyyyyyyyyyyyyy
527 xxxx                +yyyyyyyyyyyyyyyy  +
528 xxxxxx              +yyyyyyyyyyyyyy    +
529 xxxxxxxx            +yyyyyyyyyyyy      +
530 xxxxxxxxxx          +yyyyyyyyyy        +
531 xxxxxxxxxxxx        +yyyyyyyy          +
532 xxxxxxxxxxxxxx      +yyyyyy            +
533 xxxxxxxxxxxxxxxx    +yyyy              +
534 xxxxxxxxxxxxxxxxxx  +yy                +
535 xxxxxxxxxxxxxxxxxxxx 
536 (2 rows)
538 \pset border 1
539 \pset format unaligned
540 execute q;
545 xx|yyyyyyyyyyyyyyyyyy
546 xxxx
547 xxxxxx
548 xxxxxxxx
549 xxxxxxxxxx
550 xxxxxxxxxxxx
551 xxxxxxxxxxxxxx
552 xxxxxxxxxxxxxxxx
553 xxxxxxxxxxxxxxxxxx
554 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
555 yyyyyyyyyyyyyy
556 yyyyyyyyyyyy
557 yyyyyyyyyy
558 yyyyyyyy
559 yyyyyy
560 yyyy
563 (2 rows)
564 \pset format aligned
565 execute q;
566           ab         +|         a         +
567                      +|         bc         
568           c           |                    
569 ----------------------+--------------------
570  xx                   | yyyyyyyyyyyyyyyyyy
571  xxxx                +| yyyyyyyyyyyyyyyy  +
572  xxxxxx              +| yyyyyyyyyyyyyy    +
573  xxxxxxxx            +| yyyyyyyyyyyy      +
574  xxxxxxxxxx          +| yyyyyyyyyy        +
575  xxxxxxxxxxxx        +| yyyyyyyy          +
576  xxxxxxxxxxxxxx      +| yyyyyy            +
577  xxxxxxxxxxxxxxxx    +| yyyy              +
578  xxxxxxxxxxxxxxxxxx  +| yy                +
579  xxxxxxxxxxxxxxxxxxxx | 
580 (2 rows)
582 \pset format wrapped
583 execute q;
584         ab        +|         a         +
585                   +|         bc         
586          c         |                    
587 -------------------+--------------------
588  xx                | yyyyyyyyyyyyyyyyyy
589  xxxx             +| yyyyyyyyyyyyyyyy  +
590  xxxxxx           +| yyyyyyyyyyyyyy    +
591  xxxxxxxx         +| yyyyyyyyyyyy      +
592  xxxxxxxxxx       +| yyyyyyyyyy        +
593  xxxxxxxxxxxx     +| yyyyyyyy          +
594  xxxxxxxxxxxxxx   +| yyyyyy            +
595  xxxxxxxxxxxxxxxx +| yyyy              +
596  xxxxxxxxxxxxxxxxx.| yy                +
597 .x                +| 
598  xxxxxxxxxxxxxxxxx.| 
599 .xxx               | 
600 (2 rows)
602 \pset border 2
603 \pset format unaligned
604 execute q;
609 xx|yyyyyyyyyyyyyyyyyy
610 xxxx
611 xxxxxx
612 xxxxxxxx
613 xxxxxxxxxx
614 xxxxxxxxxxxx
615 xxxxxxxxxxxxxx
616 xxxxxxxxxxxxxxxx
617 xxxxxxxxxxxxxxxxxx
618 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
619 yyyyyyyyyyyyyy
620 yyyyyyyyyyyy
621 yyyyyyyyyy
622 yyyyyyyy
623 yyyyyy
624 yyyy
627 (2 rows)
628 \pset format aligned
629 execute q;
630 +----------------------+--------------------+
631 |          ab         +|         a         +|
632 |                     +|         bc         |
633 |          c           |                    |
634 +----------------------+--------------------+
635 | xx                   | yyyyyyyyyyyyyyyyyy |
636 | xxxx                +| yyyyyyyyyyyyyyyy  +|
637 | xxxxxx              +| yyyyyyyyyyyyyy    +|
638 | xxxxxxxx            +| yyyyyyyyyyyy      +|
639 | xxxxxxxxxx          +| yyyyyyyyyy        +|
640 | xxxxxxxxxxxx        +| yyyyyyyy          +|
641 | xxxxxxxxxxxxxx      +| yyyyyy            +|
642 | xxxxxxxxxxxxxxxx    +| yyyy              +|
643 | xxxxxxxxxxxxxxxxxx  +| yy                +|
644 | xxxxxxxxxxxxxxxxxxxx |                    |
645 +----------------------+--------------------+
646 (2 rows)
648 \pset format wrapped
649 execute q;
650 +-----------------+--------------------+
651 |       ab       +|         a         +|
652 |                +|         bc         |
653 |        c        |                    |
654 +-----------------+--------------------+
655 | xx              | yyyyyyyyyyyyyyyyyy |
656 | xxxx           +| yyyyyyyyyyyyyyyy  +|
657 | xxxxxx         +| yyyyyyyyyyyyyy    +|
658 | xxxxxxxx       +| yyyyyyyyyyyy      +|
659 | xxxxxxxxxx     +| yyyyyyyyyy        +|
660 | xxxxxxxxxxxx   +| yyyyyyyy          +|
661 | xxxxxxxxxxxxxx +| yyyyyy            +|
662 | xxxxxxxxxxxxxxx.| yyyy              +|
663 |.x              +| yy                +|
664 | xxxxxxxxxxxxxxx.|                    |
665 |.xxx            +|                    |
666 | xxxxxxxxxxxxxxx.|                    |
667 |.xxxxx           |                    |
668 +-----------------+--------------------+
669 (2 rows)
671 \pset expanded on
672 \pset columns 20
673 \pset border 0
674 \pset format unaligned
675 execute q;
678 c|xx
680 bc|yyyyyyyyyyyyyyyyyy
684 c|xxxx
685 xxxxxx
686 xxxxxxxx
687 xxxxxxxxxx
688 xxxxxxxxxxxx
689 xxxxxxxxxxxxxx
690 xxxxxxxxxxxxxxxx
691 xxxxxxxxxxxxxxxxxx
692 xxxxxxxxxxxxxxxxxxxx
694 bc|yyyyyyyyyyyyyyyy
695 yyyyyyyyyyyyyy
696 yyyyyyyyyyyy
697 yyyyyyyyyy
698 yyyyyyyy
699 yyyyyy
700 yyyy
703 \pset format aligned
704 execute q;
705 * Record 1            
706 ab+ xx
707   +
708 c  
709 a + yyyyyyyyyyyyyyyyyy
710 bc 
711 * Record 2            
712 ab+ xxxx                +
713   + xxxxxx              +
714 c   xxxxxxxx            +
715     xxxxxxxxxx          +
716     xxxxxxxxxxxx        +
717     xxxxxxxxxxxxxx      +
718     xxxxxxxxxxxxxxxx    +
719     xxxxxxxxxxxxxxxxxx  +
720     xxxxxxxxxxxxxxxxxxxx
721 a + yyyyyyyyyyyyyyyy    +
722 bc  yyyyyyyyyyyyyy      +
723     yyyyyyyyyyyy        +
724     yyyyyyyyyy          +
725     yyyyyyyy            +
726     yyyyyy              +
727     yyyy                +
728     yy                  +
729     
731 \pset format wrapped
732 execute q;
733 * Record 1       
734 ab+ xx
735   +
736 c  
737 a + yyyyyyyyyyyyyyy.
738 bc .yyy
739 * Record 2       
740 ab+ xxxx           +
741   + xxxxxx         +
742 c   xxxxxxxx       +
743     xxxxxxxxxx     +
744     xxxxxxxxxxxx   +
745     xxxxxxxxxxxxxx +
746     xxxxxxxxxxxxxxx.
747    .x              +
748     xxxxxxxxxxxxxxx.
749    .xxx            +
750     xxxxxxxxxxxxxxx.
751    .xxxxx
752 a + yyyyyyyyyyyyyyy.
753 bc .y              +
754     yyyyyyyyyyyyyy +
755     yyyyyyyyyyyy   +
756     yyyyyyyyyy     +
757     yyyyyyyy       +
758     yyyyyy         +
759     yyyy           +
760     yy             +
761     
763 \pset border 1
764 \pset format unaligned
765 execute q;
768 c|xx
770 bc|yyyyyyyyyyyyyyyyyy
774 c|xxxx
775 xxxxxx
776 xxxxxxxx
777 xxxxxxxxxx
778 xxxxxxxxxxxx
779 xxxxxxxxxxxxxx
780 xxxxxxxxxxxxxxxx
781 xxxxxxxxxxxxxxxxxx
782 xxxxxxxxxxxxxxxxxxxx
784 bc|yyyyyyyyyyyyyyyy
785 yyyyyyyyyyyyyy
786 yyyyyyyyyyyy
787 yyyyyyyyyy
788 yyyyyyyy
789 yyyyyy
790 yyyy
793 \pset format aligned
794 execute q;
795 -[ RECORD 1 ]------------
796 ab+| xx
797   +|
798 c  |
799 a +| yyyyyyyyyyyyyyyyyy
800 bc |
801 -[ RECORD 2 ]------------
802 ab+| xxxx                +
803   +| xxxxxx              +
804 c  | xxxxxxxx            +
805    | xxxxxxxxxx          +
806    | xxxxxxxxxxxx        +
807    | xxxxxxxxxxxxxx      +
808    | xxxxxxxxxxxxxxxx    +
809    | xxxxxxxxxxxxxxxxxx  +
810    | xxxxxxxxxxxxxxxxxxxx
811 a +| yyyyyyyyyyyyyyyy    +
812 bc | yyyyyyyyyyyyyy      +
813    | yyyyyyyyyyyy        +
814    | yyyyyyyyyy          +
815    | yyyyyyyy            +
816    | yyyyyy              +
817    | yyyy                +
818    | yy                  +
819    | 
821 \pset format wrapped
822 execute q;
823 -[ RECORD 1 ]------
824 ab+| xx
825   +|
826 c  |
827 a +| yyyyyyyyyyyyyy.
828 bc |.yyyy
829 -[ RECORD 2 ]------
830 ab+| xxxx          +
831   +| xxxxxx        +
832 c  | xxxxxxxx      +
833    | xxxxxxxxxx    +
834    | xxxxxxxxxxxx  +
835    | xxxxxxxxxxxxxx+
836    | xxxxxxxxxxxxxx.
837    |.xx            +
838    | xxxxxxxxxxxxxx.
839    |.xxxx          +
840    | xxxxxxxxxxxxxx.
841    |.xxxxxx
842 a +| yyyyyyyyyyyyyy.
843 bc |.yy            +
844    | yyyyyyyyyyyyyy+
845    | yyyyyyyyyyyy  +
846    | yyyyyyyyyy    +
847    | yyyyyyyy      +
848    | yyyyyy        +
849    | yyyy          +
850    | yy            +
851    | 
853 \pset border 2
854 \pset format unaligned
855 execute q;
858 c|xx
860 bc|yyyyyyyyyyyyyyyyyy
864 c|xxxx
865 xxxxxx
866 xxxxxxxx
867 xxxxxxxxxx
868 xxxxxxxxxxxx
869 xxxxxxxxxxxxxx
870 xxxxxxxxxxxxxxxx
871 xxxxxxxxxxxxxxxxxx
872 xxxxxxxxxxxxxxxxxxxx
874 bc|yyyyyyyyyyyyyyyy
875 yyyyyyyyyyyyyy
876 yyyyyyyyyyyy
877 yyyyyyyyyy
878 yyyyyyyy
879 yyyyyy
880 yyyy
883 \pset format aligned
884 execute q;
885 +-[ RECORD 1 ]--------------+
886 | ab+| xx                   |
887 |   +|                      |
888 | c  |                      |
889 | a +| yyyyyyyyyyyyyyyyyy   |
890 | bc |                      |
891 +-[ RECORD 2 ]--------------+
892 | ab+| xxxx                +|
893 |   +| xxxxxx              +|
894 | c  | xxxxxxxx            +|
895 |    | xxxxxxxxxx          +|
896 |    | xxxxxxxxxxxx        +|
897 |    | xxxxxxxxxxxxxx      +|
898 |    | xxxxxxxxxxxxxxxx    +|
899 |    | xxxxxxxxxxxxxxxxxx  +|
900 |    | xxxxxxxxxxxxxxxxxxxx |
901 | a +| yyyyyyyyyyyyyyyy    +|
902 | bc | yyyyyyyyyyyyyy      +|
903 |    | yyyyyyyyyyyy        +|
904 |    | yyyyyyyyyy          +|
905 |    | yyyyyyyy            +|
906 |    | yyyyyy              +|
907 |    | yyyy                +|
908 |    | yy                  +|
909 |    |                      |
910 +----+----------------------+
912 \pset format wrapped
913 execute q;
914 +-[ RECORD 1 ]-----+
915 | ab+| xx          |
916 |   +|             |
917 | c  |             |
918 | a +| yyyyyyyyyyy.|
919 | bc |.yyyyyyy     |
920 +-[ RECORD 2 ]-----+
921 | ab+| xxxx       +|
922 |   +| xxxxxx     +|
923 | c  | xxxxxxxx   +|
924 |    | xxxxxxxxxx +|
925 |    | xxxxxxxxxxx.|
926 |    |.x          +|
927 |    | xxxxxxxxxxx.|
928 |    |.xxx        +|
929 |    | xxxxxxxxxxx.|
930 |    |.xxxxx      +|
931 |    | xxxxxxxxxxx.|
932 |    |.xxxxxxx    +|
933 |    | xxxxxxxxxxx.|
934 |    |.xxxxxxxxx   |
935 | a +| yyyyyyyyyyy.|
936 | bc |.yyyyy      +|
937 |    | yyyyyyyyyyy.|
938 |    |.yyy        +|
939 |    | yyyyyyyyyyy.|
940 |    |.y          +|
941 |    | yyyyyyyyyy +|
942 |    | yyyyyyyy   +|
943 |    | yyyyyy     +|
944 |    | yyyy       +|
945 |    | yy         +|
946 |    |             |
947 +----+-------------+
949 \pset linestyle old-ascii
950 \pset expanded off
951 \pset columns 40
952 \pset border 0
953 \pset format unaligned
954 execute q;
959 xx|yyyyyyyyyyyyyyyyyy
960 xxxx
961 xxxxxx
962 xxxxxxxx
963 xxxxxxxxxx
964 xxxxxxxxxxxx
965 xxxxxxxxxxxxxx
966 xxxxxxxxxxxxxxxx
967 xxxxxxxxxxxxxxxxxx
968 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
969 yyyyyyyyyyyyyy
970 yyyyyyyyyyyy
971 yyyyyyyyyy
972 yyyyyyyy
973 yyyyyy
974 yyyy
977 (2 rows)
978 \pset format aligned
979 execute q;
980          ab                  a         
981                     +        bc        
982          c          +                  
983 -------------------- ------------------
984 xx                   yyyyyyyyyyyyyyyyyy
985 xxxx                 yyyyyyyyyyyyyyyy   
986 xxxxxx               yyyyyyyyyyyyyy     
987 xxxxxxxx             yyyyyyyyyyyy       
988 xxxxxxxxxx           yyyyyyyyyy         
989 xxxxxxxxxxxx         yyyyyyyy           
990 xxxxxxxxxxxxxx       yyyyyy             
991 xxxxxxxxxxxxxxxx     yyyy               
992 xxxxxxxxxxxxxxxxxx   yy                 
993 xxxxxxxxxxxxxxxxxxxx 
994 (2 rows)
996 \pset format wrapped
997 execute q;
998          ab                  a         
999                     +        bc        
1000          c          +                  
1001 -------------------- ------------------
1002 xx                   yyyyyyyyyyyyyyyyyy
1003 xxxx                 yyyyyyyyyyyyyyyy   
1004 xxxxxx               yyyyyyyyyyyyyy     
1005 xxxxxxxx             yyyyyyyyyyyy       
1006 xxxxxxxxxx           yyyyyyyyyy         
1007 xxxxxxxxxxxx         yyyyyyyy           
1008 xxxxxxxxxxxxxx       yyyyyy             
1009 xxxxxxxxxxxxxxxx     yyyy               
1010 xxxxxxxxxxxxxxxxxx   yy                 
1011 xxxxxxxxxxxxxxxxxxxx 
1012 (2 rows)
1014 \pset border 1
1015 \pset format unaligned
1016 execute q;
1021 xx|yyyyyyyyyyyyyyyyyy
1022 xxxx
1023 xxxxxx
1024 xxxxxxxx
1025 xxxxxxxxxx
1026 xxxxxxxxxxxx
1027 xxxxxxxxxxxxxx
1028 xxxxxxxxxxxxxxxx
1029 xxxxxxxxxxxxxxxxxx
1030 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
1031 yyyyyyyyyyyyyy
1032 yyyyyyyyyyyy
1033 yyyyyyyyyy
1034 yyyyyyyy
1035 yyyyyy
1036 yyyy
1039 (2 rows)
1040 \pset format aligned
1041 execute q;
1042           ab          |         a          
1043 +                     |+        bc         
1044 +         c           |+                   
1045 ----------------------+--------------------
1046  xx                   | yyyyyyyyyyyyyyyyyy
1047  xxxx                 | yyyyyyyyyyyyyyyy   
1048  xxxxxx               : yyyyyyyyyyyyyy     
1049  xxxxxxxx             : yyyyyyyyyyyy       
1050  xxxxxxxxxx           : yyyyyyyyyy         
1051  xxxxxxxxxxxx         : yyyyyyyy           
1052  xxxxxxxxxxxxxx       : yyyyyy             
1053  xxxxxxxxxxxxxxxx     : yyyy               
1054  xxxxxxxxxxxxxxxxxx   : yy                 
1055  xxxxxxxxxxxxxxxxxxxx : 
1056 (2 rows)
1058 \pset format wrapped
1059 execute q;
1060         ab         |         a          
1061 +                  |+        bc         
1062 +        c         |+                   
1063 -------------------+--------------------
1064  xx                | yyyyyyyyyyyyyyyyyy
1065  xxxx              | yyyyyyyyyyyyyyyy   
1066  xxxxxx            : yyyyyyyyyyyyyy     
1067  xxxxxxxx          : yyyyyyyyyyyy       
1068  xxxxxxxxxx        : yyyyyyyyyy         
1069  xxxxxxxxxxxx      : yyyyyyyy           
1070  xxxxxxxxxxxxxx    : yyyyyy             
1071  xxxxxxxxxxxxxxxx  : yyyy               
1072  xxxxxxxxxxxxxxxxx : yy                 
1073  x                 : 
1074  xxxxxxxxxxxxxxxxx   
1075  xxx                 
1076 (2 rows)
1078 \pset border 2
1079 \pset format unaligned
1080 execute q;
1085 xx|yyyyyyyyyyyyyyyyyy
1086 xxxx
1087 xxxxxx
1088 xxxxxxxx
1089 xxxxxxxxxx
1090 xxxxxxxxxxxx
1091 xxxxxxxxxxxxxx
1092 xxxxxxxxxxxxxxxx
1093 xxxxxxxxxxxxxxxxxx
1094 xxxxxxxxxxxxxxxxxxxx|yyyyyyyyyyyyyyyy
1095 yyyyyyyyyyyyyy
1096 yyyyyyyyyyyy
1097 yyyyyyyyyy
1098 yyyyyyyy
1099 yyyyyy
1100 yyyy
1103 (2 rows)
1104 \pset format aligned
1105 execute q;
1106 +----------------------+--------------------+
1107 |          ab          |         a          |
1108 |+                     |+        bc         |
1109 |+         c           |+                   |
1110 +----------------------+--------------------+
1111 | xx                   | yyyyyyyyyyyyyyyyyy |
1112 | xxxx                 | yyyyyyyyyyyyyyyy   |
1113 | xxxxxx               : yyyyyyyyyyyyyy     |
1114 | xxxxxxxx             : yyyyyyyyyyyy       |
1115 | xxxxxxxxxx           : yyyyyyyyyy         |
1116 | xxxxxxxxxxxx         : yyyyyyyy           |
1117 | xxxxxxxxxxxxxx       : yyyyyy             |
1118 | xxxxxxxxxxxxxxxx     : yyyy               |
1119 | xxxxxxxxxxxxxxxxxx   : yy                 |
1120 | xxxxxxxxxxxxxxxxxxxx :                    |
1121 +----------------------+--------------------+
1122 (2 rows)
1124 \pset format wrapped
1125 execute q;
1126 +-----------------+--------------------+
1127 |       ab        |         a          |
1128 |+                |+        bc         |
1129 |+       c        |+                   |
1130 +-----------------+--------------------+
1131 | xx              | yyyyyyyyyyyyyyyyyy |
1132 | xxxx            | yyyyyyyyyyyyyyyy   |
1133 | xxxxxx          : yyyyyyyyyyyyyy     |
1134 | xxxxxxxx        : yyyyyyyyyyyy       |
1135 | xxxxxxxxxx      : yyyyyyyyyy         |
1136 | xxxxxxxxxxxx    : yyyyyyyy           |
1137 | xxxxxxxxxxxxxx  : yyyyyy             |
1138 | xxxxxxxxxxxxxxx : yyyy               |
1139 | x               : yy                 |
1140 | xxxxxxxxxxxxxxx :                    |
1141 | xxx                                  |
1142 | xxxxxxxxxxxxxxx                      |
1143 | xxxxx                                |
1144 +-----------------+--------------------+
1145 (2 rows)
1147 \pset expanded on
1148 \pset columns 20
1149 \pset border 0
1150 \pset format unaligned
1151 execute q;
1154 c|xx
1156 bc|yyyyyyyyyyyyyyyyyy
1160 c|xxxx
1161 xxxxxx
1162 xxxxxxxx
1163 xxxxxxxxxx
1164 xxxxxxxxxxxx
1165 xxxxxxxxxxxxxx
1166 xxxxxxxxxxxxxxxx
1167 xxxxxxxxxxxxxxxxxx
1168 xxxxxxxxxxxxxxxxxxxx
1170 bc|yyyyyyyyyyyyyyyy
1171 yyyyyyyyyyyyyy
1172 yyyyyyyyyyyy
1173 yyyyyyyyyy
1174 yyyyyyyy
1175 yyyyyy
1176 yyyy
1179 \pset format aligned
1180 execute q;
1181 * Record 1             
1182  ab xx
1183 +  
1184 +c 
1185  a  yyyyyyyyyyyyyyyyyy
1187 * Record 2             
1188  ab xxxx
1189 +   xxxxxx
1190 +c  xxxxxxxx
1191     xxxxxxxxxx
1192     xxxxxxxxxxxx
1193     xxxxxxxxxxxxxx
1194     xxxxxxxxxxxxxxxx
1195     xxxxxxxxxxxxxxxxxx
1196     xxxxxxxxxxxxxxxxxxxx
1197  a  yyyyyyyyyyyyyyyy
1198 +bc yyyyyyyyyyyyyy
1199     yyyyyyyyyyyy
1200     yyyyyyyyyy
1201     yyyyyyyy
1202     yyyyyy
1203     yyyy
1204     yy
1205     
1207 \pset format wrapped
1208 execute q;
1209 * Record 1         
1210  ab xx
1211 +  
1212 +c 
1213  a  yyyyyyyyyyyyyyyy
1214 +bc yy
1215 * Record 2         
1216  ab xxxx
1217 +   xxxxxx
1218 +c  xxxxxxxx
1219     xxxxxxxxxx
1220     xxxxxxxxxxxx
1221     xxxxxxxxxxxxxx
1222     xxxxxxxxxxxxxxxx
1223     xxxxxxxxxxxxxxxx
1224     xx
1225     xxxxxxxxxxxxxxxx
1226     xxxx
1227  a  yyyyyyyyyyyyyyyy
1228 +bc yyyyyyyyyyyyyy
1229     yyyyyyyyyyyy
1230     yyyyyyyyyy
1231     yyyyyyyy
1232     yyyyyy
1233     yyyy
1234     yy
1235     
1237 \pset border 1
1238 \pset format unaligned
1239 execute q;
1242 c|xx
1244 bc|yyyyyyyyyyyyyyyyyy
1248 c|xxxx
1249 xxxxxx
1250 xxxxxxxx
1251 xxxxxxxxxx
1252 xxxxxxxxxxxx
1253 xxxxxxxxxxxxxx
1254 xxxxxxxxxxxxxxxx
1255 xxxxxxxxxxxxxxxxxx
1256 xxxxxxxxxxxxxxxxxxxx
1258 bc|yyyyyyyyyyyyyyyy
1259 yyyyyyyyyyyyyy
1260 yyyyyyyyyyyy
1261 yyyyyyyyyy
1262 yyyyyyyy
1263 yyyyyy
1264 yyyy
1267 \pset format aligned
1268 execute q;
1269 -[ RECORD 1 ]-------------
1270  ab | xx
1271 +   ;
1272 +c  ;
1273  a  | yyyyyyyyyyyyyyyyyy
1274 +bc ;
1275 -[ RECORD 2 ]-------------
1276  ab | xxxx
1277 +   : xxxxxx
1278 +c  : xxxxxxxx
1279     : xxxxxxxxxx
1280     : xxxxxxxxxxxx
1281     : xxxxxxxxxxxxxx
1282     : xxxxxxxxxxxxxxxx
1283     : xxxxxxxxxxxxxxxxxx
1284     : xxxxxxxxxxxxxxxxxxxx
1285  a  | yyyyyyyyyyyyyyyy
1286 +bc : yyyyyyyyyyyyyy
1287     : yyyyyyyyyyyy
1288     : yyyyyyyyyy
1289     : yyyyyyyy
1290     : yyyyyy
1291     : yyyy
1292     : yy
1293     : 
1295 \pset format wrapped
1296 execute q;
1297 -[ RECORD 1 ]-------
1298  ab | xx
1299 +   ;
1300 +c  ;
1301  a  | yyyyyyyyyyyyyy
1302 +bc ; yyyy
1303 -[ RECORD 2 ]-------
1304  ab | xxxx
1305 +   : xxxxxx
1306 +c  : xxxxxxxx
1307     : xxxxxxxxxx
1308     : xxxxxxxxxxxx
1309     : xxxxxxxxxxxxxx
1310     : xxxxxxxxxxxxxx
1311     ; xx
1312     : xxxxxxxxxxxxxx
1313     ; xxxx
1314     : xxxxxxxxxxxxxx
1315     ; xxxxxx
1316  a  | yyyyyyyyyyyyyy
1317 +bc ; yy
1318     : yyyyyyyyyyyyyy
1319     : yyyyyyyyyyyy
1320     : yyyyyyyyyy
1321     : yyyyyyyy
1322     : yyyyyy
1323     : yyyy
1324     : yy
1325     : 
1327 \pset border 2
1328 \pset format unaligned
1329 execute q;
1332 c|xx
1334 bc|yyyyyyyyyyyyyyyyyy
1338 c|xxxx
1339 xxxxxx
1340 xxxxxxxx
1341 xxxxxxxxxx
1342 xxxxxxxxxxxx
1343 xxxxxxxxxxxxxx
1344 xxxxxxxxxxxxxxxx
1345 xxxxxxxxxxxxxxxxxx
1346 xxxxxxxxxxxxxxxxxxxx
1348 bc|yyyyyyyyyyyyyyyy
1349 yyyyyyyyyyyyyy
1350 yyyyyyyyyyyy
1351 yyyyyyyyyy
1352 yyyyyyyy
1353 yyyyyy
1354 yyyy
1357 \pset format aligned
1358 execute q;
1359 +-[ RECORD 1 ]--------------+
1360 | ab | xx                   |
1361 |+   ;                      |
1362 |+c  ;                      |
1363 | a  | yyyyyyyyyyyyyyyyyy   |
1364 |+bc ;                      |
1365 +-[ RECORD 2 ]--------------+
1366 | ab | xxxx                 |
1367 |+   : xxxxxx               |
1368 |+c  : xxxxxxxx             |
1369 |    : xxxxxxxxxx           |
1370 |    : xxxxxxxxxxxx         |
1371 |    : xxxxxxxxxxxxxx       |
1372 |    : xxxxxxxxxxxxxxxx     |
1373 |    : xxxxxxxxxxxxxxxxxx   |
1374 |    : xxxxxxxxxxxxxxxxxxxx |
1375 | a  | yyyyyyyyyyyyyyyy     |
1376 |+bc : yyyyyyyyyyyyyy       |
1377 |    : yyyyyyyyyyyy         |
1378 |    : yyyyyyyyyy           |
1379 |    : yyyyyyyy             |
1380 |    : yyyyyy               |
1381 |    : yyyy                 |
1382 |    : yy                   |
1383 |    :                      |
1384 +----+----------------------+
1386 \pset format wrapped
1387 execute q;
1388 +-[ RECORD 1 ]-----+
1389 | ab | xx          |
1390 |+   ;             |
1391 |+c  ;             |
1392 | a  | yyyyyyyyyyy |
1393 |+bc ; yyyyyyy     |
1394 +-[ RECORD 2 ]-----+
1395 | ab | xxxx        |
1396 |+   : xxxxxx      |
1397 |+c  : xxxxxxxx    |
1398 |    : xxxxxxxxxx  |
1399 |    : xxxxxxxxxxx |
1400 |    ; x           |
1401 |    : xxxxxxxxxxx |
1402 |    ; xxx         |
1403 |    : xxxxxxxxxxx |
1404 |    ; xxxxx       |
1405 |    : xxxxxxxxxxx |
1406 |    ; xxxxxxx     |
1407 |    : xxxxxxxxxxx |
1408 |    ; xxxxxxxxx   |
1409 | a  | yyyyyyyyyyy |
1410 |+bc ; yyyyy       |
1411 |    : yyyyyyyyyyy |
1412 |    ; yyy         |
1413 |    : yyyyyyyyyyy |
1414 |    ; y           |
1415 |    : yyyyyyyyyy  |
1416 |    : yyyyyyyy    |
1417 |    : yyyyyy      |
1418 |    : yyyy        |
1419 |    : yy          |
1420 |    :             |
1421 +----+-------------+
1423 deallocate q;
1424 -- test single-line header and data
1425 prepare q as select repeat('x',2*n) as "0123456789abcdef", repeat('y',20-2*n) as "0123456789" from generate_series(1,10) as n;
1426 \pset linestyle ascii
1427 \pset expanded off
1428 \pset columns 40
1429 \pset border 0
1430 \pset format unaligned
1431 execute q;
1432 0123456789abcdef|0123456789
1433 xx|yyyyyyyyyyyyyyyyyy
1434 xxxx|yyyyyyyyyyyyyyyy
1435 xxxxxx|yyyyyyyyyyyyyy
1436 xxxxxxxx|yyyyyyyyyyyy
1437 xxxxxxxxxx|yyyyyyyyyy
1438 xxxxxxxxxxxx|yyyyyyyy
1439 xxxxxxxxxxxxxx|yyyyyy
1440 xxxxxxxxxxxxxxxx|yyyy
1441 xxxxxxxxxxxxxxxxxx|yy
1442 xxxxxxxxxxxxxxxxxxxx|
1443 (10 rows)
1444 \pset format aligned
1445 execute q;
1446   0123456789abcdef       0123456789     
1447 -------------------- ------------------
1448 xx                   yyyyyyyyyyyyyyyyyy
1449 xxxx                 yyyyyyyyyyyyyyyy
1450 xxxxxx               yyyyyyyyyyyyyy
1451 xxxxxxxx             yyyyyyyyyyyy
1452 xxxxxxxxxx           yyyyyyyyyy
1453 xxxxxxxxxxxx         yyyyyyyy
1454 xxxxxxxxxxxxxx       yyyyyy
1455 xxxxxxxxxxxxxxxx     yyyy
1456 xxxxxxxxxxxxxxxxxx   yy
1457 xxxxxxxxxxxxxxxxxxxx 
1458 (10 rows)
1460 \pset format wrapped
1461 execute q;
1462   0123456789abcdef       0123456789     
1463 -------------------- ------------------
1464 xx                   yyyyyyyyyyyyyyyyyy
1465 xxxx                 yyyyyyyyyyyyyyyy
1466 xxxxxx               yyyyyyyyyyyyyy
1467 xxxxxxxx             yyyyyyyyyyyy
1468 xxxxxxxxxx           yyyyyyyyyy
1469 xxxxxxxxxxxx         yyyyyyyy
1470 xxxxxxxxxxxxxx       yyyyyy
1471 xxxxxxxxxxxxxxxx     yyyy
1472 xxxxxxxxxxxxxxxxxx   yy
1473 xxxxxxxxxxxxxxxxxxxx 
1474 (10 rows)
1476 \pset border 1
1477 \pset format unaligned
1478 execute q;
1479 0123456789abcdef|0123456789
1480 xx|yyyyyyyyyyyyyyyyyy
1481 xxxx|yyyyyyyyyyyyyyyy
1482 xxxxxx|yyyyyyyyyyyyyy
1483 xxxxxxxx|yyyyyyyyyyyy
1484 xxxxxxxxxx|yyyyyyyyyy
1485 xxxxxxxxxxxx|yyyyyyyy
1486 xxxxxxxxxxxxxx|yyyyyy
1487 xxxxxxxxxxxxxxxx|yyyy
1488 xxxxxxxxxxxxxxxxxx|yy
1489 xxxxxxxxxxxxxxxxxxxx|
1490 (10 rows)
1491 \pset format aligned
1492 execute q;
1493    0123456789abcdef   |     0123456789     
1494 ----------------------+--------------------
1495  xx                   | yyyyyyyyyyyyyyyyyy
1496  xxxx                 | yyyyyyyyyyyyyyyy
1497  xxxxxx               | yyyyyyyyyyyyyy
1498  xxxxxxxx             | yyyyyyyyyyyy
1499  xxxxxxxxxx           | yyyyyyyyyy
1500  xxxxxxxxxxxx         | yyyyyyyy
1501  xxxxxxxxxxxxxx       | yyyyyy
1502  xxxxxxxxxxxxxxxx     | yyyy
1503  xxxxxxxxxxxxxxxxxx   | yy
1504  xxxxxxxxxxxxxxxxxxxx | 
1505 (10 rows)
1507 \pset format wrapped
1508 execute q;
1509   0123456789abcdef   |    0123456789    
1510 ---------------------+------------------
1511  xx                  | yyyyyyyyyyyyyyyy.
1512                      |.yy
1513  xxxx                | yyyyyyyyyyyyyyyy
1514  xxxxxx              | yyyyyyyyyyyyyy
1515  xxxxxxxx            | yyyyyyyyyyyy
1516  xxxxxxxxxx          | yyyyyyyyyy
1517  xxxxxxxxxxxx        | yyyyyyyy
1518  xxxxxxxxxxxxxx      | yyyyyy
1519  xxxxxxxxxxxxxxxx    | yyyy
1520  xxxxxxxxxxxxxxxxxx  | yy
1521  xxxxxxxxxxxxxxxxxxx.| 
1522 .x                   | 
1523 (10 rows)
1525 \pset border 2
1526 \pset format unaligned
1527 execute q;
1528 0123456789abcdef|0123456789
1529 xx|yyyyyyyyyyyyyyyyyy
1530 xxxx|yyyyyyyyyyyyyyyy
1531 xxxxxx|yyyyyyyyyyyyyy
1532 xxxxxxxx|yyyyyyyyyyyy
1533 xxxxxxxxxx|yyyyyyyyyy
1534 xxxxxxxxxxxx|yyyyyyyy
1535 xxxxxxxxxxxxxx|yyyyyy
1536 xxxxxxxxxxxxxxxx|yyyy
1537 xxxxxxxxxxxxxxxxxx|yy
1538 xxxxxxxxxxxxxxxxxxxx|
1539 (10 rows)
1540 \pset format aligned
1541 execute q;
1542 +----------------------+--------------------+
1543 |   0123456789abcdef   |     0123456789     |
1544 +----------------------+--------------------+
1545 | xx                   | yyyyyyyyyyyyyyyyyy |
1546 | xxxx                 | yyyyyyyyyyyyyyyy   |
1547 | xxxxxx               | yyyyyyyyyyyyyy     |
1548 | xxxxxxxx             | yyyyyyyyyyyy       |
1549 | xxxxxxxxxx           | yyyyyyyyyy         |
1550 | xxxxxxxxxxxx         | yyyyyyyy           |
1551 | xxxxxxxxxxxxxx       | yyyyyy             |
1552 | xxxxxxxxxxxxxxxx     | yyyy               |
1553 | xxxxxxxxxxxxxxxxxx   | yy                 |
1554 | xxxxxxxxxxxxxxxxxxxx |                    |
1555 +----------------------+--------------------+
1556 (10 rows)
1558 \pset format wrapped
1559 execute q;
1560 +--------------------+-----------------+
1561 |  0123456789abcdef  |   0123456789    |
1562 +--------------------+-----------------+
1563 | xx                 | yyyyyyyyyyyyyyy.|
1564 |                    |.yyy             |
1565 | xxxx               | yyyyyyyyyyyyyyy.|
1566 |                    |.y               |
1567 | xxxxxx             | yyyyyyyyyyyyyy  |
1568 | xxxxxxxx           | yyyyyyyyyyyy    |
1569 | xxxxxxxxxx         | yyyyyyyyyy      |
1570 | xxxxxxxxxxxx       | yyyyyyyy        |
1571 | xxxxxxxxxxxxxx     | yyyyyy          |
1572 | xxxxxxxxxxxxxxxx   | yyyy            |
1573 | xxxxxxxxxxxxxxxxxx | yy              |
1574 | xxxxxxxxxxxxxxxxxx.|                 |
1575 |.xx                 |                 |
1576 +--------------------+-----------------+
1577 (10 rows)
1579 \pset expanded on
1580 \pset columns 30
1581 \pset border 0
1582 \pset format unaligned
1583 execute q;
1584 0123456789abcdef|xx
1585 0123456789|yyyyyyyyyyyyyyyyyy
1587 0123456789abcdef|xxxx
1588 0123456789|yyyyyyyyyyyyyyyy
1590 0123456789abcdef|xxxxxx
1591 0123456789|yyyyyyyyyyyyyy
1593 0123456789abcdef|xxxxxxxx
1594 0123456789|yyyyyyyyyyyy
1596 0123456789abcdef|xxxxxxxxxx
1597 0123456789|yyyyyyyyyy
1599 0123456789abcdef|xxxxxxxxxxxx
1600 0123456789|yyyyyyyy
1602 0123456789abcdef|xxxxxxxxxxxxxx
1603 0123456789|yyyyyy
1605 0123456789abcdef|xxxxxxxxxxxxxxxx
1606 0123456789|yyyy
1608 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1609 0123456789|yy
1611 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1612 0123456789|
1613 \pset format aligned
1614 execute q;
1615 * Record 1                          
1616 0123456789abcdef xx
1617 0123456789       yyyyyyyyyyyyyyyyyy
1618 * Record 2                          
1619 0123456789abcdef xxxx
1620 0123456789       yyyyyyyyyyyyyyyy
1621 * Record 3                          
1622 0123456789abcdef xxxxxx
1623 0123456789       yyyyyyyyyyyyyy
1624 * Record 4                          
1625 0123456789abcdef xxxxxxxx
1626 0123456789       yyyyyyyyyyyy
1627 * Record 5                          
1628 0123456789abcdef xxxxxxxxxx
1629 0123456789       yyyyyyyyyy
1630 * Record 6                          
1631 0123456789abcdef xxxxxxxxxxxx
1632 0123456789       yyyyyyyy
1633 * Record 7                          
1634 0123456789abcdef xxxxxxxxxxxxxx
1635 0123456789       yyyyyy
1636 * Record 8                          
1637 0123456789abcdef xxxxxxxxxxxxxxxx
1638 0123456789       yyyy
1639 * Record 9                          
1640 0123456789abcdef xxxxxxxxxxxxxxxxxx
1641 0123456789       yy
1642 * Record 10                         
1643 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
1644 0123456789       
1646 \pset format wrapped
1647 execute q;
1648 * Record 1                  
1649 0123456789abcdef xx
1650 0123456789       yyyyyyyyyyyy.
1651                 .yyyyyy
1652 * Record 2                  
1653 0123456789abcdef xxxx
1654 0123456789       yyyyyyyyyyyy.
1655                 .yyyy
1656 * Record 3                  
1657 0123456789abcdef xxxxxx
1658 0123456789       yyyyyyyyyyyy.
1659                 .yy
1660 * Record 4                  
1661 0123456789abcdef xxxxxxxx
1662 0123456789       yyyyyyyyyyyy
1663 * Record 5                  
1664 0123456789abcdef xxxxxxxxxx
1665 0123456789       yyyyyyyyyy
1666 * Record 6                  
1667 0123456789abcdef xxxxxxxxxxxx
1668 0123456789       yyyyyyyy
1669 * Record 7                  
1670 0123456789abcdef xxxxxxxxxxxx.
1671                 .xx
1672 0123456789       yyyyyy
1673 * Record 8                  
1674 0123456789abcdef xxxxxxxxxxxx.
1675                 .xxxx
1676 0123456789       yyyy
1677 * Record 9                  
1678 0123456789abcdef xxxxxxxxxxxx.
1679                 .xxxxxx
1680 0123456789       yy
1681 * Record 10                 
1682 0123456789abcdef xxxxxxxxxxxx.
1683                 .xxxxxxxx
1684 0123456789       
1686 \pset border 1
1687 \pset format unaligned
1688 execute q;
1689 0123456789abcdef|xx
1690 0123456789|yyyyyyyyyyyyyyyyyy
1692 0123456789abcdef|xxxx
1693 0123456789|yyyyyyyyyyyyyyyy
1695 0123456789abcdef|xxxxxx
1696 0123456789|yyyyyyyyyyyyyy
1698 0123456789abcdef|xxxxxxxx
1699 0123456789|yyyyyyyyyyyy
1701 0123456789abcdef|xxxxxxxxxx
1702 0123456789|yyyyyyyyyy
1704 0123456789abcdef|xxxxxxxxxxxx
1705 0123456789|yyyyyyyy
1707 0123456789abcdef|xxxxxxxxxxxxxx
1708 0123456789|yyyyyy
1710 0123456789abcdef|xxxxxxxxxxxxxxxx
1711 0123456789|yyyy
1713 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1714 0123456789|yy
1716 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1717 0123456789|
1718 \pset format aligned
1719 execute q;
1720 -[ RECORD 1 ]----+---------------------
1721 0123456789abcdef | xx
1722 0123456789       | yyyyyyyyyyyyyyyyyy
1723 -[ RECORD 2 ]----+---------------------
1724 0123456789abcdef | xxxx
1725 0123456789       | yyyyyyyyyyyyyyyy
1726 -[ RECORD 3 ]----+---------------------
1727 0123456789abcdef | xxxxxx
1728 0123456789       | yyyyyyyyyyyyyy
1729 -[ RECORD 4 ]----+---------------------
1730 0123456789abcdef | xxxxxxxx
1731 0123456789       | yyyyyyyyyyyy
1732 -[ RECORD 5 ]----+---------------------
1733 0123456789abcdef | xxxxxxxxxx
1734 0123456789       | yyyyyyyyyy
1735 -[ RECORD 6 ]----+---------------------
1736 0123456789abcdef | xxxxxxxxxxxx
1737 0123456789       | yyyyyyyy
1738 -[ RECORD 7 ]----+---------------------
1739 0123456789abcdef | xxxxxxxxxxxxxx
1740 0123456789       | yyyyyy
1741 -[ RECORD 8 ]----+---------------------
1742 0123456789abcdef | xxxxxxxxxxxxxxxx
1743 0123456789       | yyyy
1744 -[ RECORD 9 ]----+---------------------
1745 0123456789abcdef | xxxxxxxxxxxxxxxxxx
1746 0123456789       | yy
1747 -[ RECORD 10 ]---+---------------------
1748 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
1749 0123456789       | 
1751 \pset format wrapped
1752 execute q;
1753 -[ RECORD 1 ]----+-----------
1754 0123456789abcdef | xx
1755 0123456789       | yyyyyyyyyy.
1756                  |.yyyyyyyy
1757 -[ RECORD 2 ]----+-----------
1758 0123456789abcdef | xxxx
1759 0123456789       | yyyyyyyyyy.
1760                  |.yyyyyy
1761 -[ RECORD 3 ]----+-----------
1762 0123456789abcdef | xxxxxx
1763 0123456789       | yyyyyyyyyy.
1764                  |.yyyy
1765 -[ RECORD 4 ]----+-----------
1766 0123456789abcdef | xxxxxxxx
1767 0123456789       | yyyyyyyyyy.
1768                  |.yy
1769 -[ RECORD 5 ]----+-----------
1770 0123456789abcdef | xxxxxxxxxx
1771 0123456789       | yyyyyyyyyy
1772 -[ RECORD 6 ]----+-----------
1773 0123456789abcdef | xxxxxxxxxx.
1774                  |.xx
1775 0123456789       | yyyyyyyy
1776 -[ RECORD 7 ]----+-----------
1777 0123456789abcdef | xxxxxxxxxx.
1778                  |.xxxx
1779 0123456789       | yyyyyy
1780 -[ RECORD 8 ]----+-----------
1781 0123456789abcdef | xxxxxxxxxx.
1782                  |.xxxxxx
1783 0123456789       | yyyy
1784 -[ RECORD 9 ]----+-----------
1785 0123456789abcdef | xxxxxxxxxx.
1786                  |.xxxxxxxx
1787 0123456789       | yy
1788 -[ RECORD 10 ]---+-----------
1789 0123456789abcdef | xxxxxxxxxx.
1790                  |.xxxxxxxxxx
1791 0123456789       | 
1793 \pset border 2
1794 \pset format unaligned
1795 execute q;
1796 0123456789abcdef|xx
1797 0123456789|yyyyyyyyyyyyyyyyyy
1799 0123456789abcdef|xxxx
1800 0123456789|yyyyyyyyyyyyyyyy
1802 0123456789abcdef|xxxxxx
1803 0123456789|yyyyyyyyyyyyyy
1805 0123456789abcdef|xxxxxxxx
1806 0123456789|yyyyyyyyyyyy
1808 0123456789abcdef|xxxxxxxxxx
1809 0123456789|yyyyyyyyyy
1811 0123456789abcdef|xxxxxxxxxxxx
1812 0123456789|yyyyyyyy
1814 0123456789abcdef|xxxxxxxxxxxxxx
1815 0123456789|yyyyyy
1817 0123456789abcdef|xxxxxxxxxxxxxxxx
1818 0123456789|yyyy
1820 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1821 0123456789|yy
1823 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1824 0123456789|
1825 \pset format aligned
1826 execute q;
1827 +-[ RECORD 1 ]-----+----------------------+
1828 | 0123456789abcdef | xx                   |
1829 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
1830 +-[ RECORD 2 ]-----+----------------------+
1831 | 0123456789abcdef | xxxx                 |
1832 | 0123456789       | yyyyyyyyyyyyyyyy     |
1833 +-[ RECORD 3 ]-----+----------------------+
1834 | 0123456789abcdef | xxxxxx               |
1835 | 0123456789       | yyyyyyyyyyyyyy       |
1836 +-[ RECORD 4 ]-----+----------------------+
1837 | 0123456789abcdef | xxxxxxxx             |
1838 | 0123456789       | yyyyyyyyyyyy         |
1839 +-[ RECORD 5 ]-----+----------------------+
1840 | 0123456789abcdef | xxxxxxxxxx           |
1841 | 0123456789       | yyyyyyyyyy           |
1842 +-[ RECORD 6 ]-----+----------------------+
1843 | 0123456789abcdef | xxxxxxxxxxxx         |
1844 | 0123456789       | yyyyyyyy             |
1845 +-[ RECORD 7 ]-----+----------------------+
1846 | 0123456789abcdef | xxxxxxxxxxxxxx       |
1847 | 0123456789       | yyyyyy               |
1848 +-[ RECORD 8 ]-----+----------------------+
1849 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
1850 | 0123456789       | yyyy                 |
1851 +-[ RECORD 9 ]-----+----------------------+
1852 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
1853 | 0123456789       | yy                   |
1854 +-[ RECORD 10 ]----+----------------------+
1855 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
1856 | 0123456789       |                      |
1857 +------------------+----------------------+
1859 \pset format wrapped
1860 execute q;
1861 +-[ RECORD 1 ]-----+---------+
1862 | 0123456789abcdef | xx      |
1863 | 0123456789       | yyyyyyy.|
1864 |                  |.yyyyyyy.|
1865 |                  |.yyyy    |
1866 +-[ RECORD 2 ]-----+---------+
1867 | 0123456789abcdef | xxxx    |
1868 | 0123456789       | yyyyyyy.|
1869 |                  |.yyyyyyy.|
1870 |                  |.yy      |
1871 +-[ RECORD 3 ]-----+---------+
1872 | 0123456789abcdef | xxxxxx  |
1873 | 0123456789       | yyyyyyy.|
1874 |                  |.yyyyyyy |
1875 +-[ RECORD 4 ]-----+---------+
1876 | 0123456789abcdef | xxxxxxx.|
1877 |                  |.x       |
1878 | 0123456789       | yyyyyyy.|
1879 |                  |.yyyyy   |
1880 +-[ RECORD 5 ]-----+---------+
1881 | 0123456789abcdef | xxxxxxx.|
1882 |                  |.xxx     |
1883 | 0123456789       | yyyyyyy.|
1884 |                  |.yyy     |
1885 +-[ RECORD 6 ]-----+---------+
1886 | 0123456789abcdef | xxxxxxx.|
1887 |                  |.xxxxx   |
1888 | 0123456789       | yyyyyyy.|
1889 |                  |.y       |
1890 +-[ RECORD 7 ]-----+---------+
1891 | 0123456789abcdef | xxxxxxx.|
1892 |                  |.xxxxxxx |
1893 | 0123456789       | yyyyyy  |
1894 +-[ RECORD 8 ]-----+---------+
1895 | 0123456789abcdef | xxxxxxx.|
1896 |                  |.xxxxxxx.|
1897 |                  |.xx      |
1898 | 0123456789       | yyyy    |
1899 +-[ RECORD 9 ]-----+---------+
1900 | 0123456789abcdef | xxxxxxx.|
1901 |                  |.xxxxxxx.|
1902 |                  |.xxxx    |
1903 | 0123456789       | yy      |
1904 +-[ RECORD 10 ]----+---------+
1905 | 0123456789abcdef | xxxxxxx.|
1906 |                  |.xxxxxxx.|
1907 |                  |.xxxxxx  |
1908 | 0123456789       |         |
1909 +------------------+---------+
1911 \pset expanded on
1912 \pset columns 20
1913 \pset border 0
1914 \pset format unaligned
1915 execute q;
1916 0123456789abcdef|xx
1917 0123456789|yyyyyyyyyyyyyyyyyy
1919 0123456789abcdef|xxxx
1920 0123456789|yyyyyyyyyyyyyyyy
1922 0123456789abcdef|xxxxxx
1923 0123456789|yyyyyyyyyyyyyy
1925 0123456789abcdef|xxxxxxxx
1926 0123456789|yyyyyyyyyyyy
1928 0123456789abcdef|xxxxxxxxxx
1929 0123456789|yyyyyyyyyy
1931 0123456789abcdef|xxxxxxxxxxxx
1932 0123456789|yyyyyyyy
1934 0123456789abcdef|xxxxxxxxxxxxxx
1935 0123456789|yyyyyy
1937 0123456789abcdef|xxxxxxxxxxxxxxxx
1938 0123456789|yyyy
1940 0123456789abcdef|xxxxxxxxxxxxxxxxxx
1941 0123456789|yy
1943 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
1944 0123456789|
1945 \pset format aligned
1946 execute q;
1947 * Record 1                          
1948 0123456789abcdef xx
1949 0123456789       yyyyyyyyyyyyyyyyyy
1950 * Record 2                          
1951 0123456789abcdef xxxx
1952 0123456789       yyyyyyyyyyyyyyyy
1953 * Record 3                          
1954 0123456789abcdef xxxxxx
1955 0123456789       yyyyyyyyyyyyyy
1956 * Record 4                          
1957 0123456789abcdef xxxxxxxx
1958 0123456789       yyyyyyyyyyyy
1959 * Record 5                          
1960 0123456789abcdef xxxxxxxxxx
1961 0123456789       yyyyyyyyyy
1962 * Record 6                          
1963 0123456789abcdef xxxxxxxxxxxx
1964 0123456789       yyyyyyyy
1965 * Record 7                          
1966 0123456789abcdef xxxxxxxxxxxxxx
1967 0123456789       yyyyyy
1968 * Record 8                          
1969 0123456789abcdef xxxxxxxxxxxxxxxx
1970 0123456789       yyyy
1971 * Record 9                          
1972 0123456789abcdef xxxxxxxxxxxxxxxxxx
1973 0123456789       yy
1974 * Record 10                         
1975 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
1976 0123456789       
1978 \pset format wrapped
1979 execute q;
1980 * Record 1         
1981 0123456789abcdef xx
1982 0123456789       yyy.
1983                 .yyy.
1984                 .yyy.
1985                 .yyy.
1986                 .yyy.
1987                 .yyy
1988 * Record 2         
1989 0123456789abcdef xxx.
1990                 .x
1991 0123456789       yyy.
1992                 .yyy.
1993                 .yyy.
1994                 .yyy.
1995                 .yyy.
1996                 .y
1997 * Record 3         
1998 0123456789abcdef xxx.
1999                 .xxx
2000 0123456789       yyy.
2001                 .yyy.
2002                 .yyy.
2003                 .yyy.
2004                 .yy
2005 * Record 4         
2006 0123456789abcdef xxx.
2007                 .xxx.
2008                 .xx
2009 0123456789       yyy.
2010                 .yyy.
2011                 .yyy.
2012                 .yyy
2013 * Record 5         
2014 0123456789abcdef xxx.
2015                 .xxx.
2016                 .xxx.
2017                 .x
2018 0123456789       yyy.
2019                 .yyy.
2020                 .yyy.
2021                 .y
2022 * Record 6         
2023 0123456789abcdef xxx.
2024                 .xxx.
2025                 .xxx.
2026                 .xxx
2027 0123456789       yyy.
2028                 .yyy.
2029                 .yy
2030 * Record 7         
2031 0123456789abcdef xxx.
2032                 .xxx.
2033                 .xxx.
2034                 .xxx.
2035                 .xx
2036 0123456789       yyy.
2037                 .yyy
2038 * Record 8         
2039 0123456789abcdef xxx.
2040                 .xxx.
2041                 .xxx.
2042                 .xxx.
2043                 .xxx.
2044                 .x
2045 0123456789       yyy.
2046                 .y
2047 * Record 9         
2048 0123456789abcdef xxx.
2049                 .xxx.
2050                 .xxx.
2051                 .xxx.
2052                 .xxx.
2053                 .xxx
2054 0123456789       yy
2055 * Record 10        
2056 0123456789abcdef xxx.
2057                 .xxx.
2058                 .xxx.
2059                 .xxx.
2060                 .xxx.
2061                 .xxx.
2062                 .xx
2063 0123456789       
2065 \pset border 1
2066 \pset format unaligned
2067 execute q;
2068 0123456789abcdef|xx
2069 0123456789|yyyyyyyyyyyyyyyyyy
2071 0123456789abcdef|xxxx
2072 0123456789|yyyyyyyyyyyyyyyy
2074 0123456789abcdef|xxxxxx
2075 0123456789|yyyyyyyyyyyyyy
2077 0123456789abcdef|xxxxxxxx
2078 0123456789|yyyyyyyyyyyy
2080 0123456789abcdef|xxxxxxxxxx
2081 0123456789|yyyyyyyyyy
2083 0123456789abcdef|xxxxxxxxxxxx
2084 0123456789|yyyyyyyy
2086 0123456789abcdef|xxxxxxxxxxxxxx
2087 0123456789|yyyyyy
2089 0123456789abcdef|xxxxxxxxxxxxxxxx
2090 0123456789|yyyy
2092 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2093 0123456789|yy
2095 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2096 0123456789|
2097 \pset format aligned
2098 execute q;
2099 -[ RECORD 1 ]----+---------------------
2100 0123456789abcdef | xx
2101 0123456789       | yyyyyyyyyyyyyyyyyy
2102 -[ RECORD 2 ]----+---------------------
2103 0123456789abcdef | xxxx
2104 0123456789       | yyyyyyyyyyyyyyyy
2105 -[ RECORD 3 ]----+---------------------
2106 0123456789abcdef | xxxxxx
2107 0123456789       | yyyyyyyyyyyyyy
2108 -[ RECORD 4 ]----+---------------------
2109 0123456789abcdef | xxxxxxxx
2110 0123456789       | yyyyyyyyyyyy
2111 -[ RECORD 5 ]----+---------------------
2112 0123456789abcdef | xxxxxxxxxx
2113 0123456789       | yyyyyyyyyy
2114 -[ RECORD 6 ]----+---------------------
2115 0123456789abcdef | xxxxxxxxxxxx
2116 0123456789       | yyyyyyyy
2117 -[ RECORD 7 ]----+---------------------
2118 0123456789abcdef | xxxxxxxxxxxxxx
2119 0123456789       | yyyyyy
2120 -[ RECORD 8 ]----+---------------------
2121 0123456789abcdef | xxxxxxxxxxxxxxxx
2122 0123456789       | yyyy
2123 -[ RECORD 9 ]----+---------------------
2124 0123456789abcdef | xxxxxxxxxxxxxxxxxx
2125 0123456789       | yy
2126 -[ RECORD 10 ]---+---------------------
2127 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
2128 0123456789       | 
2130 \pset format wrapped
2131 execute q;
2132 -[ RECORD 1 ]----+----
2133 0123456789abcdef | xx
2134 0123456789       | yyy.
2135                  |.yyy.
2136                  |.yyy.
2137                  |.yyy.
2138                  |.yyy.
2139                  |.yyy
2140 -[ RECORD 2 ]----+----
2141 0123456789abcdef | xxx.
2142                  |.x
2143 0123456789       | yyy.
2144                  |.yyy.
2145                  |.yyy.
2146                  |.yyy.
2147                  |.yyy.
2148                  |.y
2149 -[ RECORD 3 ]----+----
2150 0123456789abcdef | xxx.
2151                  |.xxx
2152 0123456789       | yyy.
2153                  |.yyy.
2154                  |.yyy.
2155                  |.yyy.
2156                  |.yy
2157 -[ RECORD 4 ]----+----
2158 0123456789abcdef | xxx.
2159                  |.xxx.
2160                  |.xx
2161 0123456789       | yyy.
2162                  |.yyy.
2163                  |.yyy.
2164                  |.yyy
2165 -[ RECORD 5 ]----+----
2166 0123456789abcdef | xxx.
2167                  |.xxx.
2168                  |.xxx.
2169                  |.x
2170 0123456789       | yyy.
2171                  |.yyy.
2172                  |.yyy.
2173                  |.y
2174 -[ RECORD 6 ]----+----
2175 0123456789abcdef | xxx.
2176                  |.xxx.
2177                  |.xxx.
2178                  |.xxx
2179 0123456789       | yyy.
2180                  |.yyy.
2181                  |.yy
2182 -[ RECORD 7 ]----+----
2183 0123456789abcdef | xxx.
2184                  |.xxx.
2185                  |.xxx.
2186                  |.xxx.
2187                  |.xx
2188 0123456789       | yyy.
2189                  |.yyy
2190 -[ RECORD 8 ]----+----
2191 0123456789abcdef | xxx.
2192                  |.xxx.
2193                  |.xxx.
2194                  |.xxx.
2195                  |.xxx.
2196                  |.x
2197 0123456789       | yyy.
2198                  |.y
2199 -[ RECORD 9 ]----+----
2200 0123456789abcdef | xxx.
2201                  |.xxx.
2202                  |.xxx.
2203                  |.xxx.
2204                  |.xxx.
2205                  |.xxx
2206 0123456789       | yy
2207 -[ RECORD 10 ]---+----
2208 0123456789abcdef | xxx.
2209                  |.xxx.
2210                  |.xxx.
2211                  |.xxx.
2212                  |.xxx.
2213                  |.xxx.
2214                  |.xx
2215 0123456789       | 
2217 \pset border 2
2218 \pset format unaligned
2219 execute q;
2220 0123456789abcdef|xx
2221 0123456789|yyyyyyyyyyyyyyyyyy
2223 0123456789abcdef|xxxx
2224 0123456789|yyyyyyyyyyyyyyyy
2226 0123456789abcdef|xxxxxx
2227 0123456789|yyyyyyyyyyyyyy
2229 0123456789abcdef|xxxxxxxx
2230 0123456789|yyyyyyyyyyyy
2232 0123456789abcdef|xxxxxxxxxx
2233 0123456789|yyyyyyyyyy
2235 0123456789abcdef|xxxxxxxxxxxx
2236 0123456789|yyyyyyyy
2238 0123456789abcdef|xxxxxxxxxxxxxx
2239 0123456789|yyyyyy
2241 0123456789abcdef|xxxxxxxxxxxxxxxx
2242 0123456789|yyyy
2244 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2245 0123456789|yy
2247 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2248 0123456789|
2249 \pset format aligned
2250 execute q;
2251 +-[ RECORD 1 ]-----+----------------------+
2252 | 0123456789abcdef | xx                   |
2253 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
2254 +-[ RECORD 2 ]-----+----------------------+
2255 | 0123456789abcdef | xxxx                 |
2256 | 0123456789       | yyyyyyyyyyyyyyyy     |
2257 +-[ RECORD 3 ]-----+----------------------+
2258 | 0123456789abcdef | xxxxxx               |
2259 | 0123456789       | yyyyyyyyyyyyyy       |
2260 +-[ RECORD 4 ]-----+----------------------+
2261 | 0123456789abcdef | xxxxxxxx             |
2262 | 0123456789       | yyyyyyyyyyyy         |
2263 +-[ RECORD 5 ]-----+----------------------+
2264 | 0123456789abcdef | xxxxxxxxxx           |
2265 | 0123456789       | yyyyyyyyyy           |
2266 +-[ RECORD 6 ]-----+----------------------+
2267 | 0123456789abcdef | xxxxxxxxxxxx         |
2268 | 0123456789       | yyyyyyyy             |
2269 +-[ RECORD 7 ]-----+----------------------+
2270 | 0123456789abcdef | xxxxxxxxxxxxxx       |
2271 | 0123456789       | yyyyyy               |
2272 +-[ RECORD 8 ]-----+----------------------+
2273 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
2274 | 0123456789       | yyyy                 |
2275 +-[ RECORD 9 ]-----+----------------------+
2276 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
2277 | 0123456789       | yy                   |
2278 +-[ RECORD 10 ]----+----------------------+
2279 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
2280 | 0123456789       |                      |
2281 +------------------+----------------------+
2283 \pset format wrapped
2284 execute q;
2285 +-[ RECORD 1 ]-----+-----+
2286 | 0123456789abcdef | xx  |
2287 | 0123456789       | yyy.|
2288 |                  |.yyy.|
2289 |                  |.yyy.|
2290 |                  |.yyy.|
2291 |                  |.yyy.|
2292 |                  |.yyy |
2293 +-[ RECORD 2 ]-----+-----+
2294 | 0123456789abcdef | xxx.|
2295 |                  |.x   |
2296 | 0123456789       | yyy.|
2297 |                  |.yyy.|
2298 |                  |.yyy.|
2299 |                  |.yyy.|
2300 |                  |.yyy.|
2301 |                  |.y   |
2302 +-[ RECORD 3 ]-----+-----+
2303 | 0123456789abcdef | xxx.|
2304 |                  |.xxx |
2305 | 0123456789       | yyy.|
2306 |                  |.yyy.|
2307 |                  |.yyy.|
2308 |                  |.yyy.|
2309 |                  |.yy  |
2310 +-[ RECORD 4 ]-----+-----+
2311 | 0123456789abcdef | xxx.|
2312 |                  |.xxx.|
2313 |                  |.xx  |
2314 | 0123456789       | yyy.|
2315 |                  |.yyy.|
2316 |                  |.yyy.|
2317 |                  |.yyy |
2318 +-[ RECORD 5 ]-----+-----+
2319 | 0123456789abcdef | xxx.|
2320 |                  |.xxx.|
2321 |                  |.xxx.|
2322 |                  |.x   |
2323 | 0123456789       | yyy.|
2324 |                  |.yyy.|
2325 |                  |.yyy.|
2326 |                  |.y   |
2327 +-[ RECORD 6 ]-----+-----+
2328 | 0123456789abcdef | xxx.|
2329 |                  |.xxx.|
2330 |                  |.xxx.|
2331 |                  |.xxx |
2332 | 0123456789       | yyy.|
2333 |                  |.yyy.|
2334 |                  |.yy  |
2335 +-[ RECORD 7 ]-----+-----+
2336 | 0123456789abcdef | xxx.|
2337 |                  |.xxx.|
2338 |                  |.xxx.|
2339 |                  |.xxx.|
2340 |                  |.xx  |
2341 | 0123456789       | yyy.|
2342 |                  |.yyy |
2343 +-[ RECORD 8 ]-----+-----+
2344 | 0123456789abcdef | xxx.|
2345 |                  |.xxx.|
2346 |                  |.xxx.|
2347 |                  |.xxx.|
2348 |                  |.xxx.|
2349 |                  |.x   |
2350 | 0123456789       | yyy.|
2351 |                  |.y   |
2352 +-[ RECORD 9 ]-----+-----+
2353 | 0123456789abcdef | xxx.|
2354 |                  |.xxx.|
2355 |                  |.xxx.|
2356 |                  |.xxx.|
2357 |                  |.xxx.|
2358 |                  |.xxx |
2359 | 0123456789       | yy  |
2360 +-[ RECORD 10 ]----+-----+
2361 | 0123456789abcdef | xxx.|
2362 |                  |.xxx.|
2363 |                  |.xxx.|
2364 |                  |.xxx.|
2365 |                  |.xxx.|
2366 |                  |.xxx.|
2367 |                  |.xx  |
2368 | 0123456789       |     |
2369 +------------------+-----+
2371 \pset linestyle old-ascii
2372 \pset expanded off
2373 \pset columns 40
2374 \pset border 0
2375 \pset format unaligned
2376 execute q;
2377 0123456789abcdef|0123456789
2378 xx|yyyyyyyyyyyyyyyyyy
2379 xxxx|yyyyyyyyyyyyyyyy
2380 xxxxxx|yyyyyyyyyyyyyy
2381 xxxxxxxx|yyyyyyyyyyyy
2382 xxxxxxxxxx|yyyyyyyyyy
2383 xxxxxxxxxxxx|yyyyyyyy
2384 xxxxxxxxxxxxxx|yyyyyy
2385 xxxxxxxxxxxxxxxx|yyyy
2386 xxxxxxxxxxxxxxxxxx|yy
2387 xxxxxxxxxxxxxxxxxxxx|
2388 (10 rows)
2389 \pset format aligned
2390 execute q;
2391   0123456789abcdef       0123456789    
2392 -------------------- ------------------
2393 xx                   yyyyyyyyyyyyyyyyyy
2394 xxxx                 yyyyyyyyyyyyyyyy
2395 xxxxxx               yyyyyyyyyyyyyy
2396 xxxxxxxx             yyyyyyyyyyyy
2397 xxxxxxxxxx           yyyyyyyyyy
2398 xxxxxxxxxxxx         yyyyyyyy
2399 xxxxxxxxxxxxxx       yyyyyy
2400 xxxxxxxxxxxxxxxx     yyyy
2401 xxxxxxxxxxxxxxxxxx   yy
2402 xxxxxxxxxxxxxxxxxxxx 
2403 (10 rows)
2405 \pset format wrapped
2406 execute q;
2407   0123456789abcdef       0123456789    
2408 -------------------- ------------------
2409 xx                   yyyyyyyyyyyyyyyyyy
2410 xxxx                 yyyyyyyyyyyyyyyy
2411 xxxxxx               yyyyyyyyyyyyyy
2412 xxxxxxxx             yyyyyyyyyyyy
2413 xxxxxxxxxx           yyyyyyyyyy
2414 xxxxxxxxxxxx         yyyyyyyy
2415 xxxxxxxxxxxxxx       yyyyyy
2416 xxxxxxxxxxxxxxxx     yyyy
2417 xxxxxxxxxxxxxxxxxx   yy
2418 xxxxxxxxxxxxxxxxxxxx 
2419 (10 rows)
2421 \pset border 1
2422 \pset format unaligned
2423 execute q;
2424 0123456789abcdef|0123456789
2425 xx|yyyyyyyyyyyyyyyyyy
2426 xxxx|yyyyyyyyyyyyyyyy
2427 xxxxxx|yyyyyyyyyyyyyy
2428 xxxxxxxx|yyyyyyyyyyyy
2429 xxxxxxxxxx|yyyyyyyyyy
2430 xxxxxxxxxxxx|yyyyyyyy
2431 xxxxxxxxxxxxxx|yyyyyy
2432 xxxxxxxxxxxxxxxx|yyyy
2433 xxxxxxxxxxxxxxxxxx|yy
2434 xxxxxxxxxxxxxxxxxxxx|
2435 (10 rows)
2436 \pset format aligned
2437 execute q;
2438    0123456789abcdef   |     0123456789     
2439 ----------------------+--------------------
2440  xx                   | yyyyyyyyyyyyyyyyyy
2441  xxxx                 | yyyyyyyyyyyyyyyy
2442  xxxxxx               | yyyyyyyyyyyyyy
2443  xxxxxxxx             | yyyyyyyyyyyy
2444  xxxxxxxxxx           | yyyyyyyyyy
2445  xxxxxxxxxxxx         | yyyyyyyy
2446  xxxxxxxxxxxxxx       | yyyyyy
2447  xxxxxxxxxxxxxxxx     | yyyy
2448  xxxxxxxxxxxxxxxxxx   | yy
2449  xxxxxxxxxxxxxxxxxxxx | 
2450 (10 rows)
2452 \pset format wrapped
2453 execute q;
2454   0123456789abcdef   |    0123456789    
2455 ---------------------+------------------
2456  xx                  | yyyyyyyyyyyyyyyy 
2457                      ; yy
2458  xxxx                | yyyyyyyyyyyyyyyy
2459  xxxxxx              | yyyyyyyyyyyyyy
2460  xxxxxxxx            | yyyyyyyyyyyy
2461  xxxxxxxxxx          | yyyyyyyyyy
2462  xxxxxxxxxxxx        | yyyyyyyy
2463  xxxxxxxxxxxxxx      | yyyyyy
2464  xxxxxxxxxxxxxxxx    | yyyy
2465  xxxxxxxxxxxxxxxxxx  | yy
2466  xxxxxxxxxxxxxxxxxxx | 
2467  x                     
2468 (10 rows)
2470 \pset border 2
2471 \pset format unaligned
2472 execute q;
2473 0123456789abcdef|0123456789
2474 xx|yyyyyyyyyyyyyyyyyy
2475 xxxx|yyyyyyyyyyyyyyyy
2476 xxxxxx|yyyyyyyyyyyyyy
2477 xxxxxxxx|yyyyyyyyyyyy
2478 xxxxxxxxxx|yyyyyyyyyy
2479 xxxxxxxxxxxx|yyyyyyyy
2480 xxxxxxxxxxxxxx|yyyyyy
2481 xxxxxxxxxxxxxxxx|yyyy
2482 xxxxxxxxxxxxxxxxxx|yy
2483 xxxxxxxxxxxxxxxxxxxx|
2484 (10 rows)
2485 \pset format aligned
2486 execute q;
2487 +----------------------+--------------------+
2488 |   0123456789abcdef   |     0123456789     |
2489 +----------------------+--------------------+
2490 | xx                   | yyyyyyyyyyyyyyyyyy |
2491 | xxxx                 | yyyyyyyyyyyyyyyy   |
2492 | xxxxxx               | yyyyyyyyyyyyyy     |
2493 | xxxxxxxx             | yyyyyyyyyyyy       |
2494 | xxxxxxxxxx           | yyyyyyyyyy         |
2495 | xxxxxxxxxxxx         | yyyyyyyy           |
2496 | xxxxxxxxxxxxxx       | yyyyyy             |
2497 | xxxxxxxxxxxxxxxx     | yyyy               |
2498 | xxxxxxxxxxxxxxxxxx   | yy                 |
2499 | xxxxxxxxxxxxxxxxxxxx |                    |
2500 +----------------------+--------------------+
2501 (10 rows)
2503 \pset format wrapped
2504 execute q;
2505 +--------------------+-----------------+
2506 |  0123456789abcdef  |   0123456789    |
2507 +--------------------+-----------------+
2508 | xx                 | yyyyyyyyyyyyyyy |
2509 |                    ; yyy             |
2510 | xxxx               | yyyyyyyyyyyyyyy |
2511 |                    ; y               |
2512 | xxxxxx             | yyyyyyyyyyyyyy  |
2513 | xxxxxxxx           | yyyyyyyyyyyy    |
2514 | xxxxxxxxxx         | yyyyyyyyyy      |
2515 | xxxxxxxxxxxx       | yyyyyyyy        |
2516 | xxxxxxxxxxxxxx     | yyyyyy          |
2517 | xxxxxxxxxxxxxxxx   | yyyy            |
2518 | xxxxxxxxxxxxxxxxxx | yy              |
2519 | xxxxxxxxxxxxxxxxxx |                 |
2520 | xx                                   |
2521 +--------------------+-----------------+
2522 (10 rows)
2524 \pset expanded on
2525 \pset border 0
2526 \pset format unaligned
2527 execute q;
2528 0123456789abcdef|xx
2529 0123456789|yyyyyyyyyyyyyyyyyy
2531 0123456789abcdef|xxxx
2532 0123456789|yyyyyyyyyyyyyyyy
2534 0123456789abcdef|xxxxxx
2535 0123456789|yyyyyyyyyyyyyy
2537 0123456789abcdef|xxxxxxxx
2538 0123456789|yyyyyyyyyyyy
2540 0123456789abcdef|xxxxxxxxxx
2541 0123456789|yyyyyyyyyy
2543 0123456789abcdef|xxxxxxxxxxxx
2544 0123456789|yyyyyyyy
2546 0123456789abcdef|xxxxxxxxxxxxxx
2547 0123456789|yyyyyy
2549 0123456789abcdef|xxxxxxxxxxxxxxxx
2550 0123456789|yyyy
2552 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2553 0123456789|yy
2555 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2556 0123456789|
2557 \pset format aligned
2558 execute q;
2559 * Record 1                          
2560 0123456789abcdef xx
2561 0123456789       yyyyyyyyyyyyyyyyyy
2562 * Record 2                          
2563 0123456789abcdef xxxx
2564 0123456789       yyyyyyyyyyyyyyyy
2565 * Record 3                          
2566 0123456789abcdef xxxxxx
2567 0123456789       yyyyyyyyyyyyyy
2568 * Record 4                          
2569 0123456789abcdef xxxxxxxx
2570 0123456789       yyyyyyyyyyyy
2571 * Record 5                          
2572 0123456789abcdef xxxxxxxxxx
2573 0123456789       yyyyyyyyyy
2574 * Record 6                          
2575 0123456789abcdef xxxxxxxxxxxx
2576 0123456789       yyyyyyyy
2577 * Record 7                          
2578 0123456789abcdef xxxxxxxxxxxxxx
2579 0123456789       yyyyyy
2580 * Record 8                          
2581 0123456789abcdef xxxxxxxxxxxxxxxx
2582 0123456789       yyyy
2583 * Record 9                          
2584 0123456789abcdef xxxxxxxxxxxxxxxxxx
2585 0123456789       yy
2586 * Record 10                         
2587 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
2588 0123456789       
2590 \pset format wrapped
2591 execute q;
2592 * Record 1                          
2593 0123456789abcdef xx
2594 0123456789       yyyyyyyyyyyyyyyyyy
2595 * Record 2                          
2596 0123456789abcdef xxxx
2597 0123456789       yyyyyyyyyyyyyyyy
2598 * Record 3                          
2599 0123456789abcdef xxxxxx
2600 0123456789       yyyyyyyyyyyyyy
2601 * Record 4                          
2602 0123456789abcdef xxxxxxxx
2603 0123456789       yyyyyyyyyyyy
2604 * Record 5                          
2605 0123456789abcdef xxxxxxxxxx
2606 0123456789       yyyyyyyyyy
2607 * Record 6                          
2608 0123456789abcdef xxxxxxxxxxxx
2609 0123456789       yyyyyyyy
2610 * Record 7                          
2611 0123456789abcdef xxxxxxxxxxxxxx
2612 0123456789       yyyyyy
2613 * Record 8                          
2614 0123456789abcdef xxxxxxxxxxxxxxxx
2615 0123456789       yyyy
2616 * Record 9                          
2617 0123456789abcdef xxxxxxxxxxxxxxxxxx
2618 0123456789       yy
2619 * Record 10                         
2620 0123456789abcdef xxxxxxxxxxxxxxxxxxxx
2621 0123456789       
2623 \pset border 1
2624 \pset format unaligned
2625 execute q;
2626 0123456789abcdef|xx
2627 0123456789|yyyyyyyyyyyyyyyyyy
2629 0123456789abcdef|xxxx
2630 0123456789|yyyyyyyyyyyyyyyy
2632 0123456789abcdef|xxxxxx
2633 0123456789|yyyyyyyyyyyyyy
2635 0123456789abcdef|xxxxxxxx
2636 0123456789|yyyyyyyyyyyy
2638 0123456789abcdef|xxxxxxxxxx
2639 0123456789|yyyyyyyyyy
2641 0123456789abcdef|xxxxxxxxxxxx
2642 0123456789|yyyyyyyy
2644 0123456789abcdef|xxxxxxxxxxxxxx
2645 0123456789|yyyyyy
2647 0123456789abcdef|xxxxxxxxxxxxxxxx
2648 0123456789|yyyy
2650 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2651 0123456789|yy
2653 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2654 0123456789|
2655 \pset format aligned
2656 execute q;
2657 -[ RECORD 1 ]----+---------------------
2658 0123456789abcdef | xx
2659 0123456789       | yyyyyyyyyyyyyyyyyy
2660 -[ RECORD 2 ]----+---------------------
2661 0123456789abcdef | xxxx
2662 0123456789       | yyyyyyyyyyyyyyyy
2663 -[ RECORD 3 ]----+---------------------
2664 0123456789abcdef | xxxxxx
2665 0123456789       | yyyyyyyyyyyyyy
2666 -[ RECORD 4 ]----+---------------------
2667 0123456789abcdef | xxxxxxxx
2668 0123456789       | yyyyyyyyyyyy
2669 -[ RECORD 5 ]----+---------------------
2670 0123456789abcdef | xxxxxxxxxx
2671 0123456789       | yyyyyyyyyy
2672 -[ RECORD 6 ]----+---------------------
2673 0123456789abcdef | xxxxxxxxxxxx
2674 0123456789       | yyyyyyyy
2675 -[ RECORD 7 ]----+---------------------
2676 0123456789abcdef | xxxxxxxxxxxxxx
2677 0123456789       | yyyyyy
2678 -[ RECORD 8 ]----+---------------------
2679 0123456789abcdef | xxxxxxxxxxxxxxxx
2680 0123456789       | yyyy
2681 -[ RECORD 9 ]----+---------------------
2682 0123456789abcdef | xxxxxxxxxxxxxxxxxx
2683 0123456789       | yy
2684 -[ RECORD 10 ]---+---------------------
2685 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
2686 0123456789       | 
2688 \pset format wrapped
2689 execute q;
2690 -[ RECORD 1 ]----+---------------------
2691 0123456789abcdef | xx
2692 0123456789       | yyyyyyyyyyyyyyyyyy
2693 -[ RECORD 2 ]----+---------------------
2694 0123456789abcdef | xxxx
2695 0123456789       | yyyyyyyyyyyyyyyy
2696 -[ RECORD 3 ]----+---------------------
2697 0123456789abcdef | xxxxxx
2698 0123456789       | yyyyyyyyyyyyyy
2699 -[ RECORD 4 ]----+---------------------
2700 0123456789abcdef | xxxxxxxx
2701 0123456789       | yyyyyyyyyyyy
2702 -[ RECORD 5 ]----+---------------------
2703 0123456789abcdef | xxxxxxxxxx
2704 0123456789       | yyyyyyyyyy
2705 -[ RECORD 6 ]----+---------------------
2706 0123456789abcdef | xxxxxxxxxxxx
2707 0123456789       | yyyyyyyy
2708 -[ RECORD 7 ]----+---------------------
2709 0123456789abcdef | xxxxxxxxxxxxxx
2710 0123456789       | yyyyyy
2711 -[ RECORD 8 ]----+---------------------
2712 0123456789abcdef | xxxxxxxxxxxxxxxx
2713 0123456789       | yyyy
2714 -[ RECORD 9 ]----+---------------------
2715 0123456789abcdef | xxxxxxxxxxxxxxxxxx
2716 0123456789       | yy
2717 -[ RECORD 10 ]---+---------------------
2718 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx
2719 0123456789       | 
2721 \pset border 2
2722 \pset format unaligned
2723 execute q;
2724 0123456789abcdef|xx
2725 0123456789|yyyyyyyyyyyyyyyyyy
2727 0123456789abcdef|xxxx
2728 0123456789|yyyyyyyyyyyyyyyy
2730 0123456789abcdef|xxxxxx
2731 0123456789|yyyyyyyyyyyyyy
2733 0123456789abcdef|xxxxxxxx
2734 0123456789|yyyyyyyyyyyy
2736 0123456789abcdef|xxxxxxxxxx
2737 0123456789|yyyyyyyyyy
2739 0123456789abcdef|xxxxxxxxxxxx
2740 0123456789|yyyyyyyy
2742 0123456789abcdef|xxxxxxxxxxxxxx
2743 0123456789|yyyyyy
2745 0123456789abcdef|xxxxxxxxxxxxxxxx
2746 0123456789|yyyy
2748 0123456789abcdef|xxxxxxxxxxxxxxxxxx
2749 0123456789|yy
2751 0123456789abcdef|xxxxxxxxxxxxxxxxxxxx
2752 0123456789|
2753 \pset format aligned
2754 execute q;
2755 +-[ RECORD 1 ]-----+----------------------+
2756 | 0123456789abcdef | xx                   |
2757 | 0123456789       | yyyyyyyyyyyyyyyyyy   |
2758 +-[ RECORD 2 ]-----+----------------------+
2759 | 0123456789abcdef | xxxx                 |
2760 | 0123456789       | yyyyyyyyyyyyyyyy     |
2761 +-[ RECORD 3 ]-----+----------------------+
2762 | 0123456789abcdef | xxxxxx               |
2763 | 0123456789       | yyyyyyyyyyyyyy       |
2764 +-[ RECORD 4 ]-----+----------------------+
2765 | 0123456789abcdef | xxxxxxxx             |
2766 | 0123456789       | yyyyyyyyyyyy         |
2767 +-[ RECORD 5 ]-----+----------------------+
2768 | 0123456789abcdef | xxxxxxxxxx           |
2769 | 0123456789       | yyyyyyyyyy           |
2770 +-[ RECORD 6 ]-----+----------------------+
2771 | 0123456789abcdef | xxxxxxxxxxxx         |
2772 | 0123456789       | yyyyyyyy             |
2773 +-[ RECORD 7 ]-----+----------------------+
2774 | 0123456789abcdef | xxxxxxxxxxxxxx       |
2775 | 0123456789       | yyyyyy               |
2776 +-[ RECORD 8 ]-----+----------------------+
2777 | 0123456789abcdef | xxxxxxxxxxxxxxxx     |
2778 | 0123456789       | yyyy                 |
2779 +-[ RECORD 9 ]-----+----------------------+
2780 | 0123456789abcdef | xxxxxxxxxxxxxxxxxx   |
2781 | 0123456789       | yy                   |
2782 +-[ RECORD 10 ]----+----------------------+
2783 | 0123456789abcdef | xxxxxxxxxxxxxxxxxxxx |
2784 | 0123456789       |                      |
2785 +------------------+----------------------+
2787 \pset format wrapped
2788 execute q;
2789 +-[ RECORD 1 ]-----+-------------------+
2790 | 0123456789abcdef | xx                |
2791 | 0123456789       | yyyyyyyyyyyyyyyyy |
2792 |                  ; y                 |
2793 +-[ RECORD 2 ]-----+-------------------+
2794 | 0123456789abcdef | xxxx              |
2795 | 0123456789       | yyyyyyyyyyyyyyyy  |
2796 +-[ RECORD 3 ]-----+-------------------+
2797 | 0123456789abcdef | xxxxxx            |
2798 | 0123456789       | yyyyyyyyyyyyyy    |
2799 +-[ RECORD 4 ]-----+-------------------+
2800 | 0123456789abcdef | xxxxxxxx          |
2801 | 0123456789       | yyyyyyyyyyyy      |
2802 +-[ RECORD 5 ]-----+-------------------+
2803 | 0123456789abcdef | xxxxxxxxxx        |
2804 | 0123456789       | yyyyyyyyyy        |
2805 +-[ RECORD 6 ]-----+-------------------+
2806 | 0123456789abcdef | xxxxxxxxxxxx      |
2807 | 0123456789       | yyyyyyyy          |
2808 +-[ RECORD 7 ]-----+-------------------+
2809 | 0123456789abcdef | xxxxxxxxxxxxxx    |
2810 | 0123456789       | yyyyyy            |
2811 +-[ RECORD 8 ]-----+-------------------+
2812 | 0123456789abcdef | xxxxxxxxxxxxxxxx  |
2813 | 0123456789       | yyyy              |
2814 +-[ RECORD 9 ]-----+-------------------+
2815 | 0123456789abcdef | xxxxxxxxxxxxxxxxx |
2816 |                  ; x                 |
2817 | 0123456789       | yy                |
2818 +-[ RECORD 10 ]----+-------------------+
2819 | 0123456789abcdef | xxxxxxxxxxxxxxxxx |
2820 |                  ; xxx               |
2821 | 0123456789       |                   |
2822 +------------------+-------------------+
2824 deallocate q;
2825 \pset linestyle ascii
2826 \pset border 1
2827 -- support table for output-format tests (useful to create a footer)
2828 create table psql_serial_tab (id serial);
2829 -- test header/footer/tuples_only behavior in aligned/unaligned/wrapped cases
2830 \pset format aligned
2831 \pset expanded off
2832 \d psql_serial_tab_id_seq
2833                Sequence "public.psql_serial_tab_id_seq"
2834   Type   | Start | Minimum |  Maximum   | Increment | Cycles? | Cache 
2835 ---------+-------+---------+------------+-----------+---------+-------
2836  integer |     1 |       1 | 2147483647 |         1 | no      |     1
2837 Owned by: public.psql_serial_tab.id
2839 \pset tuples_only true
2840 \df exp
2841  pg_catalog | exp  | double precision | double precision    | func
2842  pg_catalog | exp  | numeric          | numeric             | func
2844 \pset tuples_only false
2845 \pset expanded on
2846 \d psql_serial_tab_id_seq
2847 Sequence "public.psql_serial_tab_id_seq"
2848 -[ RECORD 1 ]---------
2849 Type      | integer
2850 Start     | 1
2851 Minimum   | 1
2852 Maximum   | 2147483647
2853 Increment | 1
2854 Cycles?   | no
2855 Cache     | 1
2857 Owned by: public.psql_serial_tab.id
2859 \pset tuples_only true
2860 \df exp
2861 Schema              | pg_catalog
2862 Name                | exp
2863 Result data type    | double precision
2864 Argument data types | double precision
2865 Type                | func
2866 --------------------+-----------------
2867 Schema              | pg_catalog
2868 Name                | exp
2869 Result data type    | numeric
2870 Argument data types | numeric
2871 Type                | func
2873 \pset tuples_only false
2874 -- empty table is a special case for this format
2875 select 1 where false;
2876 (0 rows)
2878 \pset format unaligned
2879 \pset expanded off
2880 \d psql_serial_tab_id_seq
2881 Sequence "public.psql_serial_tab_id_seq"
2882 Type|Start|Minimum|Maximum|Increment|Cycles?|Cache
2883 integer|1|1|2147483647|1|no|1
2884 Owned by: public.psql_serial_tab.id
2885 \pset tuples_only true
2886 \df exp
2887 pg_catalog|exp|double precision|double precision|func
2888 pg_catalog|exp|numeric|numeric|func
2889 \pset tuples_only false
2890 \pset expanded on
2891 \d psql_serial_tab_id_seq
2892 Sequence "public.psql_serial_tab_id_seq"
2894 Type|integer
2895 Start|1
2896 Minimum|1
2897 Maximum|2147483647
2898 Increment|1
2899 Cycles?|no
2900 Cache|1
2902 Owned by: public.psql_serial_tab.id
2903 \pset tuples_only true
2904 \df exp
2905 Schema|pg_catalog
2906 Name|exp
2907 Result data type|double precision
2908 Argument data types|double precision
2909 Type|func
2911 Schema|pg_catalog
2912 Name|exp
2913 Result data type|numeric
2914 Argument data types|numeric
2915 Type|func
2916 \pset tuples_only false
2917 \pset format wrapped
2918 \pset expanded off
2919 \d psql_serial_tab_id_seq
2920                Sequence "public.psql_serial_tab_id_seq"
2921   Type   | Start | Minimum |  Maximum   | Increment | Cycles? | Cache 
2922 ---------+-------+---------+------------+-----------+---------+-------
2923  integer |     1 |       1 | 2147483647 |         1 | no      |     1
2924 Owned by: public.psql_serial_tab.id
2926 \pset tuples_only true
2927 \df exp
2928  pg_catalog | exp  | double precision | double precision    | func
2929  pg_catalog | exp  | numeric          | numeric             | func
2931 \pset tuples_only false
2932 \pset expanded on
2933 \d psql_serial_tab_id_seq
2934 Sequence "public.psql_serial_tab_id_seq"
2935 -[ RECORD 1 ]---------
2936 Type      | integer
2937 Start     | 1
2938 Minimum   | 1
2939 Maximum   | 2147483647
2940 Increment | 1
2941 Cycles?   | no
2942 Cache     | 1
2944 Owned by: public.psql_serial_tab.id
2946 \pset tuples_only true
2947 \df exp
2948 Schema              | pg_catalog
2949 Name                | exp
2950 Result data type    | double precision
2951 Argument data types | double precision
2952 Type                | func
2953 --------------------+-----------------
2954 Schema              | pg_catalog
2955 Name                | exp
2956 Result data type    | numeric
2957 Argument data types | numeric
2958 Type                | func
2960 \pset tuples_only false
2961 -- check conditional am display
2962 \pset expanded off
2963 CREATE SCHEMA tableam_display;
2964 CREATE ROLE regress_display_role;
2965 ALTER SCHEMA tableam_display OWNER TO regress_display_role;
2966 SET search_path TO tableam_display;
2967 CREATE ACCESS METHOD heap_psql TYPE TABLE HANDLER heap_tableam_handler;
2968 SET ROLE TO regress_display_role;
2969 -- Use only relations with a physical size of zero.
2970 CREATE TABLE tbl_heap_psql(f1 int, f2 char(100)) using heap_psql;
2971 CREATE TABLE tbl_heap(f1 int, f2 char(100)) using heap;
2972 CREATE VIEW view_heap_psql AS SELECT f1 from tbl_heap_psql;
2973 CREATE MATERIALIZED VIEW mat_view_heap_psql USING heap_psql AS SELECT f1 from tbl_heap_psql;
2974 \d+ tbl_heap_psql
2975                               Table "tableam_display.tbl_heap_psql"
2976  Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
2977 --------+----------------+-----------+----------+---------+----------+--------------+-------------
2978  f1     | integer        |           |          |         | plain    |              | 
2979  f2     | character(100) |           |          |         | extended |              | 
2981 \d+ tbl_heap
2982                                  Table "tableam_display.tbl_heap"
2983  Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
2984 --------+----------------+-----------+----------+---------+----------+--------------+-------------
2985  f1     | integer        |           |          |         | plain    |              | 
2986  f2     | character(100) |           |          |         | extended |              | 
2988 \set HIDE_TABLEAM off
2989 \d+ tbl_heap_psql
2990                               Table "tableam_display.tbl_heap_psql"
2991  Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
2992 --------+----------------+-----------+----------+---------+----------+--------------+-------------
2993  f1     | integer        |           |          |         | plain    |              | 
2994  f2     | character(100) |           |          |         | extended |              | 
2995 Access method: heap_psql
2997 \d+ tbl_heap
2998                                  Table "tableam_display.tbl_heap"
2999  Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
3000 --------+----------------+-----------+----------+---------+----------+--------------+-------------
3001  f1     | integer        |           |          |         | plain    |              | 
3002  f2     | character(100) |           |          |         | extended |              | 
3003 Access method: heap
3005 -- AM is displayed for tables, indexes and materialized views.
3007                                                            List of relations
3008      Schema      |        Name        |       Type        |        Owner         | Persistence | Access method |  Size   | Description 
3009 -----------------+--------------------+-------------------+----------------------+-------------+---------------+---------+-------------
3010  tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent   | heap_psql     | 0 bytes | 
3011  tableam_display | tbl_heap           | table             | regress_display_role | permanent   | heap          | 0 bytes | 
3012  tableam_display | tbl_heap_psql      | table             | regress_display_role | permanent   | heap_psql     | 0 bytes | 
3013  tableam_display | view_heap_psql     | view              | regress_display_role | permanent   |               | 0 bytes | 
3014 (4 rows)
3016 \dt+
3017                                                   List of relations
3018      Schema      |     Name      | Type  |        Owner         | Persistence | Access method |  Size   | Description 
3019 -----------------+---------------+-------+----------------------+-------------+---------------+---------+-------------
3020  tableam_display | tbl_heap      | table | regress_display_role | permanent   | heap          | 0 bytes | 
3021  tableam_display | tbl_heap_psql | table | regress_display_role | permanent   | heap_psql     | 0 bytes | 
3022 (2 rows)
3024 \dm+
3025                                                            List of relations
3026      Schema      |        Name        |       Type        |        Owner         | Persistence | Access method |  Size   | Description 
3027 -----------------+--------------------+-------------------+----------------------+-------------+---------------+---------+-------------
3028  tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent   | heap_psql     | 0 bytes | 
3029 (1 row)
3031 -- But not for views and sequences.
3032 \dv+
3033                                           List of relations
3034      Schema      |      Name      | Type |        Owner         | Persistence |  Size   | Description 
3035 -----------------+----------------+------+----------------------+-------------+---------+-------------
3036  tableam_display | view_heap_psql | view | regress_display_role | permanent   | 0 bytes | 
3037 (1 row)
3039 \set HIDE_TABLEAM on
3041                                                    List of relations
3042      Schema      |        Name        |       Type        |        Owner         | Persistence |  Size   | Description 
3043 -----------------+--------------------+-------------------+----------------------+-------------+---------+-------------
3044  tableam_display | mat_view_heap_psql | materialized view | regress_display_role | permanent   | 0 bytes | 
3045  tableam_display | tbl_heap           | table             | regress_display_role | permanent   | 0 bytes | 
3046  tableam_display | tbl_heap_psql      | table             | regress_display_role | permanent   | 0 bytes | 
3047  tableam_display | view_heap_psql     | view              | regress_display_role | permanent   | 0 bytes | 
3048 (4 rows)
3050 RESET ROLE;
3051 RESET search_path;
3052 DROP SCHEMA tableam_display CASCADE;
3053 NOTICE:  drop cascades to 4 other objects
3054 DETAIL:  drop cascades to table tableam_display.tbl_heap_psql
3055 drop cascades to table tableam_display.tbl_heap
3056 drop cascades to view tableam_display.view_heap_psql
3057 drop cascades to materialized view tableam_display.mat_view_heap_psql
3058 DROP ACCESS METHOD heap_psql;
3059 DROP ROLE regress_display_role;
3060 -- test numericlocale (as best we can without control of psql's locale)
3061 \pset format aligned
3062 \pset expanded off
3063 \pset numericlocale true
3064 select n, -n as m, n * 111 as x, '1e90'::float8 as f
3065 from generate_series(0,3) n;
3066  n | m  |  x  |   f   
3067 ---+----+-----+-------
3068  0 |  0 |   0 | 1e+90
3069  1 | -1 | 111 | 1e+90
3070  2 | -2 | 222 | 1e+90
3071  3 | -3 | 333 | 1e+90
3072 (4 rows)
3074 \pset numericlocale false
3075 -- test asciidoc output format
3076 \pset format asciidoc
3077 \pset border 1
3078 \pset expanded off
3079 \d psql_serial_tab_id_seq
3081 .Sequence "public.psql_serial_tab_id_seq"
3082 [options="header",cols="<l,>l,>l,>l,>l,<l,>l",frame="none"]
3083 |====
3084 ^l|Type ^l|Start ^l|Minimum ^l|Maximum ^l|Increment ^l|Cycles? ^l|Cache
3085 |integer |1 |1 |2147483647 |1 |no |1
3086 |====
3088 ....
3089 Owned by: public.psql_serial_tab.id
3090 ....
3091 \pset tuples_only true
3092 \df exp
3094 [cols="<l,<l,<l,<l,<l",frame="none"]
3095 |====
3096 |pg_catalog |exp |double precision |double precision |func
3097 |pg_catalog |exp |numeric |numeric |func
3098 |====
3099 \pset tuples_only false
3100 \pset expanded on
3101 \d psql_serial_tab_id_seq
3103 .Sequence "public.psql_serial_tab_id_seq"
3104 [cols="h,l",frame="none"]
3105 |====
3106 2+^|Record 1
3107 <l|Type <l|integer
3108 <l|Start >l|1
3109 <l|Minimum >l|1
3110 <l|Maximum >l|2147483647
3111 <l|Increment >l|1
3112 <l|Cycles? <l|no
3113 <l|Cache >l|1
3114 |====
3116 ....
3117 Owned by: public.psql_serial_tab.id
3118 ....
3119 \pset tuples_only true
3120 \df exp
3122 [cols="h,l",frame="none"]
3123 |====
3125 <l|Schema <l|pg_catalog
3126 <l|Name <l|exp
3127 <l|Result data type <l|double precision
3128 <l|Argument data types <l|double precision
3129 <l|Type <l|func
3131 <l|Schema <l|pg_catalog
3132 <l|Name <l|exp
3133 <l|Result data type <l|numeric
3134 <l|Argument data types <l|numeric
3135 <l|Type <l|func
3136 |====
3137 \pset tuples_only false
3138 prepare q as
3139   select 'some|text' as "a|title", '        ' as "empty ", n as int
3140   from generate_series(1,2) as n;
3141 \pset expanded off
3142 \pset border 0
3143 execute q;
3145 [options="header",cols="<l,<l,>l",frame="none",grid="none"]
3146 |====
3147 ^l|a\|title ^l|empty  ^l|int
3148 |some\|text |  |1
3149 |some\|text |  |2
3150 |====
3152 ....
3153 (2 rows)
3154 ....
3155 \pset border 1
3156 execute q;
3158 [options="header",cols="<l,<l,>l",frame="none"]
3159 |====
3160 ^l|a\|title ^l|empty  ^l|int
3161 |some\|text |  |1
3162 |some\|text |  |2
3163 |====
3165 ....
3166 (2 rows)
3167 ....
3168 \pset border 2
3169 execute q;
3171 [options="header",cols="<l,<l,>l",frame="all",grid="all"]
3172 |====
3173 ^l|a\|title ^l|empty  ^l|int
3174 |some\|text |  |1
3175 |some\|text |  |2
3176 |====
3178 ....
3179 (2 rows)
3180 ....
3181 \pset expanded on
3182 \pset border 0
3183 execute q;
3185 [cols="h,l",frame="none",grid="none"]
3186 |====
3187 2+^|Record 1
3188 <l|a\|title <l|some\|text
3189 <l|empty  <l| 
3190 <l|int >l|1
3191 2+^|Record 2
3192 <l|a\|title <l|some\|text
3193 <l|empty  <l| 
3194 <l|int >l|2
3195 |====
3196 \pset border 1
3197 execute q;
3199 [cols="h,l",frame="none"]
3200 |====
3201 2+^|Record 1
3202 <l|a\|title <l|some\|text
3203 <l|empty  <l| 
3204 <l|int >l|1
3205 2+^|Record 2
3206 <l|a\|title <l|some\|text
3207 <l|empty  <l| 
3208 <l|int >l|2
3209 |====
3210 \pset border 2
3211 execute q;
3213 [cols="h,l",frame="all",grid="all"]
3214 |====
3215 2+^|Record 1
3216 <l|a\|title <l|some\|text
3217 <l|empty  <l| 
3218 <l|int >l|1
3219 2+^|Record 2
3220 <l|a\|title <l|some\|text
3221 <l|empty  <l| 
3222 <l|int >l|2
3223 |====
3224 deallocate q;
3225 -- test csv output format
3226 \pset format csv
3227 \pset border 1
3228 \pset expanded off
3229 \d psql_serial_tab_id_seq
3230 Type,Start,Minimum,Maximum,Increment,Cycles?,Cache
3231 integer,1,1,2147483647,1,no,1
3232 \pset tuples_only true
3233 \df exp
3234 pg_catalog,exp,double precision,double precision,func
3235 pg_catalog,exp,numeric,numeric,func
3236 \pset tuples_only false
3237 \pset expanded on
3238 \d psql_serial_tab_id_seq
3239 Type,integer
3240 Start,1
3241 Minimum,1
3242 Maximum,2147483647
3243 Increment,1
3244 Cycles?,no
3245 Cache,1
3246 \pset tuples_only true
3247 \df exp
3248 Schema,pg_catalog
3249 Name,exp
3250 Result data type,double precision
3251 Argument data types,double precision
3252 Type,func
3253 Schema,pg_catalog
3254 Name,exp
3255 Result data type,numeric
3256 Argument data types,numeric
3257 Type,func
3258 \pset tuples_only false
3259 prepare q as
3260   select 'some"text' as "a""title", E'  <foo>\n<bar>' as "junk",
3261          '   ' as "empty", n as int
3262   from generate_series(1,2) as n;
3263 \pset expanded off
3264 execute q;
3265 "a""title",junk,empty,int
3266 "some""text","  <foo>
3267 <bar>",   ,1
3268 "some""text","  <foo>
3269 <bar>",   ,2
3270 \pset expanded on
3271 execute q;
3272 "a""title","some""text"
3273 junk,"  <foo>
3274 <bar>"
3275 empty,   
3276 int,1
3277 "a""title","some""text"
3278 junk,"  <foo>
3279 <bar>"
3280 empty,   
3281 int,2
3282 deallocate q;
3283 -- special cases
3284 \pset expanded off
3285 select 'comma,comma' as comma, 'semi;semi' as semi;
3286 comma,semi
3287 "comma,comma",semi;semi
3288 \pset csv_fieldsep ';'
3289 select 'comma,comma' as comma, 'semi;semi' as semi;
3290 comma;semi
3291 comma,comma;"semi;semi"
3292 select '\.' as data;
3293 data
3294 "\."
3295 \pset csv_fieldsep '.'
3296 select '\' as d1, '' as d2;
3297 "d1"."d2"
3298 "\".""
3299 -- illegal csv separators
3300 \pset csv_fieldsep ''
3301 \pset: csv_fieldsep must be a single one-byte character
3302 \pset csv_fieldsep '\0'
3303 \pset: csv_fieldsep must be a single one-byte character
3304 \pset csv_fieldsep '\n'
3305 \pset: csv_fieldsep cannot be a double quote, a newline, or a carriage return
3306 \pset csv_fieldsep '\r'
3307 \pset: csv_fieldsep cannot be a double quote, a newline, or a carriage return
3308 \pset csv_fieldsep '"'
3309 \pset: csv_fieldsep cannot be a double quote, a newline, or a carriage return
3310 \pset csv_fieldsep ',,'
3311 \pset: csv_fieldsep must be a single one-byte character
3312 \pset csv_fieldsep ','
3313 -- test html output format
3314 \pset format html
3315 \pset border 1
3316 \pset expanded off
3317 \d psql_serial_tab_id_seq
3318 <table border="1">
3319   <caption>Sequence &quot;public.psql_serial_tab_id_seq&quot;</caption>
3320   <tr>
3321     <th align="center">Type</th>
3322     <th align="center">Start</th>
3323     <th align="center">Minimum</th>
3324     <th align="center">Maximum</th>
3325     <th align="center">Increment</th>
3326     <th align="center">Cycles?</th>
3327     <th align="center">Cache</th>
3328   </tr>
3329   <tr valign="top">
3330     <td align="left">integer</td>
3331     <td align="right">1</td>
3332     <td align="right">1</td>
3333     <td align="right">2147483647</td>
3334     <td align="right">1</td>
3335     <td align="left">no</td>
3336     <td align="right">1</td>
3337   </tr>
3338 </table>
3339 <p>Owned by: public.psql_serial_tab.id<br />
3340 </p>
3341 \pset tuples_only true
3342 \df exp
3343 <table border="1">
3344   <tr valign="top">
3345     <td align="left">pg_catalog</td>
3346     <td align="left">exp</td>
3347     <td align="left">double precision</td>
3348     <td align="left">double precision</td>
3349     <td align="left">func</td>
3350   </tr>
3351   <tr valign="top">
3352     <td align="left">pg_catalog</td>
3353     <td align="left">exp</td>
3354     <td align="left">numeric</td>
3355     <td align="left">numeric</td>
3356     <td align="left">func</td>
3357   </tr>
3358 </table>
3360 \pset tuples_only false
3361 \pset expanded on
3362 \d psql_serial_tab_id_seq
3363 <table border="1">
3364   <caption>Sequence &quot;public.psql_serial_tab_id_seq&quot;</caption>
3366   <tr><td colspan="2" align="center">Record 1</td></tr>
3367   <tr valign="top">
3368     <th>Type</th>
3369     <td align="left">integer</td>
3370   </tr>
3371   <tr valign="top">
3372     <th>Start</th>
3373     <td align="right">1</td>
3374   </tr>
3375   <tr valign="top">
3376     <th>Minimum</th>
3377     <td align="right">1</td>
3378   </tr>
3379   <tr valign="top">
3380     <th>Maximum</th>
3381     <td align="right">2147483647</td>
3382   </tr>
3383   <tr valign="top">
3384     <th>Increment</th>
3385     <td align="right">1</td>
3386   </tr>
3387   <tr valign="top">
3388     <th>Cycles?</th>
3389     <td align="left">no</td>
3390   </tr>
3391   <tr valign="top">
3392     <th>Cache</th>
3393     <td align="right">1</td>
3394   </tr>
3395 </table>
3396 <p>Owned by: public.psql_serial_tab.id<br />
3397 </p>
3398 \pset tuples_only true
3399 \df exp
3400 <table border="1">
3402   <tr><td colspan="2">&nbsp;</td></tr>
3403   <tr valign="top">
3404     <th>Schema</th>
3405     <td align="left">pg_catalog</td>
3406   </tr>
3407   <tr valign="top">
3408     <th>Name</th>
3409     <td align="left">exp</td>
3410   </tr>
3411   <tr valign="top">
3412     <th>Result data type</th>
3413     <td align="left">double precision</td>
3414   </tr>
3415   <tr valign="top">
3416     <th>Argument data types</th>
3417     <td align="left">double precision</td>
3418   </tr>
3419   <tr valign="top">
3420     <th>Type</th>
3421     <td align="left">func</td>
3422   </tr>
3424   <tr><td colspan="2">&nbsp;</td></tr>
3425   <tr valign="top">
3426     <th>Schema</th>
3427     <td align="left">pg_catalog</td>
3428   </tr>
3429   <tr valign="top">
3430     <th>Name</th>
3431     <td align="left">exp</td>
3432   </tr>
3433   <tr valign="top">
3434     <th>Result data type</th>
3435     <td align="left">numeric</td>
3436   </tr>
3437   <tr valign="top">
3438     <th>Argument data types</th>
3439     <td align="left">numeric</td>
3440   </tr>
3441   <tr valign="top">
3442     <th>Type</th>
3443     <td align="left">func</td>
3444   </tr>
3445 </table>
3447 \pset tuples_only false
3448 prepare q as
3449   select 'some"text' as "a&title", E'  <foo>\n<bar>' as "junk",
3450          '   ' as "empty", n as int
3451   from generate_series(1,2) as n;
3452 \pset expanded off
3453 \pset border 0
3454 execute q;
3455 <table border="0">
3456   <tr>
3457     <th align="center">a&amp;title</th>
3458     <th align="center">junk</th>
3459     <th align="center">empty</th>
3460     <th align="center">int</th>
3461   </tr>
3462   <tr valign="top">
3463     <td align="left">some&quot;text</td>
3464     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3465 &lt;bar&gt;</td>
3466     <td align="left">&nbsp; </td>
3467     <td align="right">1</td>
3468   </tr>
3469   <tr valign="top">
3470     <td align="left">some&quot;text</td>
3471     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3472 &lt;bar&gt;</td>
3473     <td align="left">&nbsp; </td>
3474     <td align="right">2</td>
3475   </tr>
3476 </table>
3477 <p>(2 rows)<br />
3478 </p>
3479 \pset border 1
3480 execute q;
3481 <table border="1">
3482   <tr>
3483     <th align="center">a&amp;title</th>
3484     <th align="center">junk</th>
3485     <th align="center">empty</th>
3486     <th align="center">int</th>
3487   </tr>
3488   <tr valign="top">
3489     <td align="left">some&quot;text</td>
3490     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3491 &lt;bar&gt;</td>
3492     <td align="left">&nbsp; </td>
3493     <td align="right">1</td>
3494   </tr>
3495   <tr valign="top">
3496     <td align="left">some&quot;text</td>
3497     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3498 &lt;bar&gt;</td>
3499     <td align="left">&nbsp; </td>
3500     <td align="right">2</td>
3501   </tr>
3502 </table>
3503 <p>(2 rows)<br />
3504 </p>
3505 \pset tableattr foobar
3506 execute q;
3507 <table border="1" foobar>
3508   <tr>
3509     <th align="center">a&amp;title</th>
3510     <th align="center">junk</th>
3511     <th align="center">empty</th>
3512     <th align="center">int</th>
3513   </tr>
3514   <tr valign="top">
3515     <td align="left">some&quot;text</td>
3516     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3517 &lt;bar&gt;</td>
3518     <td align="left">&nbsp; </td>
3519     <td align="right">1</td>
3520   </tr>
3521   <tr valign="top">
3522     <td align="left">some&quot;text</td>
3523     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3524 &lt;bar&gt;</td>
3525     <td align="left">&nbsp; </td>
3526     <td align="right">2</td>
3527   </tr>
3528 </table>
3529 <p>(2 rows)<br />
3530 </p>
3531 \pset tableattr
3532 \pset expanded on
3533 \pset border 0
3534 execute q;
3535 <table border="0">
3537   <tr><td colspan="2" align="center">Record 1</td></tr>
3538   <tr valign="top">
3539     <th>a&amp;title</th>
3540     <td align="left">some&quot;text</td>
3541   </tr>
3542   <tr valign="top">
3543     <th>junk</th>
3544     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3545 &lt;bar&gt;</td>
3546   </tr>
3547   <tr valign="top">
3548     <th>empty</th>
3549     <td align="left">&nbsp; </td>
3550   </tr>
3551   <tr valign="top">
3552     <th>int</th>
3553     <td align="right">1</td>
3554   </tr>
3556   <tr><td colspan="2" align="center">Record 2</td></tr>
3557   <tr valign="top">
3558     <th>a&amp;title</th>
3559     <td align="left">some&quot;text</td>
3560   </tr>
3561   <tr valign="top">
3562     <th>junk</th>
3563     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3564 &lt;bar&gt;</td>
3565   </tr>
3566   <tr valign="top">
3567     <th>empty</th>
3568     <td align="left">&nbsp; </td>
3569   </tr>
3570   <tr valign="top">
3571     <th>int</th>
3572     <td align="right">2</td>
3573   </tr>
3574 </table>
3576 \pset border 1
3577 execute q;
3578 <table border="1">
3580   <tr><td colspan="2" align="center">Record 1</td></tr>
3581   <tr valign="top">
3582     <th>a&amp;title</th>
3583     <td align="left">some&quot;text</td>
3584   </tr>
3585   <tr valign="top">
3586     <th>junk</th>
3587     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3588 &lt;bar&gt;</td>
3589   </tr>
3590   <tr valign="top">
3591     <th>empty</th>
3592     <td align="left">&nbsp; </td>
3593   </tr>
3594   <tr valign="top">
3595     <th>int</th>
3596     <td align="right">1</td>
3597   </tr>
3599   <tr><td colspan="2" align="center">Record 2</td></tr>
3600   <tr valign="top">
3601     <th>a&amp;title</th>
3602     <td align="left">some&quot;text</td>
3603   </tr>
3604   <tr valign="top">
3605     <th>junk</th>
3606     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3607 &lt;bar&gt;</td>
3608   </tr>
3609   <tr valign="top">
3610     <th>empty</th>
3611     <td align="left">&nbsp; </td>
3612   </tr>
3613   <tr valign="top">
3614     <th>int</th>
3615     <td align="right">2</td>
3616   </tr>
3617 </table>
3619 \pset tableattr foobar
3620 execute q;
3621 <table border="1" foobar>
3623   <tr><td colspan="2" align="center">Record 1</td></tr>
3624   <tr valign="top">
3625     <th>a&amp;title</th>
3626     <td align="left">some&quot;text</td>
3627   </tr>
3628   <tr valign="top">
3629     <th>junk</th>
3630     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3631 &lt;bar&gt;</td>
3632   </tr>
3633   <tr valign="top">
3634     <th>empty</th>
3635     <td align="left">&nbsp; </td>
3636   </tr>
3637   <tr valign="top">
3638     <th>int</th>
3639     <td align="right">1</td>
3640   </tr>
3642   <tr><td colspan="2" align="center">Record 2</td></tr>
3643   <tr valign="top">
3644     <th>a&amp;title</th>
3645     <td align="left">some&quot;text</td>
3646   </tr>
3647   <tr valign="top">
3648     <th>junk</th>
3649     <td align="left">&nbsp;&nbsp;&lt;foo&gt;<br />
3650 &lt;bar&gt;</td>
3651   </tr>
3652   <tr valign="top">
3653     <th>empty</th>
3654     <td align="left">&nbsp; </td>
3655   </tr>
3656   <tr valign="top">
3657     <th>int</th>
3658     <td align="right">2</td>
3659   </tr>
3660 </table>
3662 \pset tableattr
3663 deallocate q;
3664 -- test latex output format
3665 \pset format latex
3666 \pset border 1
3667 \pset expanded off
3668 \d psql_serial_tab_id_seq
3669 \begin{center}
3670 Sequence "public.psql\_serial\_tab\_id\_seq"
3671 \end{center}
3673 \begin{tabular}{l | r | r | r | r | l | r}
3674 \textit{Type} & \textit{Start} & \textit{Minimum} & \textit{Maximum} & \textit{Increment} & \textit{Cycles?} & \textit{Cache} \\
3675 \hline
3676 integer & 1 & 1 & 2147483647 & 1 & no & 1 \\
3677 \end{tabular}
3679 \noindent Owned by: public.psql\_serial\_tab.id \\
3681 \pset tuples_only true
3682 \df exp
3683 \begin{tabular}{l | l | l | l | l}
3684 pg\_catalog & exp & double precision & double precision & func \\
3685 pg\_catalog & exp & numeric & numeric & func \\
3686 \end{tabular}
3688 \noindent 
3689 \pset tuples_only false
3690 \pset expanded on
3691 \d psql_serial_tab_id_seq
3692 \begin{center}
3693 Sequence "public.psql\_serial\_tab\_id\_seq"
3694 \end{center}
3696 \begin{tabular}{c|l}
3697 \multicolumn{2}{c}{\textit{Record 1}} \\
3698 \hline
3699 Type & integer \\
3700 Start & 1 \\
3701 Minimum & 1 \\
3702 Maximum & 2147483647 \\
3703 Increment & 1 \\
3704 Cycles? & no \\
3705 Cache & 1 \\
3706 \end{tabular}
3708 \noindent Owned by: public.psql\_serial\_tab.id \\
3710 \pset tuples_only true
3711 \df exp
3712 \begin{tabular}{c|l}
3713 \hline
3714 Schema & pg\_catalog \\
3715 Name & exp \\
3716 Result data type & double precision \\
3717 Argument data types & double precision \\
3718 Type & func \\
3719 \hline
3720 Schema & pg\_catalog \\
3721 Name & exp \\
3722 Result data type & numeric \\
3723 Argument data types & numeric \\
3724 Type & func \\
3725 \end{tabular}
3727 \noindent 
3728 \pset tuples_only false
3729 prepare q as
3730   select 'some\more_text' as "a$title", E'  #<foo>%&^~|\n{bar}' as "junk",
3731          '   ' as "empty", n as int
3732   from generate_series(1,2) as n;
3733 \pset expanded off
3734 \pset border 0
3735 execute q;
3736 \begin{tabular}{lllr}
3737 \textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
3738 \hline
3739 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 1 \\
3740 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 2 \\
3741 \end{tabular}
3743 \noindent (2 rows) \\
3745 \pset border 1
3746 execute q;
3747 \begin{tabular}{l | l | l | r}
3748 \textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
3749 \hline
3750 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 1 \\
3751 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 2 \\
3752 \end{tabular}
3754 \noindent (2 rows) \\
3756 \pset border 2
3757 execute q;
3758 \begin{tabular}{| l | l | l | r |}
3759 \hline
3760 \textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
3761 \hline
3762 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 1 \\
3763 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 2 \\
3764 \hline
3765 \end{tabular}
3767 \noindent (2 rows) \\
3769 \pset border 3
3770 execute q;
3771 \begin{tabular}{| l | l | l | r |}
3772 \hline
3773 \textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
3774 \hline
3775 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 1 \\
3776 \hline
3777 some\textbackslash{}more\_text &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} &     & 2 \\
3778 \hline
3779 \end{tabular}
3781 \noindent (2 rows) \\
3783 \pset expanded on
3784 \pset border 0
3785 execute q;
3786 \begin{tabular}{cl}
3787 \multicolumn{2}{c}{\textit{Record 1}} \\
3788 a\$title & some\textbackslash{}more\_text \\
3789 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3790 empty &     \\
3791 int & 1 \\
3792 \multicolumn{2}{c}{\textit{Record 2}} \\
3793 a\$title & some\textbackslash{}more\_text \\
3794 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3795 empty &     \\
3796 int & 2 \\
3797 \end{tabular}
3799 \noindent 
3800 \pset border 1
3801 execute q;
3802 \begin{tabular}{c|l}
3803 \multicolumn{2}{c}{\textit{Record 1}} \\
3804 \hline
3805 a\$title & some\textbackslash{}more\_text \\
3806 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3807 empty &     \\
3808 int & 1 \\
3809 \multicolumn{2}{c}{\textit{Record 2}} \\
3810 \hline
3811 a\$title & some\textbackslash{}more\_text \\
3812 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3813 empty &     \\
3814 int & 2 \\
3815 \end{tabular}
3817 \noindent 
3818 \pset border 2
3819 execute q;
3820 \begin{tabular}{|c|l|}
3821 \hline
3822 \multicolumn{2}{|c|}{\textit{Record 1}} \\
3823 \hline
3824 a\$title & some\textbackslash{}more\_text \\
3825 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3826 empty &     \\
3827 int & 1 \\
3828 \hline
3829 \multicolumn{2}{|c|}{\textit{Record 2}} \\
3830 \hline
3831 a\$title & some\textbackslash{}more\_text \\
3832 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3833 empty &     \\
3834 int & 2 \\
3835 \hline
3836 \end{tabular}
3838 \noindent 
3839 \pset border 3
3840 execute q;
3841 \begin{tabular}{|c|l|}
3842 \hline
3843 \multicolumn{2}{|c|}{\textit{Record 1}} \\
3844 \hline
3845 a\$title & some\textbackslash{}more\_text \\
3846 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3847 empty &     \\
3848 int & 1 \\
3849 \hline
3850 \multicolumn{2}{|c|}{\textit{Record 2}} \\
3851 \hline
3852 a\$title & some\textbackslash{}more\_text \\
3853 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
3854 empty &     \\
3855 int & 2 \\
3856 \hline
3857 \end{tabular}
3859 \noindent 
3860 deallocate q;
3861 -- test latex-longtable output format
3862 \pset format latex-longtable
3863 \pset border 1
3864 \pset expanded off
3865 \d psql_serial_tab_id_seq
3866 \begin{longtable}{l | r | r | r | r | l | r}
3867 \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}} \\
3868 \midrule
3869 \endfirsthead
3870 \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}} \\
3871 \midrule
3872 \endhead
3873 \caption[Sequence "public.psql\_serial\_tab\_id\_seq" (Continued)]{Sequence "public.psql\_serial\_tab\_id\_seq"}
3874 \endfoot
3875 \caption[Sequence "public.psql\_serial\_tab\_id\_seq"]{Sequence "public.psql\_serial\_tab\_id\_seq"}
3876 \endlastfoot
3877 \raggedright{integer}
3879 \raggedright{1}
3881 \raggedright{1}
3883 \raggedright{2147483647}
3885 \raggedright{1}
3887 \raggedright{no}
3889 \raggedright{1} \tabularnewline
3890 \end{longtable}
3891 \pset tuples_only true
3892 \df exp
3893 \begin{longtable}{l | l | l | l | l}
3894 \raggedright{pg\_catalog}
3896 \raggedright{exp}
3898 \raggedright{double precision}
3900 \raggedright{double precision}
3902 \raggedright{func} \tabularnewline
3903 \raggedright{pg\_catalog}
3905 \raggedright{exp}
3907 \raggedright{numeric}
3909 \raggedright{numeric}
3911 \raggedright{func} \tabularnewline
3912 \end{longtable}
3913 \pset tuples_only false
3914 \pset expanded on
3915 \d psql_serial_tab_id_seq
3916 \begin{center}
3917 Sequence "public.psql\_serial\_tab\_id\_seq"
3918 \end{center}
3920 \begin{tabular}{c|l}
3921 \multicolumn{2}{c}{\textit{Record 1}} \\
3922 \hline
3923 Type & integer \\
3924 Start & 1 \\
3925 Minimum & 1 \\
3926 Maximum & 2147483647 \\
3927 Increment & 1 \\
3928 Cycles? & no \\
3929 Cache & 1 \\
3930 \end{tabular}
3932 \noindent Owned by: public.psql\_serial\_tab.id \\
3934 \pset tuples_only true
3935 \df exp
3936 \begin{tabular}{c|l}
3937 \hline
3938 Schema & pg\_catalog \\
3939 Name & exp \\
3940 Result data type & double precision \\
3941 Argument data types & double precision \\
3942 Type & func \\
3943 \hline
3944 Schema & pg\_catalog \\
3945 Name & exp \\
3946 Result data type & numeric \\
3947 Argument data types & numeric \\
3948 Type & func \\
3949 \end{tabular}
3951 \noindent 
3952 \pset tuples_only false
3953 prepare q as
3954   select 'some\more_text' as "a$title", E'  #<foo>%&^~|\n{bar}' as "junk",
3955          '   ' as "empty", n as int
3956   from generate_series(1,2) as n;
3957 \pset expanded off
3958 \pset border 0
3959 execute q;
3960 \begin{longtable}{lllr}
3961 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3962 \midrule
3963 \endfirsthead
3964 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3965 \midrule
3966 \endhead
3967 \raggedright{some\textbackslash{}more\_text}
3969 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3971 \raggedright{   }
3973 \raggedright{1} \tabularnewline
3974 \raggedright{some\textbackslash{}more\_text}
3976 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3978 \raggedright{   }
3980 \raggedright{2} \tabularnewline
3981 \end{longtable}
3982 \pset border 1
3983 execute q;
3984 \begin{longtable}{l | l | l | r}
3985 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3986 \midrule
3987 \endfirsthead
3988 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
3989 \midrule
3990 \endhead
3991 \raggedright{some\textbackslash{}more\_text}
3993 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
3995 \raggedright{   }
3997 \raggedright{1} \tabularnewline
3998 \raggedright{some\textbackslash{}more\_text}
4000 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
4002 \raggedright{   }
4004 \raggedright{2} \tabularnewline
4005 \end{longtable}
4006 \pset border 2
4007 execute q;
4008 \begin{longtable}{| l | l | l | r |}
4009 \toprule
4010 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
4011 \midrule
4012 \endfirsthead
4013 \toprule
4014 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
4015 \midrule
4016 \endhead
4017 \bottomrule
4018 \endfoot
4019 \bottomrule
4020 \endlastfoot
4021 \raggedright{some\textbackslash{}more\_text}
4023 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
4025 \raggedright{   }
4027 \raggedright{1} \tabularnewline
4028 \raggedright{some\textbackslash{}more\_text}
4030 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
4032 \raggedright{   }
4034 \raggedright{2} \tabularnewline
4035 \end{longtable}
4036 \pset border 3
4037 execute q;
4038 \begin{longtable}{| l | l | l | r |}
4039 \toprule
4040 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
4041 \midrule
4042 \endfirsthead
4043 \toprule
4044 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
4045 \endhead
4046 \bottomrule
4047 \endfoot
4048 \bottomrule
4049 \endlastfoot
4050 \raggedright{some\textbackslash{}more\_text}
4052 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
4054 \raggedright{   }
4056 \raggedright{1} \tabularnewline
4057  \hline
4058 \raggedright{some\textbackslash{}more\_text}
4060 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
4062 \raggedright{   }
4064 \raggedright{2} \tabularnewline
4065  \hline
4066 \end{longtable}
4067 \pset tableattr lr
4068 execute q;
4069 \begin{longtable}{| p{lr\textwidth} | p{lr\textwidth} | p{lr\textwidth} | r |}
4070 \toprule
4071 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
4072 \midrule
4073 \endfirsthead
4074 \toprule
4075 \small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
4076 \endhead
4077 \bottomrule
4078 \endfoot
4079 \bottomrule
4080 \endlastfoot
4081 \raggedright{some\textbackslash{}more\_text}
4083 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
4085 \raggedright{   }
4087 \raggedright{1} \tabularnewline
4088  \hline
4089 \raggedright{some\textbackslash{}more\_text}
4091 \raggedright{  \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\}}
4093 \raggedright{   }
4095 \raggedright{2} \tabularnewline
4096  \hline
4097 \end{longtable}
4098 \pset tableattr
4099 \pset expanded on
4100 \pset border 0
4101 execute q;
4102 \begin{tabular}{cl}
4103 \multicolumn{2}{c}{\textit{Record 1}} \\
4104 a\$title & some\textbackslash{}more\_text \\
4105 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4106 empty &     \\
4107 int & 1 \\
4108 \multicolumn{2}{c}{\textit{Record 2}} \\
4109 a\$title & some\textbackslash{}more\_text \\
4110 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4111 empty &     \\
4112 int & 2 \\
4113 \end{tabular}
4115 \noindent 
4116 \pset border 1
4117 execute q;
4118 \begin{tabular}{c|l}
4119 \multicolumn{2}{c}{\textit{Record 1}} \\
4120 \hline
4121 a\$title & some\textbackslash{}more\_text \\
4122 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4123 empty &     \\
4124 int & 1 \\
4125 \multicolumn{2}{c}{\textit{Record 2}} \\
4126 \hline
4127 a\$title & some\textbackslash{}more\_text \\
4128 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4129 empty &     \\
4130 int & 2 \\
4131 \end{tabular}
4133 \noindent 
4134 \pset border 2
4135 execute q;
4136 \begin{tabular}{|c|l|}
4137 \hline
4138 \multicolumn{2}{|c|}{\textit{Record 1}} \\
4139 \hline
4140 a\$title & some\textbackslash{}more\_text \\
4141 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4142 empty &     \\
4143 int & 1 \\
4144 \hline
4145 \multicolumn{2}{|c|}{\textit{Record 2}} \\
4146 \hline
4147 a\$title & some\textbackslash{}more\_text \\
4148 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4149 empty &     \\
4150 int & 2 \\
4151 \hline
4152 \end{tabular}
4154 \noindent 
4155 \pset border 3
4156 execute q;
4157 \begin{tabular}{|c|l|}
4158 \hline
4159 \multicolumn{2}{|c|}{\textit{Record 1}} \\
4160 \hline
4161 a\$title & some\textbackslash{}more\_text \\
4162 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4163 empty &     \\
4164 int & 1 \\
4165 \hline
4166 \multicolumn{2}{|c|}{\textit{Record 2}} \\
4167 \hline
4168 a\$title & some\textbackslash{}more\_text \\
4169 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4170 empty &     \\
4171 int & 2 \\
4172 \hline
4173 \end{tabular}
4175 \noindent 
4176 \pset tableattr lr
4177 execute q;
4178 \begin{tabular}{|c|l|}
4179 \hline
4180 \multicolumn{2}{|c|}{\textit{Record 1}} \\
4181 \hline
4182 a\$title & some\textbackslash{}more\_text \\
4183 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4184 empty &     \\
4185 int & 1 \\
4186 \hline
4187 \multicolumn{2}{|c|}{\textit{Record 2}} \\
4188 \hline
4189 a\$title & some\textbackslash{}more\_text \\
4190 junk &   \#\textless{}foo\textgreater{}\%\&\^{}\~{}\textbar{}\\\{bar\} \\
4191 empty &     \\
4192 int & 2 \\
4193 \hline
4194 \end{tabular}
4196 \noindent 
4197 \pset tableattr
4198 deallocate q;
4199 -- test troff-ms output format
4200 \pset format troff-ms
4201 \pset border 1
4202 \pset expanded off
4203 \d psql_serial_tab_id_seq
4205 .DS C
4206 Sequence "public.psql_serial_tab_id_seq"
4210 center;
4211 l | r | r | r | r | l | r.
4212 \fIType\fP      \fIStart\fP     \fIMinimum\fP   \fIMaximum\fP   \fIIncrement\fP \fICycles?\fP   \fICache\fP
4214 integer 1       1       2147483647      1       no      1
4216 .DS L
4217 Owned by: public.psql_serial_tab.id
4219 \pset tuples_only true
4220 \df exp
4223 center;
4224 l | l | l | l | l.
4225 pg_catalog      exp     double precision        double precision        func
4226 pg_catalog      exp     numeric numeric func
4228 .DS L
4230 \pset tuples_only false
4231 \pset expanded on
4232 \d psql_serial_tab_id_seq
4234 .DS C
4235 Sequence "public.psql_serial_tab_id_seq"
4239 center;
4240 c s.
4241 \fIRecord 1\fP
4244 c | l.
4245 Type    integer
4246 Start   1
4247 Minimum 1
4248 Maximum 2147483647
4249 Increment       1
4250 Cycles? no
4251 Cache   1
4253 .DS L
4254 Owned by: public.psql_serial_tab.id
4256 \pset tuples_only true
4257 \df exp
4260 center;
4261 c l;
4263 Schema  pg_catalog
4264 Name    exp
4265 Result data type        double precision
4266 Argument data types     double precision
4267 Type    func
4269 Schema  pg_catalog
4270 Name    exp
4271 Result data type        numeric
4272 Argument data types     numeric
4273 Type    func
4275 .DS L
4277 \pset tuples_only false
4278 prepare q as
4279   select 'some\text' as "a\title", E'  <foo>\n<bar>' as "junk",
4280          '   ' as "empty", n as int
4281   from generate_series(1,2) as n;
4282 \pset expanded off
4283 \pset border 0
4284 execute q;
4287 center;
4288 lllr.
4289 \fIa\(rstitle\fP        \fIjunk\fP      \fIempty\fP     \fIint\fP
4291 some\(rstext      <foo>
4292 <bar>           1
4293 some\(rstext      <foo>
4294 <bar>           2
4296 .DS L
4297 (2 rows)
4299 \pset border 1
4300 execute q;
4303 center;
4304 l | l | l | r.
4305 \fIa\(rstitle\fP        \fIjunk\fP      \fIempty\fP     \fIint\fP
4307 some\(rstext      <foo>
4308 <bar>           1
4309 some\(rstext      <foo>
4310 <bar>           2
4312 .DS L
4313 (2 rows)
4315 \pset border 2
4316 execute q;
4319 center box;
4320 l | l | l | r.
4321 \fIa\(rstitle\fP        \fIjunk\fP      \fIempty\fP     \fIint\fP
4323 some\(rstext      <foo>
4324 <bar>           1
4325 some\(rstext      <foo>
4326 <bar>           2
4328 .DS L
4329 (2 rows)
4331 \pset expanded on
4332 \pset border 0
4333 execute q;
4336 center;
4337 c s.
4338 \fIRecord 1\fP
4340 c l.
4341 a\(rstitle      some\(rstext
4342 junk      <foo>
4343 <bar>
4344 empty      
4345 int     1
4347 c s.
4348 \fIRecord 2\fP
4350 c l.
4351 a\(rstitle      some\(rstext
4352 junk      <foo>
4353 <bar>
4354 empty      
4355 int     2
4357 .DS L
4359 \pset border 1
4360 execute q;
4363 center;
4364 c s.
4365 \fIRecord 1\fP
4368 c | l.
4369 a\(rstitle      some\(rstext
4370 junk      <foo>
4371 <bar>
4372 empty      
4373 int     1
4375 c s.
4376 \fIRecord 2\fP
4379 c | l.
4380 a\(rstitle      some\(rstext
4381 junk      <foo>
4382 <bar>
4383 empty      
4384 int     2
4386 .DS L
4388 \pset border 2
4389 execute q;
4392 center box;
4393 c s.
4394 \fIRecord 1\fP
4397 c l.
4398 a\(rstitle      some\(rstext
4399 junk      <foo>
4400 <bar>
4401 empty      
4402 int     1
4405 c s.
4406 \fIRecord 2\fP
4409 c l.
4410 a\(rstitle      some\(rstext
4411 junk      <foo>
4412 <bar>
4413 empty      
4414 int     2
4416 .DS L
4418 deallocate q;
4419 -- check ambiguous format requests
4420 \pset format a
4421 \pset: ambiguous abbreviation "a" matches both "aligned" and "asciidoc"
4422 \pset format l
4423 -- clean up after output format tests
4424 drop table psql_serial_tab;
4425 \pset format aligned
4426 \pset expanded off
4427 \pset border 1
4428 -- \echo and allied features
4429 \echo this is a test
4430 this is a test
4431 \echo -n without newline
4432 without newline\echo with -n newline
4433 with -n newline
4434 \echo '-n' with newline
4435 -n with newline
4436 \set foo bar
4437 \echo foo = :foo
4438 foo = bar
4439 \qecho this is a test
4440 this is a test
4441 \qecho foo = :foo
4442 foo = bar
4443 \warn this is a test
4444 this is a test
4445 \warn foo = :foo
4446 foo = bar
4447 -- tests for \if ... \endif
4448 \if true
4449   select 'okay';
4450  ?column? 
4451 ----------
4452  okay
4453 (1 row)
4455   select 'still okay';
4456   ?column?  
4457 ------------
4458  still okay
4459 (1 row)
4461 \else
4462   not okay;
4463   still not okay
4464 \endif
4465 -- at this point query buffer should still have last valid line
4467   ?column?  
4468 ------------
4469  still okay
4470 (1 row)
4472 -- \if should work okay on part of a query
4473 select
4474   \if true
4475     42
4476   \else
4477     (bogus
4478   \endif
4479   forty_two;
4480  forty_two 
4481 -----------
4482         42
4483 (1 row)
4485 select \if false \\ (bogus \else \\ 42 \endif \\ forty_two;
4486  forty_two 
4487 -----------
4488         42
4489 (1 row)
4491 -- test a large nested if using a variety of true-equivalents
4492 \if true
4493         \if 1
4494                 \if yes
4495                         \if on
4496                                 \echo 'all true'
4497 all true
4498                         \else
4499                                 \echo 'should not print #1-1'
4500                         \endif
4501                 \else
4502                         \echo 'should not print #1-2'
4503                 \endif
4504         \else
4505                 \echo 'should not print #1-3'
4506         \endif
4507 \else
4508         \echo 'should not print #1-4'
4509 \endif
4510 -- test a variety of false-equivalents in an if/elif/else structure
4511 \if false
4512         \echo 'should not print #2-1'
4513 \elif 0
4514         \echo 'should not print #2-2'
4515 \elif no
4516         \echo 'should not print #2-3'
4517 \elif off
4518         \echo 'should not print #2-4'
4519 \else
4520         \echo 'all false'
4521 all false
4522 \endif
4523 -- test true-false elif after initial true branch
4524 \if true
4525         \echo 'should print #2-5'
4526 should print #2-5
4527 \elif true
4528         \echo 'should not print #2-6'
4529 \elif false
4530         \echo 'should not print #2-7'
4531 \else
4532         \echo 'should not print #2-8'
4533 \endif
4534 -- test simple true-then-else
4535 \if true
4536         \echo 'first thing true'
4537 first thing true
4538 \else
4539         \echo 'should not print #3-1'
4540 \endif
4541 -- test simple false-true-else
4542 \if false
4543         \echo 'should not print #4-1'
4544 \elif true
4545         \echo 'second thing true'
4546 second thing true
4547 \else
4548         \echo 'should not print #5-1'
4549 \endif
4550 -- invalid boolean expressions are false
4551 \if invalid boolean expression
4552 unrecognized value "invalid boolean expression" for "\if expression": Boolean expected
4553         \echo 'will not print #6-1'
4554 \else
4555         \echo 'will print anyway #6-2'
4556 will print anyway #6-2
4557 \endif
4558 -- test un-matched endif
4559 \endif
4560 \endif: no matching \if
4561 -- test un-matched else
4562 \else
4563 \else: no matching \if
4564 -- test un-matched elif
4565 \elif
4566 \elif: no matching \if
4567 -- test double-else error
4568 \if true
4569 \else
4570 \else
4571 \else: cannot occur after \else
4572 \endif
4573 -- test elif out-of-order
4574 \if false
4575 \else
4576 \elif
4577 \elif: cannot occur after \else
4578 \endif
4579 -- test if-endif matching in a false branch
4580 \if false
4581     \if false
4582         \echo 'should not print #7-1'
4583     \else
4584         \echo 'should not print #7-2'
4585     \endif
4586     \echo 'should not print #7-3'
4587 \else
4588     \echo 'should print #7-4'
4589 should print #7-4
4590 \endif
4591 -- show that vars and backticks are not expanded when ignoring extra args
4592 \set foo bar
4593 \echo :foo :'foo' :"foo"
4594 bar 'bar' "bar"
4595 \pset fieldsep | `nosuchcommand` :foo :'foo' :"foo"
4596 \pset: extra argument "nosuchcommand" ignored
4597 \pset: extra argument ":foo" ignored
4598 \pset: extra argument ":'foo'" ignored
4599 \pset: extra argument ":"foo"" ignored
4600 -- show that vars and backticks are not expanded and commands are ignored
4601 -- when in a false if-branch
4602 \set try_to_quit '\\q'
4603 \if false
4604         :try_to_quit
4605         \echo `nosuchcommand` :foo :'foo' :"foo"
4606         \pset fieldsep | `nosuchcommand` :foo :'foo' :"foo"
4607         \a
4608         SELECT $1 \bind 1 \g
4609         \bind_named stmt1 1 2 \g
4610         \C arg1
4611         \c arg1 arg2 arg3 arg4
4612         \cd arg1
4613         \close stmt1
4614         \conninfo
4615         \copy arg1 arg2 arg3 arg4 arg5 arg6
4616         \copyright
4617         SELECT 1 as one, 2, 3 \crosstabview
4618         \dt arg1
4619         \e arg1 arg2
4620         \ef whole_line
4621         \ev whole_line
4622         \echo arg1 arg2 arg3 arg4 arg5
4623         \echo arg1
4624         \encoding arg1
4625         \errverbose
4626         \f arg1
4627         \g arg1
4628         \gx arg1
4629         \gexec
4630         SELECT 1 AS one \gset
4631         \h
4632         \?
4633         \html
4634         \i arg1
4635         \ir arg1
4636         \l arg1
4637         \lo arg1 arg2
4638 invalid command \lo
4639         \lo_list
4640         \o arg1
4641         \p
4642         SELECT 1 \parse
4643         \password arg1
4644         \prompt arg1 arg2
4645         \pset arg1 arg2
4646         \q
4647         \reset
4648         \s arg1
4649         \set arg1 arg2 arg3 arg4 arg5 arg6 arg7
4650         \setenv arg1 arg2
4651         \sf whole_line
4652         \sv whole_line
4653         \t arg1
4654         \T arg1
4655         \timing arg1
4656         \unset arg1
4657         \w arg1
4658         \watch arg1 arg2
4659         \x arg1
4660         -- \else here is eaten as part of OT_FILEPIPE argument
4661         \w |/no/such/file \else
4662         -- \endif here is eaten as part of whole-line argument
4663         \! whole_line \endif
4664         \z
4665 \else
4666         \echo 'should print #8-1'
4667 should print #8-1
4668 \endif
4669 -- :{?...} defined variable test
4670 \set i 1
4671 \if :{?i}
4672   \echo '#9-1 ok, variable i is defined'
4673 #9-1 ok, variable i is defined
4674 \else
4675   \echo 'should not print #9-2'
4676 \endif
4677 \if :{?no_such_variable}
4678   \echo 'should not print #10-1'
4679 \else
4680   \echo '#10-2 ok, variable no_such_variable is not defined'
4681 #10-2 ok, variable no_such_variable is not defined
4682 \endif
4683 SELECT :{?i} AS i_is_defined;
4684  i_is_defined 
4685 --------------
4687 (1 row)
4689 SELECT NOT :{?no_such_var} AS no_such_var_is_not_defined;
4690  no_such_var_is_not_defined 
4691 ----------------------------
4693 (1 row)
4695 -- SHOW_CONTEXT
4696 \set SHOW_CONTEXT never
4697 do $$
4698 begin
4699   raise notice 'foo';
4700   raise exception 'bar';
4701 end $$;
4702 NOTICE:  foo
4703 ERROR:  bar
4704 \set SHOW_CONTEXT errors
4705 do $$
4706 begin
4707   raise notice 'foo';
4708   raise exception 'bar';
4709 end $$;
4710 NOTICE:  foo
4711 ERROR:  bar
4712 CONTEXT:  PL/pgSQL function inline_code_block line 4 at RAISE
4713 \set SHOW_CONTEXT always
4714 do $$
4715 begin
4716   raise notice 'foo';
4717   raise exception 'bar';
4718 end $$;
4719 NOTICE:  foo
4720 CONTEXT:  PL/pgSQL function inline_code_block line 3 at RAISE
4721 ERROR:  bar
4722 CONTEXT:  PL/pgSQL function inline_code_block line 4 at RAISE
4723 -- test printing and clearing the query buffer
4724 SELECT 1;
4725  ?column? 
4726 ----------
4727         1
4728 (1 row)
4731 SELECT 1;
4732 SELECT 2 \r
4734 SELECT 1;
4735 SELECT 3 \p
4736 SELECT 3 
4737 UNION SELECT 4 \p
4738 SELECT 3 
4739 UNION SELECT 4 
4740 UNION SELECT 5
4741 ORDER BY 1;
4742  ?column? 
4743 ----------
4744         3
4745         4
4746         5
4747 (3 rows)
4751 SELECT 3 
4752 UNION SELECT 4 
4753 UNION SELECT 5
4754 ORDER BY 1;
4755 -- tests for special result variables
4756 -- working query, 2 rows selected
4757 SELECT 1 AS stuff UNION SELECT 2;
4758  stuff 
4759 -------
4760      1
4761      2
4762 (2 rows)
4764 \echo 'error:' :ERROR
4765 error: false
4766 \echo 'error code:' :SQLSTATE
4767 error code: 00000
4768 \echo 'number of rows:' :ROW_COUNT
4769 number of rows: 2
4770 -- syntax error
4771 SELECT 1 UNION;
4772 ERROR:  syntax error at or near ";"
4773 LINE 1: SELECT 1 UNION;
4774                       ^
4775 \echo 'error:' :ERROR
4776 error: true
4777 \echo 'error code:' :SQLSTATE
4778 error code: 42601
4779 \echo 'number of rows:' :ROW_COUNT
4780 number of rows: 0
4781 \echo 'last error message:' :LAST_ERROR_MESSAGE
4782 last error message: syntax error at or near ";"
4783 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4784 last error code: 42601
4785 -- empty query
4787 \echo 'error:' :ERROR
4788 error: false
4789 \echo 'error code:' :SQLSTATE
4790 error code: 00000
4791 \echo 'number of rows:' :ROW_COUNT
4792 number of rows: 0
4793 -- must have kept previous values
4794 \echo 'last error message:' :LAST_ERROR_MESSAGE
4795 last error message: syntax error at or near ";"
4796 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4797 last error code: 42601
4798 -- other query error
4799 DROP TABLE this_table_does_not_exist;
4800 ERROR:  table "this_table_does_not_exist" does not exist
4801 \echo 'error:' :ERROR
4802 error: true
4803 \echo 'error code:' :SQLSTATE
4804 error code: 42P01
4805 \echo 'number of rows:' :ROW_COUNT
4806 number of rows: 0
4807 \echo 'last error message:' :LAST_ERROR_MESSAGE
4808 last error message: table "this_table_does_not_exist" does not exist
4809 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4810 last error code: 42P01
4811 -- nondefault verbosity error settings (except verbose, which is too unstable)
4812 \set VERBOSITY terse
4813 SELECT 1 UNION;
4814 ERROR:  syntax error at or near ";" at character 15
4815 \echo 'error:' :ERROR
4816 error: true
4817 \echo 'error code:' :SQLSTATE
4818 error code: 42601
4819 \echo 'last error message:' :LAST_ERROR_MESSAGE
4820 last error message: syntax error at or near ";"
4821 \set VERBOSITY sqlstate
4822 SELECT 1/0;
4823 ERROR:  22012
4824 \echo 'error:' :ERROR
4825 error: true
4826 \echo 'error code:' :SQLSTATE
4827 error code: 22012
4828 \echo 'last error message:' :LAST_ERROR_MESSAGE
4829 last error message: division by zero
4830 \set VERBOSITY default
4831 -- working \gdesc
4832 SELECT 3 AS three, 4 AS four \gdesc
4833  Column |  Type   
4834 --------+---------
4835  three  | integer
4836  four   | integer
4837 (2 rows)
4839 \echo 'error:' :ERROR
4840 error: false
4841 \echo 'error code:' :SQLSTATE
4842 error code: 00000
4843 \echo 'number of rows:' :ROW_COUNT
4844 number of rows: 2
4845 -- \gdesc with an error
4846 SELECT 4 AS \gdesc
4847 ERROR:  syntax error at end of input
4848 LINE 1: SELECT 4 AS 
4849                     ^
4850 \echo 'error:' :ERROR
4851 error: true
4852 \echo 'error code:' :SQLSTATE
4853 error code: 42601
4854 \echo 'number of rows:' :ROW_COUNT
4855 number of rows: 0
4856 \echo 'last error message:' :LAST_ERROR_MESSAGE
4857 last error message: syntax error at end of input
4858 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4859 last error code: 42601
4860 -- check row count for a query with chunked results
4861 \set FETCH_COUNT 10
4862 select unique2 from tenk1 order by unique2 limit 19;
4863  unique2 
4864 ---------
4865        0
4866        1
4867        2
4868        3
4869        4
4870        5
4871        6
4872        7
4873        8
4874        9
4875       10
4876       11
4877       12
4878       13
4879       14
4880       15
4881       16
4882       17
4883       18
4884 (19 rows)
4886 \echo 'error:' :ERROR
4887 error: false
4888 \echo 'error code:' :SQLSTATE
4889 error code: 00000
4890 \echo 'number of rows:' :ROW_COUNT
4891 number of rows: 19
4892 -- chunked results with an error after the first chunk
4893 -- (we must disable parallel query here, else the behavior is timing-dependent)
4894 set debug_parallel_query = off;
4895 select 1/(15-unique2) from tenk1 order by unique2 limit 19;
4896  ?column? 
4897 ----------
4898         0
4899         0
4900         0
4901         0
4902         0
4903         0
4904         0
4905         0
4906         0
4907         0
4908 ERROR:  division by zero
4909 \echo 'error:' :ERROR
4910 error: true
4911 \echo 'error code:' :SQLSTATE
4912 error code: 22012
4913 \echo 'number of rows:' :ROW_COUNT
4914 number of rows: 0
4915 \echo 'last error message:' :LAST_ERROR_MESSAGE
4916 last error message: division by zero
4917 \echo 'last error code:' :LAST_ERROR_SQLSTATE
4918 last error code: 22012
4919 reset debug_parallel_query;
4920 \unset FETCH_COUNT
4921 create schema testpart;
4922 create role regress_partitioning_role;
4923 alter schema testpart owner to regress_partitioning_role;
4924 set role to regress_partitioning_role;
4925 -- run test inside own schema and hide other partitions
4926 set search_path to testpart;
4927 create table testtable_apple(logdate date);
4928 create table testtable_orange(logdate date);
4929 create index testtable_apple_index on testtable_apple(logdate);
4930 create index testtable_orange_index on testtable_orange(logdate);
4931 create table testpart_apple(logdate date) partition by range(logdate);
4932 create table testpart_orange(logdate date) partition by range(logdate);
4933 create index testpart_apple_index on testpart_apple(logdate);
4934 create index testpart_orange_index on testpart_orange(logdate);
4935 -- only partition related object should be displayed
4936 \dP test*apple*
4937                                          List of partitioned relations
4938   Schema  |         Name         |           Owner           |       Type        | Parent name |     Table      
4939 ----------+----------------------+---------------------------+-------------------+-------------+----------------
4940  testpart | testpart_apple       | regress_partitioning_role | partitioned table |             | 
4941  testpart | testpart_apple_index | regress_partitioning_role | partitioned index |             | testpart_apple
4942 (2 rows)
4944 \dPt test*apple*
4945                      List of partitioned tables
4946   Schema  |      Name      |           Owner           | Parent name 
4947 ----------+----------------+---------------------------+-------------
4948  testpart | testpart_apple | regress_partitioning_role | 
4949 (1 row)
4951 \dPi test*apple*
4952                                 List of partitioned indexes
4953   Schema  |         Name         |           Owner           | Parent name |     Table      
4954 ----------+----------------------+---------------------------+-------------+----------------
4955  testpart | testpart_apple_index | regress_partitioning_role |             | testpart_apple
4956 (1 row)
4958 drop table testtable_apple;
4959 drop table testtable_orange;
4960 drop table testpart_apple;
4961 drop table testpart_orange;
4962 create table parent_tab (id int) partition by range (id);
4963 create index parent_index on parent_tab (id);
4964 create table child_0_10 partition of parent_tab
4965   for values from (0) to (10);
4966 create table child_10_20 partition of parent_tab
4967   for values from (10) to (20);
4968 create table child_20_30 partition of parent_tab
4969   for values from (20) to (30);
4970 insert into parent_tab values (generate_series(0,29));
4971 create table child_30_40 partition of parent_tab
4972 for values from (30) to (40)
4973   partition by range(id);
4974 create table child_30_35 partition of child_30_40
4975   for values from (30) to (35);
4976 create table child_35_40 partition of child_30_40
4977    for values from (35) to (40);
4978 insert into parent_tab values (generate_series(30,39));
4979 \dPt
4980             List of partitioned tables
4981   Schema  |    Name    |           Owner           
4982 ----------+------------+---------------------------
4983  testpart | parent_tab | regress_partitioning_role
4984 (1 row)
4986 \dPi
4987                    List of partitioned indexes
4988   Schema  |     Name     |           Owner           |   Table    
4989 ----------+--------------+---------------------------+------------
4990  testpart | parent_index | regress_partitioning_role | parent_tab
4991 (1 row)
4993 \dP testpart.*
4994                                        List of partitioned relations
4995   Schema  |        Name        |           Owner           |       Type        | Parent name  |    Table    
4996 ----------+--------------------+---------------------------+-------------------+--------------+-------------
4997  testpart | parent_tab         | regress_partitioning_role | partitioned table |              | 
4998  testpart | child_30_40        | regress_partitioning_role | partitioned table | parent_tab   | 
4999  testpart | parent_index       | regress_partitioning_role | partitioned index |              | parent_tab
5000  testpart | child_30_40_id_idx | regress_partitioning_role | partitioned index | parent_index | child_30_40
5001 (4 rows)
5004                             List of partitioned relations
5005   Schema  |     Name     |           Owner           |       Type        |   Table    
5006 ----------+--------------+---------------------------+-------------------+------------
5007  testpart | parent_tab   | regress_partitioning_role | partitioned table | 
5008  testpart | parent_index | regress_partitioning_role | partitioned index | parent_tab
5009 (2 rows)
5011 \dPtn
5012                     List of partitioned tables
5013   Schema  |    Name     |           Owner           | Parent name 
5014 ----------+-------------+---------------------------+-------------
5015  testpart | parent_tab  | regress_partitioning_role | 
5016  testpart | child_30_40 | regress_partitioning_role | parent_tab
5017 (2 rows)
5019 \dPin
5020                               List of partitioned indexes
5021   Schema  |        Name        |           Owner           | Parent name  |    Table    
5022 ----------+--------------------+---------------------------+--------------+-------------
5023  testpart | parent_index       | regress_partitioning_role |              | parent_tab
5024  testpart | child_30_40_id_idx | regress_partitioning_role | parent_index | child_30_40
5025 (2 rows)
5027 \dPn
5028                                        List of partitioned relations
5029   Schema  |        Name        |           Owner           |       Type        | Parent name  |    Table    
5030 ----------+--------------------+---------------------------+-------------------+--------------+-------------
5031  testpart | parent_tab         | regress_partitioning_role | partitioned table |              | 
5032  testpart | child_30_40        | regress_partitioning_role | partitioned table | parent_tab   | 
5033  testpart | parent_index       | regress_partitioning_role | partitioned index |              | parent_tab
5034  testpart | child_30_40_id_idx | regress_partitioning_role | partitioned index | parent_index | child_30_40
5035 (4 rows)
5037 \dPn testpart.*
5038                                        List of partitioned relations
5039   Schema  |        Name        |           Owner           |       Type        | Parent name  |    Table    
5040 ----------+--------------------+---------------------------+-------------------+--------------+-------------
5041  testpart | parent_tab         | regress_partitioning_role | partitioned table |              | 
5042  testpart | child_30_40        | regress_partitioning_role | partitioned table | parent_tab   | 
5043  testpart | parent_index       | regress_partitioning_role | partitioned index |              | parent_tab
5044  testpart | child_30_40_id_idx | regress_partitioning_role | partitioned index | parent_index | child_30_40
5045 (4 rows)
5047 drop table parent_tab cascade;
5048 drop schema testpart;
5049 set search_path to default;
5050 set role to default;
5051 drop role regress_partitioning_role;
5052 -- \d on toast table (use pg_statistic's toast table, which has a known name)
5053 \d pg_toast.pg_toast_2619
5054 TOAST table "pg_toast.pg_toast_2619"
5055    Column   |  Type   
5056 ------------+---------
5057  chunk_id   | oid
5058  chunk_seq  | integer
5059  chunk_data | bytea
5060 Owning table: "pg_catalog.pg_statistic"
5061 Indexes:
5062     "pg_toast_2619_index" PRIMARY KEY, btree (chunk_id, chunk_seq)
5064 -- check printing info about access methods
5066 List of access methods
5067   Name  | Type  
5068 --------+-------
5069  brin   | Index
5070  btree  | Index
5071  gin    | Index
5072  gist   | Index
5073  hash   | Index
5074  heap   | Table
5075  heap2  | Table
5076  spgist | Index
5077 (8 rows)
5079 \dA *
5080 List of access methods
5081   Name  | Type  
5082 --------+-------
5083  brin   | Index
5084  btree  | Index
5085  gin    | Index
5086  gist   | Index
5087  hash   | Index
5088  heap   | Table
5089  heap2  | Table
5090  spgist | Index
5091 (8 rows)
5093 \dA h*
5094 List of access methods
5095  Name  | Type  
5096 -------+-------
5097  hash  | Index
5098  heap  | Table
5099  heap2 | Table
5100 (3 rows)
5102 \dA foo
5103 List of access methods
5104  Name | Type 
5105 ------+------
5106 (0 rows)
5108 \dA foo bar
5109 List of access methods
5110  Name | Type 
5111 ------+------
5112 (0 rows)
5114 \dA: extra argument "bar" ignored
5115 \dA+
5116                              List of access methods
5117   Name  | Type  |       Handler        |              Description               
5118 --------+-------+----------------------+----------------------------------------
5119  brin   | Index | brinhandler          | block range index (BRIN) access method
5120  btree  | Index | bthandler            | b-tree index access method
5121  gin    | Index | ginhandler           | GIN index access method
5122  gist   | Index | gisthandler          | GiST index access method
5123  hash   | Index | hashhandler          | hash index access method
5124  heap   | Table | heap_tableam_handler | heap table access method
5125  heap2  | Table | heap_tableam_handler | 
5126  spgist | Index | spghandler           | SP-GiST index access method
5127 (8 rows)
5129 \dA+ *
5130                              List of access methods
5131   Name  | Type  |       Handler        |              Description               
5132 --------+-------+----------------------+----------------------------------------
5133  brin   | Index | brinhandler          | block range index (BRIN) access method
5134  btree  | Index | bthandler            | b-tree index access method
5135  gin    | Index | ginhandler           | GIN index access method
5136  gist   | Index | gisthandler          | GiST index access method
5137  hash   | Index | hashhandler          | hash index access method
5138  heap   | Table | heap_tableam_handler | heap table access method
5139  heap2  | Table | heap_tableam_handler | 
5140  spgist | Index | spghandler           | SP-GiST index access method
5141 (8 rows)
5143 \dA+ h*
5144                      List of access methods
5145  Name  | Type  |       Handler        |       Description        
5146 -------+-------+----------------------+--------------------------
5147  hash  | Index | hashhandler          | hash index access method
5148  heap  | Table | heap_tableam_handler | heap table access method
5149  heap2 | Table | heap_tableam_handler | 
5150 (3 rows)
5152 \dA+ foo
5153        List of access methods
5154  Name | Type | Handler | Description 
5155 ------+------+---------+-------------
5156 (0 rows)
5158 \dAc brin pg*.oid*
5159                       List of operator classes
5160   AM  | Input type | Storage type |    Operator class    | Default? 
5161 ------+------------+--------------+----------------------+----------
5162  brin | oid        |              | oid_bloom_ops        | no
5163  brin | oid        |              | oid_minmax_multi_ops | no
5164  brin | oid        |              | oid_minmax_ops       | yes
5165 (3 rows)
5167 \dAf spgist
5168           List of operator families
5169    AM   | Operator family | Applicable types 
5170 --------+-----------------+------------------
5171  spgist | box_ops         | box
5172  spgist | kd_point_ops    | point
5173  spgist | network_ops     | inet
5174  spgist | poly_ops        | polygon
5175  spgist | quad_point_ops  | point
5176  spgist | range_ops       | anyrange
5177  spgist | text_ops        | text
5178 (7 rows)
5180 \dAf btree int4
5181               List of operator families
5182   AM   | Operator family |     Applicable types      
5183 -------+-----------------+---------------------------
5184  btree | integer_ops     | smallint, integer, bigint
5185 (1 row)
5187 \dAo+ btree float_ops
5188                                 List of operators of operator families
5189   AM   | Operator family |               Operator                | Strategy | Purpose | Sort opfamily 
5190 -------+-----------------+---------------------------------------+----------+---------+---------------
5191  btree | float_ops       | <(double precision,double precision)  |        1 | search  | 
5192  btree | float_ops       | <=(double precision,double precision) |        2 | search  | 
5193  btree | float_ops       | =(double precision,double precision)  |        3 | search  | 
5194  btree | float_ops       | >=(double precision,double precision) |        4 | search  | 
5195  btree | float_ops       | >(double precision,double precision)  |        5 | search  | 
5196  btree | float_ops       | <(real,real)                          |        1 | search  | 
5197  btree | float_ops       | <=(real,real)                         |        2 | search  | 
5198  btree | float_ops       | =(real,real)                          |        3 | search  | 
5199  btree | float_ops       | >=(real,real)                         |        4 | search  | 
5200  btree | float_ops       | >(real,real)                          |        5 | search  | 
5201  btree | float_ops       | <(double precision,real)              |        1 | search  | 
5202  btree | float_ops       | <=(double precision,real)             |        2 | search  | 
5203  btree | float_ops       | =(double precision,real)              |        3 | search  | 
5204  btree | float_ops       | >=(double precision,real)             |        4 | search  | 
5205  btree | float_ops       | >(double precision,real)              |        5 | search  | 
5206  btree | float_ops       | <(real,double precision)              |        1 | search  | 
5207  btree | float_ops       | <=(real,double precision)             |        2 | search  | 
5208  btree | float_ops       | =(real,double precision)              |        3 | search  | 
5209  btree | float_ops       | >=(real,double precision)             |        4 | search  | 
5210  btree | float_ops       | >(real,double precision)              |        5 | search  | 
5211 (20 rows)
5213 \dAo * pg_catalog.jsonb_path_ops
5214              List of operators of operator families
5215  AM  | Operator family |      Operator      | Strategy | Purpose 
5216 -----+-----------------+--------------------+----------+---------
5217  gin | jsonb_path_ops  | @>(jsonb,jsonb)    |        7 | search
5218  gin | jsonb_path_ops  | @?(jsonb,jsonpath) |       15 | search
5219  gin | jsonb_path_ops  | @@(jsonb,jsonpath) |       16 | search
5220 (3 rows)
5222 \dAp+ btree float_ops
5223                                                          List of support functions of operator families
5224   AM   | Operator family | Registered left type | Registered right type | Number |                                   Function                                   
5225 -------+-----------------+----------------------+-----------------------+--------+------------------------------------------------------------------------------
5226  btree | float_ops       | double precision     | double precision      |      1 | btfloat8cmp(double precision,double precision)
5227  btree | float_ops       | double precision     | double precision      |      2 | btfloat8sortsupport(internal)
5228  btree | float_ops       | double precision     | double precision      |      3 | in_range(double precision,double precision,double precision,boolean,boolean)
5229  btree | float_ops       | real                 | real                  |      1 | btfloat4cmp(real,real)
5230  btree | float_ops       | real                 | real                  |      2 | btfloat4sortsupport(internal)
5231  btree | float_ops       | double precision     | real                  |      1 | btfloat84cmp(double precision,real)
5232  btree | float_ops       | real                 | double precision      |      1 | btfloat48cmp(real,double precision)
5233  btree | float_ops       | real                 | double precision      |      3 | in_range(real,real,double precision,boolean,boolean)
5234 (8 rows)
5236 \dAp * pg_catalog.uuid_ops
5237                             List of support functions of operator families
5238   AM   | Operator family | Registered left type | Registered right type | Number |      Function      
5239 -------+-----------------+----------------------+-----------------------+--------+--------------------
5240  btree | uuid_ops        | uuid                 | uuid                  |      1 | uuid_cmp
5241  btree | uuid_ops        | uuid                 | uuid                  |      2 | uuid_sortsupport
5242  btree | uuid_ops        | uuid                 | uuid                  |      4 | btequalimage
5243  hash  | uuid_ops        | uuid                 | uuid                  |      1 | uuid_hash
5244  hash  | uuid_ops        | uuid                 | uuid                  |      2 | uuid_hash_extended
5245 (5 rows)
5247 -- check \dconfig
5248 set work_mem = 10240;
5249 \dconfig work_mem
5250 List of configuration parameters
5251  Parameter | Value 
5252 -----------+-------
5253  work_mem  | 10MB
5254 (1 row)
5256 \dconfig+ work*
5257              List of configuration parameters
5258  Parameter | Value |  Type   | Context | Access privileges 
5259 -----------+-------+---------+---------+-------------------
5260  work_mem  | 10MB  | integer | user    | 
5261 (1 row)
5263 reset work_mem;
5264 -- check \df, \do with argument specifications
5265 \df *sqrt
5266                              List of functions
5267    Schema   |     Name     | Result data type | Argument data types | Type 
5268 ------------+--------------+------------------+---------------------+------
5269  pg_catalog | dsqrt        | double precision | double precision    | func
5270  pg_catalog | numeric_sqrt | numeric          | numeric             | func
5271  pg_catalog | sqrt         | double precision | double precision    | func
5272  pg_catalog | sqrt         | numeric          | numeric             | func
5273 (4 rows)
5275 \df *sqrt num*
5276                              List of functions
5277    Schema   |     Name     | Result data type | Argument data types | Type 
5278 ------------+--------------+------------------+---------------------+------
5279  pg_catalog | numeric_sqrt | numeric          | numeric             | func
5280  pg_catalog | sqrt         | numeric          | numeric             | func
5281 (2 rows)
5283 \df int*pl
5284                             List of functions
5285    Schema   |    Name     | Result data type | Argument data types | Type 
5286 ------------+-------------+------------------+---------------------+------
5287  pg_catalog | int24pl     | integer          | smallint, integer   | func
5288  pg_catalog | int28pl     | bigint           | smallint, bigint    | func
5289  pg_catalog | int2pl      | smallint         | smallint, smallint  | func
5290  pg_catalog | int42pl     | integer          | integer, smallint   | func
5291  pg_catalog | int48pl     | bigint           | integer, bigint     | func
5292  pg_catalog | int4pl      | integer          | integer, integer    | func
5293  pg_catalog | int82pl     | bigint           | bigint, smallint    | func
5294  pg_catalog | int84pl     | bigint           | bigint, integer     | func
5295  pg_catalog | int8pl      | bigint           | bigint, bigint      | func
5296  pg_catalog | interval_pl | interval         | interval, interval  | func
5297 (10 rows)
5299 \df int*pl int4
5300                           List of functions
5301    Schema   |  Name   | Result data type | Argument data types | Type 
5302 ------------+---------+------------------+---------------------+------
5303  pg_catalog | int42pl | integer          | integer, smallint   | func
5304  pg_catalog | int48pl | bigint           | integer, bigint     | func
5305  pg_catalog | int4pl  | integer          | integer, integer    | func
5306 (3 rows)
5308 \df int*pl * pg_catalog.int8
5309                           List of functions
5310    Schema   |  Name   | Result data type | Argument data types | Type 
5311 ------------+---------+------------------+---------------------+------
5312  pg_catalog | int28pl | bigint           | smallint, bigint    | func
5313  pg_catalog | int48pl | bigint           | integer, bigint     | func
5314  pg_catalog | int8pl  | bigint           | bigint, bigint      | func
5315 (3 rows)
5317 \df acl* aclitem[]
5318                                                                     List of functions
5319    Schema   |    Name     | Result data type |                                        Argument data types                                         | Type 
5320 ------------+-------------+------------------+----------------------------------------------------------------------------------------------------+------
5321  pg_catalog | aclcontains | boolean          | aclitem[], aclitem                                                                                 | func
5322  pg_catalog | aclexplode  | SETOF record     | acl aclitem[], OUT grantor oid, OUT grantee oid, OUT privilege_type text, OUT is_grantable boolean | func
5323  pg_catalog | aclinsert   | aclitem[]        | aclitem[], aclitem                                                                                 | func
5324  pg_catalog | aclremove   | aclitem[]        | aclitem[], aclitem                                                                                 | func
5325 (4 rows)
5327 \df has_database_privilege oid text
5328                                   List of functions
5329    Schema   |          Name          | Result data type | Argument data types | Type 
5330 ------------+------------------------+------------------+---------------------+------
5331  pg_catalog | has_database_privilege | boolean          | oid, text           | func
5332  pg_catalog | has_database_privilege | boolean          | oid, text, text     | func
5333 (2 rows)
5335 \df has_database_privilege oid text -
5336                                   List of functions
5337    Schema   |          Name          | Result data type | Argument data types | Type 
5338 ------------+------------------------+------------------+---------------------+------
5339  pg_catalog | has_database_privilege | boolean          | oid, text           | func
5340 (1 row)
5342 \dfa bit* small*
5343                           List of functions
5344    Schema   |  Name   | Result data type | Argument data types | Type 
5345 ------------+---------+------------------+---------------------+------
5346  pg_catalog | bit_and | smallint         | smallint            | agg
5347  pg_catalog | bit_or  | smallint         | smallint            | agg
5348  pg_catalog | bit_xor | smallint         | smallint            | agg
5349 (3 rows)
5351 \df *._pg_expandarray
5352                                              List of functions
5353        Schema       |      Name       | Result data type |            Argument data types            | Type 
5354 --------------------+-----------------+------------------+-------------------------------------------+------
5355  information_schema | _pg_expandarray | SETOF record     | anyarray, OUT x anyelement, OUT n integer | func
5356 (1 row)
5358 \do - pg_catalog.int4
5359                                List of operators
5360    Schema   | Name | Left arg type | Right arg type | Result type | Description 
5361 ------------+------+---------------+----------------+-------------+-------------
5362  pg_catalog | -    |               | integer        | integer     | negate
5363 (1 row)
5365 \do && anyarray *
5366                                List of operators
5367    Schema   | Name | Left arg type | Right arg type | Result type | Description 
5368 ------------+------+---------------+----------------+-------------+-------------
5369  pg_catalog | &&   | anyarray      | anyarray       | boolean     | overlaps
5370 (1 row)
5372 -- check \df+
5373 -- we have to use functions with a predictable owner name, so make a role
5374 create role regress_psql_user superuser;
5375 begin;
5376 set session authorization regress_psql_user;
5377 create function psql_df_internal (float8)
5378   returns float8
5379   language internal immutable parallel safe strict
5380   as 'dsin';
5381 create function psql_df_sql (x integer)
5382   returns integer
5383   security definer
5384   begin atomic select x + 1; end;
5385 create function psql_df_plpgsql ()
5386   returns void
5387   language plpgsql
5388   as $$ begin return; end; $$;
5389 comment on function psql_df_plpgsql () is 'some comment';
5390 \df+ psql_df_*
5391                                                                                        List of functions
5392  Schema |       Name       | Result data type | Argument data types | Type | Volatility | Parallel |       Owner       | Security | Access privileges | Language | Internal name | Description  
5393 --------+------------------+------------------+---------------------+------+------------+----------+-------------------+----------+-------------------+----------+---------------+--------------
5394  public | psql_df_internal | double precision | double precision    | func | immutable  | safe     | regress_psql_user | invoker  |                   | internal | dsin          | 
5395  public | psql_df_plpgsql  | void             |                     | func | volatile   | unsafe   | regress_psql_user | invoker  |                   | plpgsql  |               | some comment
5396  public | psql_df_sql      | integer          | x integer           | func | volatile   | unsafe   | regress_psql_user | definer  |                   | sql      |               | 
5397 (3 rows)
5399 rollback;
5400 drop role regress_psql_user;
5401 -- check \sf
5402 \sf information_schema._pg_index_position
5403 CREATE OR REPLACE FUNCTION information_schema._pg_index_position(oid, smallint)
5404  RETURNS integer
5405  LANGUAGE sql
5406  STABLE STRICT
5407 BEGIN ATOMIC
5408  SELECT (ss.a).n AS n
5409     FROM ( SELECT information_schema._pg_expandarray(pg_index.indkey) AS a
5410             FROM pg_index
5411            WHERE (pg_index.indexrelid = $1)) ss
5412    WHERE ((ss.a).x = $2);
5414 \sf+ information_schema._pg_index_position
5415         CREATE OR REPLACE FUNCTION information_schema._pg_index_position(oid, smallint)
5416          RETURNS integer
5417          LANGUAGE sql
5418          STABLE STRICT
5419 1       BEGIN ATOMIC
5420 2        SELECT (ss.a).n AS n
5421 3           FROM ( SELECT information_schema._pg_expandarray(pg_index.indkey) AS a
5422 4                   FROM pg_index
5423 5                  WHERE (pg_index.indexrelid = $1)) ss
5424 6          WHERE ((ss.a).x = $2);
5425 7       END
5426 \sf+ interval_pl_time
5427         CREATE OR REPLACE FUNCTION pg_catalog.interval_pl_time(interval, time without time zone)
5428          RETURNS time without time zone
5429          LANGUAGE sql
5430          IMMUTABLE PARALLEL SAFE STRICT COST 1
5431 1       RETURN ($2 + $1)
5432 \sf ts_debug(text);
5433 CREATE OR REPLACE FUNCTION pg_catalog.ts_debug(document text, OUT alias text, OUT description text, OUT token text, OUT dictionaries regdictionary[], OUT dictionary regdictionary, OUT lexemes text[])
5434  RETURNS SETOF record
5435  LANGUAGE sql
5436  STABLE PARALLEL SAFE STRICT
5437 BEGIN ATOMIC
5438  SELECT ts_debug.alias,
5439      ts_debug.description,
5440      ts_debug.token,
5441      ts_debug.dictionaries,
5442      ts_debug.dictionary,
5443      ts_debug.lexemes
5444     FROM ts_debug(get_current_ts_config(), ts_debug.document) ts_debug(alias, description, token, dictionaries, dictionary, lexemes);
5446 \sf+ ts_debug(text)
5447         CREATE OR REPLACE FUNCTION pg_catalog.ts_debug(document text, OUT alias text, OUT description text, OUT token text, OUT dictionaries regdictionary[], OUT dictionary regdictionary, OUT lexemes text[])
5448          RETURNS SETOF record
5449          LANGUAGE sql
5450          STABLE PARALLEL SAFE STRICT
5451 1       BEGIN ATOMIC
5452 2        SELECT ts_debug.alias,
5453 3            ts_debug.description,
5454 4            ts_debug.token,
5455 5            ts_debug.dictionaries,
5456 6            ts_debug.dictionary,
5457 7            ts_debug.lexemes
5458 8           FROM ts_debug(get_current_ts_config(), ts_debug.document) ts_debug(alias, description, token, dictionaries, dictionary, lexemes);
5459 9       END
5460 -- AUTOCOMMIT
5461 CREATE TABLE ac_test (a int);
5462 \set AUTOCOMMIT off
5463 INSERT INTO ac_test VALUES (1);
5464 COMMIT;
5465 SELECT * FROM ac_test;
5466  a 
5469 (1 row)
5471 COMMIT;
5472 INSERT INTO ac_test VALUES (2);
5473 ROLLBACK;
5474 SELECT * FROM ac_test;
5475  a 
5478 (1 row)
5480 COMMIT;
5481 BEGIN;
5482 INSERT INTO ac_test VALUES (3);
5483 COMMIT;
5484 SELECT * FROM ac_test;
5485  a 
5489 (2 rows)
5491 COMMIT;
5492 BEGIN;
5493 INSERT INTO ac_test VALUES (4);
5494 ROLLBACK;
5495 SELECT * FROM ac_test;
5496  a 
5500 (2 rows)
5502 COMMIT;
5503 \set AUTOCOMMIT on
5504 DROP TABLE ac_test;
5505 SELECT * FROM ac_test;  -- should be gone now
5506 ERROR:  relation "ac_test" does not exist
5507 LINE 1: SELECT * FROM ac_test;
5508                       ^
5509 -- ON_ERROR_ROLLBACK
5510 \set ON_ERROR_ROLLBACK on
5511 CREATE TABLE oer_test (a int);
5512 BEGIN;
5513 INSERT INTO oer_test VALUES (1);
5514 INSERT INTO oer_test VALUES ('foo');
5515 ERROR:  invalid input syntax for type integer: "foo"
5516 LINE 1: INSERT INTO oer_test VALUES ('foo');
5517                                      ^
5518 INSERT INTO oer_test VALUES (3);
5519 COMMIT;
5520 SELECT * FROM oer_test;
5521  a 
5525 (2 rows)
5527 BEGIN;
5528 INSERT INTO oer_test VALUES (4);
5529 ROLLBACK;
5530 SELECT * FROM oer_test;
5531  a 
5535 (2 rows)
5537 BEGIN;
5538 INSERT INTO oer_test VALUES (5);
5539 COMMIT AND CHAIN;
5540 INSERT INTO oer_test VALUES (6);
5541 COMMIT;
5542 SELECT * FROM oer_test;
5543  a 
5549 (4 rows)
5551 DROP TABLE oer_test;
5552 \set ON_ERROR_ROLLBACK off
5553 -- ECHO errors
5554 \set ECHO errors
5555 ERROR:  relation "notexists" does not exist
5556 LINE 1: SELECT * FROM notexists;
5557                       ^
5558 STATEMENT:  SELECT * FROM notexists;
5560 -- combined queries
5562 CREATE FUNCTION warn(msg TEXT) RETURNS BOOLEAN LANGUAGE plpgsql
5563 AS $$
5564   BEGIN RAISE NOTICE 'warn %', msg ; RETURN TRUE ; END
5566 -- show both
5567 SELECT 1 AS one \; SELECT warn('1.5') \; SELECT 2 AS two ;
5568 NOTICE:  warn 1.5
5569 CONTEXT:  PL/pgSQL function warn(text) line 2 at RAISE
5570  one 
5571 -----
5572    1
5573 (1 row)
5575  warn 
5576 ------
5578 (1 row)
5580  two 
5581 -----
5582    2
5583 (1 row)
5585 -- \gset applies to last query only
5586 SELECT 3 AS three \; SELECT warn('3.5') \; SELECT 4 AS four \gset
5587 NOTICE:  warn 3.5
5588 CONTEXT:  PL/pgSQL function warn(text) line 2 at RAISE
5589  three 
5590 -------
5591      3
5592 (1 row)
5594  warn 
5595 ------
5597 (1 row)
5599 \echo :three :four
5600 :three 4
5601 -- syntax error stops all processing
5602 SELECT 5 \; SELECT 6 + \; SELECT warn('6.5') \; SELECT 7 ;
5603 ERROR:  syntax error at or near ";"
5604 LINE 1: SELECT 5 ; SELECT 6 + ; SELECT warn('6.5') ; SELECT 7 ;
5605                               ^
5606 -- with aborted transaction, stop on first error
5607 BEGIN \; SELECT 8 AS eight \; SELECT 9/0 AS nine \; ROLLBACK \; SELECT 10 AS ten ;
5608  eight 
5609 -------
5610      8
5611 (1 row)
5613 ERROR:  division by zero
5614 -- close previously aborted transaction
5615 ROLLBACK;
5616 -- miscellaneous SQL commands
5617 -- (non SELECT output is sent to stderr, thus is not shown in expected results)
5618 SELECT 'ok' AS "begin" \;
5619 CREATE TABLE psql_comics(s TEXT) \;
5620 INSERT INTO psql_comics VALUES ('Calvin'), ('hobbes') \;
5621 COPY psql_comics FROM STDIN \;
5622 UPDATE psql_comics SET s = 'Hobbes' WHERE s = 'hobbes' \;
5623 DELETE FROM psql_comics WHERE s = 'Moe' \;
5624 COPY psql_comics TO STDOUT \;
5625 TRUNCATE psql_comics \;
5626 DROP TABLE psql_comics \;
5627 SELECT 'ok' AS "done" ;
5628  begin 
5629 -------
5630  ok
5631 (1 row)
5633 Calvin
5634 Susie
5635 Hobbes
5636  done 
5637 ------
5638  ok
5639 (1 row)
5641 \set SHOW_ALL_RESULTS off
5642 SELECT 1 AS one \; SELECT warn('1.5') \; SELECT 2 AS two ;
5643 NOTICE:  warn 1.5
5644 CONTEXT:  PL/pgSQL function warn(text) line 2 at RAISE
5645  two 
5646 -----
5647    2
5648 (1 row)
5650 \set SHOW_ALL_RESULTS on
5651 DROP FUNCTION warn(TEXT);
5653 -- \g with file
5655 \getenv abs_builddir PG_ABS_BUILDDIR
5656 \set g_out_file :abs_builddir '/results/psql-output1'
5657 CREATE TEMPORARY TABLE reload_output(
5658   lineno int NOT NULL GENERATED ALWAYS AS IDENTITY,
5659   line text
5661 SELECT 1 AS a \g :g_out_file
5662 COPY reload_output(line) FROM :'g_out_file';
5663 SELECT 2 AS b\; SELECT 3 AS c\; SELECT 4 AS d \g :g_out_file
5664 COPY reload_output(line) FROM :'g_out_file';
5665 COPY (SELECT 'foo') TO STDOUT \; COPY (SELECT 'bar') TO STDOUT \g :g_out_file
5666 COPY reload_output(line) FROM :'g_out_file';
5667 SELECT line FROM reload_output ORDER BY lineno;
5668   line   
5669 ---------
5670   a 
5671  ---
5672   1
5673  (1 row)
5675   b 
5676  ---
5677   2
5678  (1 row)
5680   c 
5681  ---
5682   3
5683  (1 row)
5685   d 
5686  ---
5687   4
5688  (1 row)
5690  foo
5691  bar
5692 (22 rows)
5694 TRUNCATE TABLE reload_output;
5696 -- \o with file
5698 \set o_out_file :abs_builddir '/results/psql-output2'
5699 \o :o_out_file
5700 SELECT max(unique1) FROM onek;
5701 SELECT 1 AS a\; SELECT 2 AS b\; SELECT 3 AS c;
5702 -- COPY TO file
5703 -- The data goes to :g_out_file and the status to :o_out_file
5704 \set QUIET false
5705 COPY (SELECT unique1 FROM onek ORDER BY unique1 LIMIT 10) TO :'g_out_file';
5706 -- DML command status
5707 UPDATE onek SET unique1 = unique1 WHERE false;
5708 \set QUIET true
5710 -- Check the contents of the files generated.
5711 COPY reload_output(line) FROM :'g_out_file';
5712 SELECT line FROM reload_output ORDER BY lineno;
5713  line 
5714 ------
5725 (10 rows)
5727 TRUNCATE TABLE reload_output;
5728 COPY reload_output(line) FROM :'o_out_file';
5729 SELECT line FROM reload_output ORDER BY lineno;
5730    line   
5731 ----------
5732   max 
5733  -----
5734   999
5735  (1 row)
5737   a 
5738  ---
5739   1
5740  (1 row)
5742   b 
5743  ---
5744   2
5745  (1 row)
5747   c 
5748  ---
5749   3
5750  (1 row)
5752  COPY 10
5753  UPDATE 0
5754 (22 rows)
5756 TRUNCATE TABLE reload_output;
5757 -- Multiple COPY TO STDOUT with output file
5758 \o :o_out_file
5759 -- The data goes to :o_out_file with no status generated.
5760 COPY (SELECT 'foo1') TO STDOUT \; COPY (SELECT 'bar1') TO STDOUT;
5761 -- Combination of \o and \g file with multiple COPY queries.
5762 COPY (SELECT 'foo2') TO STDOUT \; COPY (SELECT 'bar2') TO STDOUT \g :g_out_file
5764 -- Check the contents of the files generated.
5765 COPY reload_output(line) FROM :'g_out_file';
5766 SELECT line FROM reload_output ORDER BY lineno;
5767  line 
5768 ------
5769  foo2
5770  bar2
5771 (2 rows)
5773 TRUNCATE TABLE reload_output;
5774 COPY reload_output(line) FROM :'o_out_file';
5775 SELECT line FROM reload_output ORDER BY lineno;
5776  line 
5777 ------
5778  foo1
5779  bar1
5780 (2 rows)
5782 DROP TABLE reload_output;
5784 -- AUTOCOMMIT and combined queries
5786 \set AUTOCOMMIT off
5787 \echo '# AUTOCOMMIT:' :AUTOCOMMIT
5788 # AUTOCOMMIT: off
5789 -- BEGIN is now implicit
5790 CREATE TABLE foo(s TEXT) \;
5791 ROLLBACK;
5792 CREATE TABLE foo(s TEXT) \;
5793 INSERT INTO foo(s) VALUES ('hello'), ('world') \;
5794 COMMIT;
5795 DROP TABLE foo \;
5796 ROLLBACK;
5797 -- table foo is still there
5798 SELECT * FROM foo ORDER BY 1 \;
5799 DROP TABLE foo \;
5800 COMMIT;
5801    s   
5802 -------
5803  hello
5804  world
5805 (2 rows)
5807 \set AUTOCOMMIT on
5808 \echo '# AUTOCOMMIT:' :AUTOCOMMIT
5809 # AUTOCOMMIT: on
5810 -- BEGIN now explicit for multi-statement transactions
5811 BEGIN \;
5812 CREATE TABLE foo(s TEXT) \;
5813 INSERT INTO foo(s) VALUES ('hello'), ('world') \;
5814 COMMIT;
5815 BEGIN \;
5816 DROP TABLE foo \;
5817 ROLLBACK \;
5818 -- implicit transactions
5819 SELECT * FROM foo ORDER BY 1 \;
5820 DROP TABLE foo;
5821    s   
5822 -------
5823  hello
5824  world
5825 (2 rows)
5828 -- test ON_ERROR_ROLLBACK and combined queries
5830 CREATE FUNCTION psql_error(msg TEXT) RETURNS BOOLEAN AS $$
5831   BEGIN
5832     RAISE EXCEPTION 'error %', msg;
5833   END;
5834 $$ LANGUAGE plpgsql;
5835 \set ON_ERROR_ROLLBACK on
5836 \echo '# ON_ERROR_ROLLBACK:' :ON_ERROR_ROLLBACK
5837 # ON_ERROR_ROLLBACK: on
5838 \echo '# AUTOCOMMIT:' :AUTOCOMMIT
5839 # AUTOCOMMIT: on
5840 BEGIN;
5841 CREATE TABLE bla(s NO_SUCH_TYPE);               -- fails
5842 ERROR:  type "no_such_type" does not exist
5843 LINE 1: CREATE TABLE bla(s NO_SUCH_TYPE);
5844                            ^
5845 CREATE TABLE bla(s TEXT);                       -- succeeds
5846 SELECT psql_error('oops!');                     -- fails
5847 ERROR:  error oops!
5848 CONTEXT:  PL/pgSQL function psql_error(text) line 3 at RAISE
5849 INSERT INTO bla VALUES ('Calvin'), ('Hobbes');
5850 COMMIT;
5851 SELECT * FROM bla ORDER BY 1;
5852    s    
5853 --------
5854  Calvin
5855  Hobbes
5856 (2 rows)
5858 BEGIN;
5859 INSERT INTO bla VALUES ('Susie');         -- succeeds
5860 -- now with combined queries
5861 INSERT INTO bla VALUES ('Rosalyn') \;     -- will rollback
5862 SELECT 'before error' AS show \;          -- will show nevertheless!
5863   SELECT psql_error('boum!') \;           -- failure
5864   SELECT 'after error' AS noshow;         -- hidden by preceding error
5865      show     
5866 --------------
5867  before error
5868 (1 row)
5870 ERROR:  error boum!
5871 CONTEXT:  PL/pgSQL function psql_error(text) line 3 at RAISE
5872 INSERT INTO bla(s) VALUES ('Moe') \;      -- will rollback
5873   SELECT psql_error('bam!');
5874 ERROR:  error bam!
5875 CONTEXT:  PL/pgSQL function psql_error(text) line 3 at RAISE
5876 INSERT INTO bla VALUES ('Miss Wormwood'); -- succeeds
5877 COMMIT;
5878 SELECT * FROM bla ORDER BY 1;
5879        s       
5880 ---------------
5881  Calvin
5882  Hobbes
5883  Miss Wormwood
5884  Susie
5885 (4 rows)
5887 -- some with autocommit off
5888 \set AUTOCOMMIT off
5889 \echo '# AUTOCOMMIT:' :AUTOCOMMIT
5890 # AUTOCOMMIT: off
5891 -- implicit BEGIN
5892 INSERT INTO bla VALUES ('Dad');           -- succeeds
5893 SELECT psql_error('bad!');                -- implicit partial rollback
5894 ERROR:  error bad!
5895 CONTEXT:  PL/pgSQL function psql_error(text) line 3 at RAISE
5896 INSERT INTO bla VALUES ('Mum') \;         -- will rollback
5897 SELECT COUNT(*) AS "#mum"
5898 FROM bla WHERE s = 'Mum' \;               -- but be counted here
5899 SELECT psql_error('bad!');                -- implicit partial rollback
5900  #mum 
5901 ------
5902     1
5903 (1 row)
5905 ERROR:  error bad!
5906 CONTEXT:  PL/pgSQL function psql_error(text) line 3 at RAISE
5907 COMMIT;
5908 SELECT COUNT(*) AS "#mum"
5909 FROM bla WHERE s = 'Mum' \;               -- no mum here
5910 SELECT * FROM bla ORDER BY 1;
5911  #mum 
5912 ------
5913     0
5914 (1 row)
5916        s       
5917 ---------------
5918  Calvin
5919  Dad
5920  Hobbes
5921  Miss Wormwood
5922  Susie
5923 (5 rows)
5925 COMMIT;
5926 -- reset all
5927 \set AUTOCOMMIT on
5928 \set ON_ERROR_ROLLBACK off
5929 \echo '# final ON_ERROR_ROLLBACK:' :ON_ERROR_ROLLBACK
5930 # final ON_ERROR_ROLLBACK: off
5931 DROP TABLE bla;
5932 DROP FUNCTION psql_error;
5933 -- check describing invalid multipart names
5934 \dA regression.heap
5935 improper qualified name (too many dotted names): regression.heap
5936 \dA nonesuch.heap
5937 improper qualified name (too many dotted names): nonesuch.heap
5938 \dt host.regression.pg_catalog.pg_class
5939 improper qualified name (too many dotted names): host.regression.pg_catalog.pg_class
5940 \dt |.pg_catalog.pg_class
5941 cross-database references are not implemented: |.pg_catalog.pg_class
5942 \dt nonesuch.pg_catalog.pg_class
5943 cross-database references are not implemented: nonesuch.pg_catalog.pg_class
5944 \da host.regression.pg_catalog.sum
5945 improper qualified name (too many dotted names): host.regression.pg_catalog.sum
5946 \da +.pg_catalog.sum
5947 cross-database references are not implemented: +.pg_catalog.sum
5948 \da nonesuch.pg_catalog.sum
5949 cross-database references are not implemented: nonesuch.pg_catalog.sum
5950 \dAc nonesuch.brin
5951 improper qualified name (too many dotted names): nonesuch.brin
5952 \dAc regression.brin
5953 improper qualified name (too many dotted names): regression.brin
5954 \dAf nonesuch.brin
5955 improper qualified name (too many dotted names): nonesuch.brin
5956 \dAf regression.brin
5957 improper qualified name (too many dotted names): regression.brin
5958 \dAo nonesuch.brin
5959 improper qualified name (too many dotted names): nonesuch.brin
5960 \dAo regression.brin
5961 improper qualified name (too many dotted names): regression.brin
5962 \dAp nonesuch.brin
5963 improper qualified name (too many dotted names): nonesuch.brin
5964 \dAp regression.brin
5965 improper qualified name (too many dotted names): regression.brin
5966 \db nonesuch.pg_default
5967 improper qualified name (too many dotted names): nonesuch.pg_default
5968 \db regression.pg_default
5969 improper qualified name (too many dotted names): regression.pg_default
5970 \dc host.regression.public.conversion
5971 improper qualified name (too many dotted names): host.regression.public.conversion
5972 \dc (.public.conversion
5973 cross-database references are not implemented: (.public.conversion
5974 \dc nonesuch.public.conversion
5975 cross-database references are not implemented: nonesuch.public.conversion
5976 \dC host.regression.pg_catalog.int8
5977 improper qualified name (too many dotted names): host.regression.pg_catalog.int8
5978 \dC ).pg_catalog.int8
5979 cross-database references are not implemented: ).pg_catalog.int8
5980 \dC nonesuch.pg_catalog.int8
5981 cross-database references are not implemented: nonesuch.pg_catalog.int8
5982 \dd host.regression.pg_catalog.pg_class
5983 improper qualified name (too many dotted names): host.regression.pg_catalog.pg_class
5984 \dd [.pg_catalog.pg_class
5985 cross-database references are not implemented: [.pg_catalog.pg_class
5986 \dd nonesuch.pg_catalog.pg_class
5987 cross-database references are not implemented: nonesuch.pg_catalog.pg_class
5988 \dD host.regression.public.gtestdomain1
5989 improper qualified name (too many dotted names): host.regression.public.gtestdomain1
5990 \dD ].public.gtestdomain1
5991 cross-database references are not implemented: ].public.gtestdomain1
5992 \dD nonesuch.public.gtestdomain1
5993 cross-database references are not implemented: nonesuch.public.gtestdomain1
5994 \ddp host.regression.pg_catalog.pg_class
5995 improper qualified name (too many dotted names): host.regression.pg_catalog.pg_class
5996 \ddp {.pg_catalog.pg_class
5997 cross-database references are not implemented: {.pg_catalog.pg_class
5998 \ddp nonesuch.pg_catalog.pg_class
5999 cross-database references are not implemented: nonesuch.pg_catalog.pg_class
6000 \dE host.regression.public.ft
6001 improper qualified name (too many dotted names): host.regression.public.ft
6002 \dE }.public.ft
6003 cross-database references are not implemented: }.public.ft
6004 \dE nonesuch.public.ft
6005 cross-database references are not implemented: nonesuch.public.ft
6006 \di host.regression.public.tenk1_hundred
6007 improper qualified name (too many dotted names): host.regression.public.tenk1_hundred
6008 \di ..public.tenk1_hundred
6009 improper qualified name (too many dotted names): ..public.tenk1_hundred
6010 \di nonesuch.public.tenk1_hundred
6011 cross-database references are not implemented: nonesuch.public.tenk1_hundred
6012 \dm host.regression.public.mvtest_bb
6013 improper qualified name (too many dotted names): host.regression.public.mvtest_bb
6014 \dm ^.public.mvtest_bb
6015 cross-database references are not implemented: ^.public.mvtest_bb
6016 \dm nonesuch.public.mvtest_bb
6017 cross-database references are not implemented: nonesuch.public.mvtest_bb
6018 \ds host.regression.public.check_seq
6019 improper qualified name (too many dotted names): host.regression.public.check_seq
6020 \ds regression|mydb.public.check_seq
6021 cross-database references are not implemented: regression|mydb.public.check_seq
6022 \ds nonesuch.public.check_seq
6023 cross-database references are not implemented: nonesuch.public.check_seq
6024 \dt host.regression.public.b_star
6025 improper qualified name (too many dotted names): host.regression.public.b_star
6026 \dt regres+ion.public.b_star
6027 cross-database references are not implemented: regres+ion.public.b_star
6028 \dt nonesuch.public.b_star
6029 cross-database references are not implemented: nonesuch.public.b_star
6030 \dv host.regression.public.shoe
6031 improper qualified name (too many dotted names): host.regression.public.shoe
6032 \dv regress(ion).public.shoe
6033 cross-database references are not implemented: regress(ion).public.shoe
6034 \dv nonesuch.public.shoe
6035 cross-database references are not implemented: nonesuch.public.shoe
6036 \des nonesuch.server
6037 improper qualified name (too many dotted names): nonesuch.server
6038 \des regression.server
6039 improper qualified name (too many dotted names): regression.server
6040 \des nonesuch.server
6041 improper qualified name (too many dotted names): nonesuch.server
6042 \des regression.server
6043 improper qualified name (too many dotted names): regression.server
6044 \des nonesuch.username
6045 improper qualified name (too many dotted names): nonesuch.username
6046 \des regression.username
6047 improper qualified name (too many dotted names): regression.username
6048 \dew nonesuch.fdw
6049 improper qualified name (too many dotted names): nonesuch.fdw
6050 \dew regression.fdw
6051 improper qualified name (too many dotted names): regression.fdw
6052 \df host.regression.public.namelen
6053 improper qualified name (too many dotted names): host.regression.public.namelen
6054 \df regres[qrstuv]ion.public.namelen
6055 cross-database references are not implemented: regres[qrstuv]ion.public.namelen
6056 \df nonesuch.public.namelen
6057 cross-database references are not implemented: nonesuch.public.namelen
6058 \dF host.regression.pg_catalog.arabic
6059 improper qualified name (too many dotted names): host.regression.pg_catalog.arabic
6060 \dF regres{1,2}ion.pg_catalog.arabic
6061 cross-database references are not implemented: regres{1,2}ion.pg_catalog.arabic
6062 \dF nonesuch.pg_catalog.arabic
6063 cross-database references are not implemented: nonesuch.pg_catalog.arabic
6064 \dFd host.regression.pg_catalog.arabic_stem
6065 improper qualified name (too many dotted names): host.regression.pg_catalog.arabic_stem
6066 \dFd regres?ion.pg_catalog.arabic_stem
6067 cross-database references are not implemented: regres?ion.pg_catalog.arabic_stem
6068 \dFd nonesuch.pg_catalog.arabic_stem
6069 cross-database references are not implemented: nonesuch.pg_catalog.arabic_stem
6070 \dFp host.regression.pg_catalog.default
6071 improper qualified name (too many dotted names): host.regression.pg_catalog.default
6072 \dFp ^regression.pg_catalog.default
6073 cross-database references are not implemented: ^regression.pg_catalog.default
6074 \dFp nonesuch.pg_catalog.default
6075 cross-database references are not implemented: nonesuch.pg_catalog.default
6076 \dFt host.regression.pg_catalog.ispell
6077 improper qualified name (too many dotted names): host.regression.pg_catalog.ispell
6078 \dFt regression$.pg_catalog.ispell
6079 cross-database references are not implemented: regression$.pg_catalog.ispell
6080 \dFt nonesuch.pg_catalog.ispell
6081 cross-database references are not implemented: nonesuch.pg_catalog.ispell
6082 \dg nonesuch.pg_database_owner
6083 improper qualified name (too many dotted names): nonesuch.pg_database_owner
6084 \dg regression.pg_database_owner
6085 improper qualified name (too many dotted names): regression.pg_database_owner
6086 \dL host.regression.plpgsql
6087 improper qualified name (too many dotted names): host.regression.plpgsql
6088 \dL *.plpgsql
6089 cross-database references are not implemented: *.plpgsql
6090 \dL nonesuch.plpgsql
6091 cross-database references are not implemented: nonesuch.plpgsql
6092 \dn host.regression.public
6093 improper qualified name (too many dotted names): host.regression.public
6094 \dn """".public
6095 cross-database references are not implemented: """".public
6096 \dn nonesuch.public
6097 cross-database references are not implemented: nonesuch.public
6098 \do host.regression.public.!=-
6099 improper qualified name (too many dotted names): host.regression.public.!=-
6100 \do "regression|mydb".public.!=-
6101 cross-database references are not implemented: "regression|mydb".public.!=-
6102 \do nonesuch.public.!=-
6103 cross-database references are not implemented: nonesuch.public.!=-
6104 \dO host.regression.pg_catalog.POSIX
6105 improper qualified name (too many dotted names): host.regression.pg_catalog.POSIX
6106 \dO .pg_catalog.POSIX
6107 cross-database references are not implemented: .pg_catalog.POSIX
6108 \dO nonesuch.pg_catalog.POSIX
6109 cross-database references are not implemented: nonesuch.pg_catalog.POSIX
6110 \dp host.regression.public.a_star
6111 improper qualified name (too many dotted names): host.regression.public.a_star
6112 \dp "regres+ion".public.a_star
6113 cross-database references are not implemented: "regres+ion".public.a_star
6114 \dp nonesuch.public.a_star
6115 cross-database references are not implemented: nonesuch.public.a_star
6116 \dP host.regression.public.mlparted
6117 improper qualified name (too many dotted names): host.regression.public.mlparted
6118 \dP "regres(sion)".public.mlparted
6119 cross-database references are not implemented: "regres(sion)".public.mlparted
6120 \dP nonesuch.public.mlparted
6121 cross-database references are not implemented: nonesuch.public.mlparted
6122 \drds nonesuch.lc_messages
6123 improper qualified name (too many dotted names): nonesuch.lc_messages
6124 \drds regression.lc_messages
6125 improper qualified name (too many dotted names): regression.lc_messages
6126 \dRp public.mypub
6127 improper qualified name (too many dotted names): public.mypub
6128 \dRp regression.mypub
6129 improper qualified name (too many dotted names): regression.mypub
6130 \dRs public.mysub
6131 improper qualified name (too many dotted names): public.mysub
6132 \dRs regression.mysub
6133 improper qualified name (too many dotted names): regression.mysub
6134 \dT host.regression.public.widget
6135 improper qualified name (too many dotted names): host.regression.public.widget
6136 \dT "regression{1,2}".public.widget
6137 cross-database references are not implemented: "regression{1,2}".public.widget
6138 \dT nonesuch.public.widget
6139 cross-database references are not implemented: nonesuch.public.widget
6140 \dx regression.plpgsql
6141 improper qualified name (too many dotted names): regression.plpgsql
6142 \dx nonesuch.plpgsql
6143 improper qualified name (too many dotted names): nonesuch.plpgsql
6144 \dX host.regression.public.func_deps_stat
6145 improper qualified name (too many dotted names): host.regression.public.func_deps_stat
6146 \dX "^regression$".public.func_deps_stat
6147 cross-database references are not implemented: "^regression$".public.func_deps_stat
6148 \dX nonesuch.public.func_deps_stat
6149 cross-database references are not implemented: nonesuch.public.func_deps_stat
6150 \dy regression.myevt
6151 improper qualified name (too many dotted names): regression.myevt
6152 \dy nonesuch.myevt
6153 improper qualified name (too many dotted names): nonesuch.myevt
6154 -- check that dots within quoted name segments are not counted
6155 \dA "no.such.access.method"
6156 List of access methods
6157  Name | Type 
6158 ------+------
6159 (0 rows)
6161 \dt "no.such.table.relation"
6162       List of relations
6163  Schema | Name | Type | Owner 
6164 --------+------+------+-------
6165 (0 rows)
6167 \da "no.such.aggregate.function"
6168                      List of aggregate functions
6169  Schema | Name | Result data type | Argument data types | Description 
6170 --------+------+------------------+---------------------+-------------
6171 (0 rows)
6173 \dAc "no.such.operator.class"
6174                   List of operator classes
6175  AM | Input type | Storage type | Operator class | Default? 
6176 ----+------------+--------------+----------------+----------
6177 (0 rows)
6179 \dAf "no.such.operator.family"
6180         List of operator families
6181  AM | Operator family | Applicable types 
6182 ----+-----------------+------------------
6183 (0 rows)
6185 \dAo "no.such.operator.of.operator.family"
6186         List of operators of operator families
6187  AM | Operator family | Operator | Strategy | Purpose 
6188 ----+-----------------+----------+----------+---------
6189 (0 rows)
6191 \dAp "no.such.operator.support.function.of.operator.family"
6192                      List of support functions of operator families
6193  AM | Operator family | Registered left type | Registered right type | Number | Function 
6194 ----+-----------------+----------------------+-----------------------+--------+----------
6195 (0 rows)
6197 \db "no.such.tablespace"
6198    List of tablespaces
6199  Name | Owner | Location 
6200 ------+-------+----------
6201 (0 rows)
6203 \dc "no.such.conversion"
6204                List of conversions
6205  Schema | Name | Source | Destination | Default? 
6206 --------+------+--------+-------------+----------
6207 (0 rows)
6209 \dC "no.such.cast"
6210                   List of casts
6211  Source type | Target type | Function | Implicit? 
6212 -------------+-------------+----------+-----------
6213 (0 rows)
6215 \dd "no.such.object.description"
6216          Object descriptions
6217  Schema | Name | Object | Description 
6218 --------+------+--------+-------------
6219 (0 rows)
6221 \dD "no.such.domain"
6222                         List of domains
6223  Schema | Name | Type | Collation | Nullable | Default | Check 
6224 --------+------+------+-----------+----------+---------+-------
6225 (0 rows)
6227 \ddp "no.such.default.access.privilege"
6228          Default access privileges
6229  Owner | Schema | Type | Access privileges 
6230 -------+--------+------+-------------------
6231 (0 rows)
6233 \di "no.such.index.relation"
6234           List of relations
6235  Schema | Name | Type | Owner | Table 
6236 --------+------+------+-------+-------
6237 (0 rows)
6239 \dm "no.such.materialized.view"
6240       List of relations
6241  Schema | Name | Type | Owner 
6242 --------+------+------+-------
6243 (0 rows)
6245 \ds "no.such.relation"
6246       List of relations
6247  Schema | Name | Type | Owner 
6248 --------+------+------+-------
6249 (0 rows)
6251 \dt "no.such.relation"
6252       List of relations
6253  Schema | Name | Type | Owner 
6254 --------+------+------+-------
6255 (0 rows)
6257 \dv "no.such.relation"
6258       List of relations
6259  Schema | Name | Type | Owner 
6260 --------+------+------+-------
6261 (0 rows)
6263 \des "no.such.foreign.server"
6264        List of foreign servers
6265  Name | Owner | Foreign-data wrapper 
6266 ------+-------+----------------------
6267 (0 rows)
6269 \dew "no.such.foreign.data.wrapper"
6270    List of foreign-data wrappers
6271  Name | Owner | Handler | Validator 
6272 ------+-------+---------+-----------
6273 (0 rows)
6275 \df "no.such.function"
6276                        List of functions
6277  Schema | Name | Result data type | Argument data types | Type 
6278 --------+------+------------------+---------------------+------
6279 (0 rows)
6281 \dF "no.such.text.search.configuration"
6282 List of text search configurations
6283  Schema | Name | Description 
6284 --------+------+-------------
6285 (0 rows)
6287 \dFd "no.such.text.search.dictionary"
6288 List of text search dictionaries
6289  Schema | Name | Description 
6290 --------+------+-------------
6291 (0 rows)
6293 \dFp "no.such.text.search.parser"
6294  List of text search parsers
6295  Schema | Name | Description 
6296 --------+------+-------------
6297 (0 rows)
6299 \dFt "no.such.text.search.template"
6300 List of text search templates
6301  Schema | Name | Description 
6302 --------+------+-------------
6303 (0 rows)
6305 \dg "no.such.role"
6306      List of roles
6307  Role name | Attributes 
6308 -----------+------------
6310 \dL "no.such.language"
6311           List of languages
6312  Name | Owner | Trusted | Description 
6313 ------+-------+---------+-------------
6314 (0 rows)
6316 \dn "no.such.schema"
6317 List of schemas
6318  Name | Owner 
6319 ------+-------
6320 (0 rows)
6322 \do "no.such.operator"
6323                              List of operators
6324  Schema | Name | Left arg type | Right arg type | Result type | Description 
6325 --------+------+---------------+----------------+-------------+-------------
6326 (0 rows)
6328 \dO "no.such.collation"
6329                                 List of collations
6330  Schema | Name | Provider | Collate | Ctype | Locale | ICU Rules | Deterministic? 
6331 --------+------+----------+---------+-------+--------+-----------+----------------
6332 (0 rows)
6334 \dp "no.such.access.privilege"
6335                             Access privileges
6336  Schema | Name | Type | Access privileges | Column privileges | Policies 
6337 --------+------+------+-------------------+-------------------+----------
6338 (0 rows)
6340 \dP "no.such.partitioned.relation"
6341            List of partitioned relations
6342  Schema | Name | Owner | Type | Parent name | Table 
6343 --------+------+-------+------+-------------+-------
6344 (0 rows)
6346 \drds "no.such.setting"
6347       List of settings
6348  Role | Database | Settings 
6349 ------+----------+----------
6350 (0 rows)
6352 \dRp "no.such.publication"
6353                                         List of publications
6354  Name | Owner | All tables | Inserts | Updates | Deletes | Truncates | Generated columns | Via root 
6355 ------+-------+------------+---------+---------+---------+-----------+-------------------+----------
6356 (0 rows)
6358 \dRs "no.such.subscription"
6359         List of subscriptions
6360  Name | Owner | Enabled | Publication 
6361 ------+-------+---------+-------------
6362 (0 rows)
6364 \dT "no.such.data.type"
6365      List of data types
6366  Schema | Name | Description 
6367 --------+------+-------------
6368 (0 rows)
6370 \dx "no.such.installed.extension"
6371      List of installed extensions
6372  Name | Version | Schema | Description 
6373 ------+---------+--------+-------------
6374 (0 rows)
6376 \dX "no.such.extended.statistics"
6377                  List of extended statistics
6378  Schema | Name | Definition | Ndistinct | Dependencies | MCV 
6379 --------+------+------------+-----------+--------------+-----
6380 (0 rows)
6382 \dy "no.such.event.trigger"
6383               List of event triggers
6384  Name | Event | Owner | Enabled | Function | Tags 
6385 ------+-------+-------+---------+----------+------
6386 (0 rows)
6388 -- again, but with dotted schema qualifications.
6389 \dA "no.such.schema"."no.such.access.method"
6390 improper qualified name (too many dotted names): "no.such.schema"."no.such.access.method"
6391 \dt "no.such.schema"."no.such.table.relation"
6392       List of relations
6393  Schema | Name | Type | Owner 
6394 --------+------+------+-------
6395 (0 rows)
6397 \da "no.such.schema"."no.such.aggregate.function"
6398                      List of aggregate functions
6399  Schema | Name | Result data type | Argument data types | Description 
6400 --------+------+------------------+---------------------+-------------
6401 (0 rows)
6403 \dAc "no.such.schema"."no.such.operator.class"
6404 improper qualified name (too many dotted names): "no.such.schema"."no.such.operator.class"
6405 \dAf "no.such.schema"."no.such.operator.family"
6406 improper qualified name (too many dotted names): "no.such.schema"."no.such.operator.family"
6407 \dAo "no.such.schema"."no.such.operator.of.operator.family"
6408 improper qualified name (too many dotted names): "no.such.schema"."no.such.operator.of.operator.family"
6409 \dAp "no.such.schema"."no.such.operator.support.function.of.operator.family"
6410 improper qualified name (too many dotted names): "no.such.schema"."no.such.operator.support.function.of.operator.family"
6411 \db "no.such.schema"."no.such.tablespace"
6412 improper qualified name (too many dotted names): "no.such.schema"."no.such.tablespace"
6413 \dc "no.such.schema"."no.such.conversion"
6414                List of conversions
6415  Schema | Name | Source | Destination | Default? 
6416 --------+------+--------+-------------+----------
6417 (0 rows)
6419 \dC "no.such.schema"."no.such.cast"
6420                   List of casts
6421  Source type | Target type | Function | Implicit? 
6422 -------------+-------------+----------+-----------
6423 (0 rows)
6425 \dd "no.such.schema"."no.such.object.description"
6426          Object descriptions
6427  Schema | Name | Object | Description 
6428 --------+------+--------+-------------
6429 (0 rows)
6431 \dD "no.such.schema"."no.such.domain"
6432                         List of domains
6433  Schema | Name | Type | Collation | Nullable | Default | Check 
6434 --------+------+------+-----------+----------+---------+-------
6435 (0 rows)
6437 \ddp "no.such.schema"."no.such.default.access.privilege"
6438          Default access privileges
6439  Owner | Schema | Type | Access privileges 
6440 -------+--------+------+-------------------
6441 (0 rows)
6443 \di "no.such.schema"."no.such.index.relation"
6444           List of relations
6445  Schema | Name | Type | Owner | Table 
6446 --------+------+------+-------+-------
6447 (0 rows)
6449 \dm "no.such.schema"."no.such.materialized.view"
6450       List of relations
6451  Schema | Name | Type | Owner 
6452 --------+------+------+-------
6453 (0 rows)
6455 \ds "no.such.schema"."no.such.relation"
6456       List of relations
6457  Schema | Name | Type | Owner 
6458 --------+------+------+-------
6459 (0 rows)
6461 \dt "no.such.schema"."no.such.relation"
6462       List of relations
6463  Schema | Name | Type | Owner 
6464 --------+------+------+-------
6465 (0 rows)
6467 \dv "no.such.schema"."no.such.relation"
6468       List of relations
6469  Schema | Name | Type | Owner 
6470 --------+------+------+-------
6471 (0 rows)
6473 \des "no.such.schema"."no.such.foreign.server"
6474 improper qualified name (too many dotted names): "no.such.schema"."no.such.foreign.server"
6475 \dew "no.such.schema"."no.such.foreign.data.wrapper"
6476 improper qualified name (too many dotted names): "no.such.schema"."no.such.foreign.data.wrapper"
6477 \df "no.such.schema"."no.such.function"
6478                        List of functions
6479  Schema | Name | Result data type | Argument data types | Type 
6480 --------+------+------------------+---------------------+------
6481 (0 rows)
6483 \dF "no.such.schema"."no.such.text.search.configuration"
6484 List of text search configurations
6485  Schema | Name | Description 
6486 --------+------+-------------
6487 (0 rows)
6489 \dFd "no.such.schema"."no.such.text.search.dictionary"
6490 List of text search dictionaries
6491  Schema | Name | Description 
6492 --------+------+-------------
6493 (0 rows)
6495 \dFp "no.such.schema"."no.such.text.search.parser"
6496  List of text search parsers
6497  Schema | Name | Description 
6498 --------+------+-------------
6499 (0 rows)
6501 \dFt "no.such.schema"."no.such.text.search.template"
6502 List of text search templates
6503  Schema | Name | Description 
6504 --------+------+-------------
6505 (0 rows)
6507 \dg "no.such.schema"."no.such.role"
6508 improper qualified name (too many dotted names): "no.such.schema"."no.such.role"
6509 \dL "no.such.schema"."no.such.language"
6510 cross-database references are not implemented: "no.such.schema"."no.such.language"
6511 \do "no.such.schema"."no.such.operator"
6512                              List of operators
6513  Schema | Name | Left arg type | Right arg type | Result type | Description 
6514 --------+------+---------------+----------------+-------------+-------------
6515 (0 rows)
6517 \dO "no.such.schema"."no.such.collation"
6518                                 List of collations
6519  Schema | Name | Provider | Collate | Ctype | Locale | ICU Rules | Deterministic? 
6520 --------+------+----------+---------+-------+--------+-----------+----------------
6521 (0 rows)
6523 \dp "no.such.schema"."no.such.access.privilege"
6524                             Access privileges
6525  Schema | Name | Type | Access privileges | Column privileges | Policies 
6526 --------+------+------+-------------------+-------------------+----------
6527 (0 rows)
6529 \dP "no.such.schema"."no.such.partitioned.relation"
6530            List of partitioned relations
6531  Schema | Name | Owner | Type | Parent name | Table 
6532 --------+------+-------+------+-------------+-------
6533 (0 rows)
6535 \drds "no.such.schema"."no.such.setting"
6536 improper qualified name (too many dotted names): "no.such.schema"."no.such.setting"
6537 \dRp "no.such.schema"."no.such.publication"
6538 improper qualified name (too many dotted names): "no.such.schema"."no.such.publication"
6539 \dRs "no.such.schema"."no.such.subscription"
6540 improper qualified name (too many dotted names): "no.such.schema"."no.such.subscription"
6541 \dT "no.such.schema"."no.such.data.type"
6542      List of data types
6543  Schema | Name | Description 
6544 --------+------+-------------
6545 (0 rows)
6547 \dx "no.such.schema"."no.such.installed.extension"
6548 improper qualified name (too many dotted names): "no.such.schema"."no.such.installed.extension"
6549 \dX "no.such.schema"."no.such.extended.statistics"
6550                  List of extended statistics
6551  Schema | Name | Definition | Ndistinct | Dependencies | MCV 
6552 --------+------+------------+-----------+--------------+-----
6553 (0 rows)
6555 \dy "no.such.schema"."no.such.event.trigger"
6556 improper qualified name (too many dotted names): "no.such.schema"."no.such.event.trigger"
6557 -- again, but with current database and dotted schema qualifications.
6558 \dt regression."no.such.schema"."no.such.table.relation"
6559       List of relations
6560  Schema | Name | Type | Owner 
6561 --------+------+------+-------
6562 (0 rows)
6564 \da regression."no.such.schema"."no.such.aggregate.function"
6565                      List of aggregate functions
6566  Schema | Name | Result data type | Argument data types | Description 
6567 --------+------+------------------+---------------------+-------------
6568 (0 rows)
6570 \dc regression."no.such.schema"."no.such.conversion"
6571                List of conversions
6572  Schema | Name | Source | Destination | Default? 
6573 --------+------+--------+-------------+----------
6574 (0 rows)
6576 \dC regression."no.such.schema"."no.such.cast"
6577                   List of casts
6578  Source type | Target type | Function | Implicit? 
6579 -------------+-------------+----------+-----------
6580 (0 rows)
6582 \dd regression."no.such.schema"."no.such.object.description"
6583          Object descriptions
6584  Schema | Name | Object | Description 
6585 --------+------+--------+-------------
6586 (0 rows)
6588 \dD regression."no.such.schema"."no.such.domain"
6589                         List of domains
6590  Schema | Name | Type | Collation | Nullable | Default | Check 
6591 --------+------+------+-----------+----------+---------+-------
6592 (0 rows)
6594 \di regression."no.such.schema"."no.such.index.relation"
6595           List of relations
6596  Schema | Name | Type | Owner | Table 
6597 --------+------+------+-------+-------
6598 (0 rows)
6600 \dm regression."no.such.schema"."no.such.materialized.view"
6601       List of relations
6602  Schema | Name | Type | Owner 
6603 --------+------+------+-------
6604 (0 rows)
6606 \ds regression."no.such.schema"."no.such.relation"
6607       List of relations
6608  Schema | Name | Type | Owner 
6609 --------+------+------+-------
6610 (0 rows)
6612 \dt regression."no.such.schema"."no.such.relation"
6613       List of relations
6614  Schema | Name | Type | Owner 
6615 --------+------+------+-------
6616 (0 rows)
6618 \dv regression."no.such.schema"."no.such.relation"
6619       List of relations
6620  Schema | Name | Type | Owner 
6621 --------+------+------+-------
6622 (0 rows)
6624 \df regression."no.such.schema"."no.such.function"
6625                        List of functions
6626  Schema | Name | Result data type | Argument data types | Type 
6627 --------+------+------------------+---------------------+------
6628 (0 rows)
6630 \dF regression."no.such.schema"."no.such.text.search.configuration"
6631 List of text search configurations
6632  Schema | Name | Description 
6633 --------+------+-------------
6634 (0 rows)
6636 \dFd regression."no.such.schema"."no.such.text.search.dictionary"
6637 List of text search dictionaries
6638  Schema | Name | Description 
6639 --------+------+-------------
6640 (0 rows)
6642 \dFp regression."no.such.schema"."no.such.text.search.parser"
6643  List of text search parsers
6644  Schema | Name | Description 
6645 --------+------+-------------
6646 (0 rows)
6648 \dFt regression."no.such.schema"."no.such.text.search.template"
6649 List of text search templates
6650  Schema | Name | Description 
6651 --------+------+-------------
6652 (0 rows)
6654 \do regression."no.such.schema"."no.such.operator"
6655                              List of operators
6656  Schema | Name | Left arg type | Right arg type | Result type | Description 
6657 --------+------+---------------+----------------+-------------+-------------
6658 (0 rows)
6660 \dO regression."no.such.schema"."no.such.collation"
6661                                 List of collations
6662  Schema | Name | Provider | Collate | Ctype | Locale | ICU Rules | Deterministic? 
6663 --------+------+----------+---------+-------+--------+-----------+----------------
6664 (0 rows)
6666 \dp regression."no.such.schema"."no.such.access.privilege"
6667                             Access privileges
6668  Schema | Name | Type | Access privileges | Column privileges | Policies 
6669 --------+------+------+-------------------+-------------------+----------
6670 (0 rows)
6672 \dP regression."no.such.schema"."no.such.partitioned.relation"
6673            List of partitioned relations
6674  Schema | Name | Owner | Type | Parent name | Table 
6675 --------+------+-------+------+-------------+-------
6676 (0 rows)
6678 \dT regression."no.such.schema"."no.such.data.type"
6679      List of data types
6680  Schema | Name | Description 
6681 --------+------+-------------
6682 (0 rows)
6684 \dX regression."no.such.schema"."no.such.extended.statistics"
6685                  List of extended statistics
6686  Schema | Name | Definition | Ndistinct | Dependencies | MCV 
6687 --------+------+------------+-----------+--------------+-----
6688 (0 rows)
6690 -- again, but with dotted database and dotted schema qualifications.
6691 \dt "no.such.database"."no.such.schema"."no.such.table.relation"
6692 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.table.relation"
6693 \da "no.such.database"."no.such.schema"."no.such.aggregate.function"
6694 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.aggregate.function"
6695 \dc "no.such.database"."no.such.schema"."no.such.conversion"
6696 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.conversion"
6697 \dC "no.such.database"."no.such.schema"."no.such.cast"
6698 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.cast"
6699 \dd "no.such.database"."no.such.schema"."no.such.object.description"
6700 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.object.description"
6701 \dD "no.such.database"."no.such.schema"."no.such.domain"
6702 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.domain"
6703 \ddp "no.such.database"."no.such.schema"."no.such.default.access.privilege"
6704 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.default.access.privilege"
6705 \di "no.such.database"."no.such.schema"."no.such.index.relation"
6706 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.index.relation"
6707 \dm "no.such.database"."no.such.schema"."no.such.materialized.view"
6708 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.materialized.view"
6709 \ds "no.such.database"."no.such.schema"."no.such.relation"
6710 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.relation"
6711 \dt "no.such.database"."no.such.schema"."no.such.relation"
6712 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.relation"
6713 \dv "no.such.database"."no.such.schema"."no.such.relation"
6714 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.relation"
6715 \df "no.such.database"."no.such.schema"."no.such.function"
6716 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.function"
6717 \dF "no.such.database"."no.such.schema"."no.such.text.search.configuration"
6718 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.text.search.configuration"
6719 \dFd "no.such.database"."no.such.schema"."no.such.text.search.dictionary"
6720 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.text.search.dictionary"
6721 \dFp "no.such.database"."no.such.schema"."no.such.text.search.parser"
6722 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.text.search.parser"
6723 \dFt "no.such.database"."no.such.schema"."no.such.text.search.template"
6724 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.text.search.template"
6725 \do "no.such.database"."no.such.schema"."no.such.operator"
6726 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.operator"
6727 \dO "no.such.database"."no.such.schema"."no.such.collation"
6728 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.collation"
6729 \dp "no.such.database"."no.such.schema"."no.such.access.privilege"
6730 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.access.privilege"
6731 \dP "no.such.database"."no.such.schema"."no.such.partitioned.relation"
6732 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.partitioned.relation"
6733 \dT "no.such.database"."no.such.schema"."no.such.data.type"
6734 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.data.type"
6735 \dX "no.such.database"."no.such.schema"."no.such.extended.statistics"
6736 cross-database references are not implemented: "no.such.database"."no.such.schema"."no.such.extended.statistics"
6737 -- check \drg and \du
6738 CREATE ROLE regress_du_role0;
6739 CREATE ROLE regress_du_role1;
6740 CREATE ROLE regress_du_role2;
6741 CREATE ROLE regress_du_admin;
6742 GRANT regress_du_role0 TO regress_du_admin WITH ADMIN TRUE;
6743 GRANT regress_du_role1 TO regress_du_admin WITH ADMIN TRUE;
6744 GRANT regress_du_role2 TO regress_du_admin WITH ADMIN TRUE;
6745 GRANT regress_du_role0 TO regress_du_role1 WITH ADMIN TRUE,  INHERIT TRUE,  SET TRUE  GRANTED BY regress_du_admin;
6746 GRANT regress_du_role0 TO regress_du_role2 WITH ADMIN TRUE,  INHERIT FALSE, SET FALSE GRANTED BY regress_du_admin;
6747 GRANT regress_du_role1 TO regress_du_role2 WITH ADMIN TRUE , INHERIT FALSE, SET TRUE  GRANTED BY regress_du_admin;
6748 GRANT regress_du_role0 TO regress_du_role1 WITH ADMIN FALSE, INHERIT TRUE,  SET FALSE GRANTED BY regress_du_role1;
6749 GRANT regress_du_role0 TO regress_du_role2 WITH ADMIN FALSE, INHERIT TRUE , SET TRUE  GRANTED BY regress_du_role1;
6750 GRANT regress_du_role0 TO regress_du_role1 WITH ADMIN FALSE, INHERIT FALSE, SET TRUE  GRANTED BY regress_du_role2;
6751 GRANT regress_du_role0 TO regress_du_role2 WITH ADMIN FALSE, INHERIT FALSE, SET FALSE GRANTED BY regress_du_role2;
6752 \drg regress_du_role*
6753                              List of role grants
6754     Role name     |    Member of     |       Options       |     Grantor      
6755 ------------------+------------------+---------------------+------------------
6756  regress_du_role1 | regress_du_role0 | ADMIN, INHERIT, SET | regress_du_admin
6757  regress_du_role1 | regress_du_role0 | INHERIT             | regress_du_role1
6758  regress_du_role1 | regress_du_role0 | SET                 | regress_du_role2
6759  regress_du_role2 | regress_du_role0 | ADMIN               | regress_du_admin
6760  regress_du_role2 | regress_du_role0 | INHERIT, SET        | regress_du_role1
6761  regress_du_role2 | regress_du_role0 |                     | regress_du_role2
6762  regress_du_role2 | regress_du_role1 | ADMIN, SET          | regress_du_admin
6763 (7 rows)
6765 \du regress_du_role*
6766           List of roles
6767     Role name     |  Attributes  
6768 ------------------+--------------
6769  regress_du_role0 | Cannot login
6770  regress_du_role1 | Cannot login
6771  regress_du_role2 | Cannot login
6773 DROP ROLE regress_du_role0;
6774 DROP ROLE regress_du_role1;
6775 DROP ROLE regress_du_role2;
6776 DROP ROLE regress_du_admin;
6777 -- Test display of empty privileges.
6778 BEGIN;
6779 -- Create an owner for tested objects because output contains owner name.
6780 CREATE ROLE regress_zeropriv_owner;
6781 SET LOCAL ROLE regress_zeropriv_owner;
6782 CREATE DOMAIN regress_zeropriv_domain AS int;
6783 REVOKE ALL ON DOMAIN regress_zeropriv_domain FROM CURRENT_USER, PUBLIC;
6784 \dD+ regress_zeropriv_domain
6785                                                     List of domains
6786  Schema |          Name           |  Type   | Collation | Nullable | Default | Check | Access privileges | Description 
6787 --------+-------------------------+---------+-----------+----------+---------+-------+-------------------+-------------
6788  public | regress_zeropriv_domain | integer |           |          |         |       | (none)            | 
6789 (1 row)
6791 CREATE PROCEDURE regress_zeropriv_proc() LANGUAGE sql AS '';
6792 REVOKE ALL ON PROCEDURE regress_zeropriv_proc() FROM CURRENT_USER, PUBLIC;
6793 \df+ regress_zeropriv_proc
6794                                                                                             List of functions
6795  Schema |         Name          | Result data type | Argument data types | Type | Volatility | Parallel |         Owner          | Security | Access privileges | Language | Internal name | Description 
6796 --------+-----------------------+------------------+---------------------+------+------------+----------+------------------------+----------+-------------------+----------+---------------+-------------
6797  public | regress_zeropriv_proc |                  |                     | proc | volatile   | unsafe   | regress_zeropriv_owner | invoker  | (none)            | sql      |               | 
6798 (1 row)
6800 CREATE TABLE regress_zeropriv_tbl (a int);
6801 REVOKE ALL ON TABLE regress_zeropriv_tbl FROM CURRENT_USER;
6802 \dp regress_zeropriv_tbl
6803                                     Access privileges
6804  Schema |         Name         | Type  | Access privileges | Column privileges | Policies 
6805 --------+----------------------+-------+-------------------+-------------------+----------
6806  public | regress_zeropriv_tbl | table | (none)            |                   | 
6807 (1 row)
6809 CREATE TYPE regress_zeropriv_type AS (a int);
6810 REVOKE ALL ON TYPE regress_zeropriv_type FROM CURRENT_USER, PUBLIC;
6811 \dT+ regress_zeropriv_type
6812                                                           List of data types
6813  Schema |         Name          |     Internal name     | Size  | Elements |         Owner          | Access privileges | Description 
6814 --------+-----------------------+-----------------------+-------+----------+------------------------+-------------------+-------------
6815  public | regress_zeropriv_type | regress_zeropriv_type | tuple |          | regress_zeropriv_owner | (none)            | 
6816 (1 row)
6818 ROLLBACK;
6819 -- Test display of default privileges with \pset null.
6820 CREATE TABLE defprivs (a int);
6821 \pset null '(default)'
6822 \z defprivs
6823                               Access privileges
6824  Schema |   Name   | Type  | Access privileges | Column privileges | Policies 
6825 --------+----------+-------+-------------------+-------------------+----------
6826  public | defprivs | table | (default)         |                   | 
6827 (1 row)
6829 \pset null ''
6830 DROP TABLE defprivs;