+l|2
|====
deallocate q;
+-- test html output format
+\pset format html
+\pset border 1
+\pset expanded off
+\d psql_serial_tab_id_seq
+
+
Sequence "public.psql_serial_tab_id_seq"
+
+
Type |
+
Start |
+
Minimum |
+
Maximum |
+
Increment |
+
Cycles? |
+
Cache |
+
+
+
integer |
+
1 |
+
1 |
+
2147483647 |
+
1 |
+
no |
+
1 |
+
+
+
Owned by: public.psql_serial_tab.id
+
+\pset tuples_only true
+\df exp
+
+
+
pg_catalog |
+
exp |
+
double precision |
+
double precision |
+
func |
+
+
+
pg_catalog |
+
exp |
+
numeric |
+
numeric |
+
func |
+
+
+
+\pset tuples_only false
+\pset expanded on
+\d psql_serial_tab_id_seq
+
+
Sequence "public.psql_serial_tab_id_seq"
+
+
Record 1 |
+
+
Maximum |
+
2147483647 |
+
+
+
Owned by: public.psql_serial_tab.id
+
+\pset tuples_only true
+\df exp
+
+
+
|
+
+
Schema |
+
pg_catalog |
+
+
+
Result data type |
+
double precision |
+
+
+
Argument data types |
+
double precision |
+
+
+
|
+
+
Schema |
+
pg_catalog |
+
+
+
Result data type |
+
numeric |
+
+
+
Argument data types |
+
numeric |
+
+
+
+\pset tuples_only false
+prepare q as
+ select 'some"text' as "a&title", E' \n' as "junk",
+ ' ' as "empty", n as int
+ from generate_series(1,2) as n;
+\pset expanded off
+\pset border 0
+execute q;
+
+
+
a&title |
+
junk |
+
empty |
+
int |
+
+
+
+\pset border 1
+execute q;
+
+
+
a&title |
+
junk |
+
empty |
+
int |
+
+
+
+\pset tableattr foobar
+execute q;
+
+
+
a&title |
+
junk |
+
empty |
+
int |
+
+
+
+\pset tableattr
+\pset expanded on
+\pset border 0
+execute q;
+
+
+
Record 1 |
+
+
a&title |
+
some"text |
+
+
+
Record 2 |
+
+
a&title |
+
some"text |
+
+
+
+\pset border 1
+execute q;
+
+
+
Record 1 |
+
+
a&title |
+
some"text |
+
+
+
Record 2 |
+
+
a&title |
+
some"text |
+
+
+
+\pset tableattr foobar
+execute q;
+
+
+
Record 1 |
+
+
a&title |
+
some"text |
+
+
+
Record 2 |
+
+
a&title |
+
some"text |
+
+
+
+\pset tableattr
+deallocate q;
+-- test latex output format
+\pset format latex
+\pset border 1
+\pset expanded off
+\d psql_serial_tab_id_seq
+\begin{center}
+Sequence "public.psql\_serial\_tab\_id\_seq"
+\end{center}
+
+\begin{tabular}{l | r | r | r | r | l | r}
+\textit{Type} & \textit{Start} & \textit{Minimum} & \textit{Maximum} & \textit{Increment} & \textit{Cycles?} & \textit{Cache} \\
+\hline
+integer & 1 & 1 & 2147483647 & 1 & no & 1 \\
+\end{tabular}
+
+\noindent Owned by: public.psql\_serial\_tab.id \\
+
+\pset tuples_only true
+\df exp
+\begin{tabular}{l | l | l | l | l}
+pg\_catalog & exp & double precision & double precision & func \\
+pg\_catalog & exp & numeric & numeric & func \\
+\end{tabular}
+
+\noindent
+\pset tuples_only false
+\pset expanded on
+\d psql_serial_tab_id_seq
+\begin{center}
+Sequence "public.psql\_serial\_tab\_id\_seq"
+\end{center}
+
+\begin{tabular}{c|l}
+\multicolumn{2}{c}{\textit{Record 1}} \\
+\hline
+Type & integer \\
+Start & 1 \\
+Minimum & 1 \\
+Maximum & 2147483647 \\
+Increment & 1 \\
+Cycles? & no \\
+Cache & 1 \\
+\end{tabular}
+
+\noindent Owned by: public.psql\_serial\_tab.id \\
+
+\pset tuples_only true
+\df exp
+\begin{tabular}{c|l}
+\hline
+Schema & pg\_catalog \\
+Name & exp \\
+Result data type & double precision \\
+Argument data types & double precision \\
+Type & func \\
+\hline
+Schema & pg\_catalog \\
+Name & exp \\
+Result data type & numeric \\
+Argument data types & numeric \\
+Type & func \\
+\end{tabular}
+
+\noindent
+\pset tuples_only false
+prepare q as
+ select 'some\more_text' as "a$title", E' &foo%\n{bar}' as "junk",
+ ' ' as "empty", n as int
+ from generate_series(1,2) as n;
+\pset expanded off
+\pset border 0
+execute q;
+\begin{tabular}{lllr}
+\textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
+\hline
+some\backslashmore\_text & \&foo\%\\\{bar\} & & 1 \\
+some\backslashmore\_text & \&foo\%\\\{bar\} & & 2 \\
+\end{tabular}
+
+\noindent (2 rows) \\
+
+\pset border 1
+execute q;
+\begin{tabular}{l | l | l | r}
+\textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
+\hline
+some\backslashmore\_text & \&foo\%\\\{bar\} & & 1 \\
+some\backslashmore\_text & \&foo\%\\\{bar\} & & 2 \\
+\end{tabular}
+
+\noindent (2 rows) \\
+
+\pset border 2
+execute q;
+\begin{tabular}{| l | l | l | r |}
+\hline
+\textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
+\hline
+some\backslashmore\_text & \&foo\%\\\{bar\} & & 1 \\
+some\backslashmore\_text & \&foo\%\\\{bar\} & & 2 \\
+\hline
+\end{tabular}
+
+\noindent (2 rows) \\
+
+\pset border 3
+execute q;
+\begin{tabular}{| l | l | l | r |}
+\hline
+\textit{a\$title} & \textit{junk} & \textit{empty} & \textit{int} \\
+\hline
+some\backslashmore\_text & \&foo\%\\\{bar\} & & 1 \\
+\hline
+some\backslashmore\_text & \&foo\%\\\{bar\} & & 2 \\
+\hline
+\end{tabular}
+
+\noindent (2 rows) \\
+
+\pset expanded on
+\pset border 0
+execute q;
+\begin{tabular}{cl}
+\multicolumn{2}{c}{\textit{Record 1}} \\
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\multicolumn{2}{c}{\textit{Record 2}} \\
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\end{tabular}
+
+\noindent
+\pset border 1
+execute q;
+\begin{tabular}{c|l}
+\multicolumn{2}{c}{\textit{Record 1}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\multicolumn{2}{c}{\textit{Record 2}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\end{tabular}
+
+\noindent
+\pset border 2
+execute q;
+\begin{tabular}{|c|l|}
+\hline
+\multicolumn{2}{|c|}{\textit{Record 1}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\hline
+\multicolumn{2}{|c|}{\textit{Record 2}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\hline
+\end{tabular}
+
+\noindent
+\pset border 3
+execute q;
+\begin{tabular}{|c|l|}
+\hline
+\multicolumn{2}{|c|}{\textit{Record 1}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\hline
+\multicolumn{2}{|c|}{\textit{Record 2}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\hline
+\end{tabular}
+
+\noindent
+deallocate q;
+-- test latex-longtable output format
+\pset format latex-longtable
+\pset border 1
+\pset expanded off
+\d psql_serial_tab_id_seq
+\begin{longtable}{l | r | r | r | r | l | r}
+\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}} \\
+\midrule
+\endfirsthead
+\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}} \\
+\midrule
+\endhead
+\caption[Sequence "public.psql\_serial\_tab\_id\_seq" (Continued)]{Sequence "public.psql\_serial\_tab\_id\_seq"}
+\endfoot
+\caption[Sequence "public.psql\_serial\_tab\_id\_seq"]{Sequence "public.psql\_serial\_tab\_id\_seq"}
+\endlastfoot
+\raggedright{integer}
+&
+\raggedright{1}
+&
+\raggedright{1}
+&
+\raggedright{2147483647}
+&
+\raggedright{1}
+&
+\raggedright{no}
+&
+\raggedright{1} \tabularnewline
+\end{longtable}
+\pset tuples_only true
+\df exp
+\begin{longtable}{l | l | l | l | l}
+\raggedright{pg\_catalog}
+&
+\raggedright{exp}
+&
+\raggedright{double precision}
+&
+\raggedright{double precision}
+&
+\raggedright{func} \tabularnewline
+\raggedright{pg\_catalog}
+&
+\raggedright{exp}
+&
+\raggedright{numeric}
+&
+\raggedright{numeric}
+&
+\raggedright{func} \tabularnewline
+\end{longtable}
+\pset tuples_only false
+\pset expanded on
+\d psql_serial_tab_id_seq
+\begin{center}
+Sequence "public.psql\_serial\_tab\_id\_seq"
+\end{center}
+
+\begin{tabular}{c|l}
+\multicolumn{2}{c}{\textit{Record 1}} \\
+\hline
+Type & integer \\
+Start & 1 \\
+Minimum & 1 \\
+Maximum & 2147483647 \\
+Increment & 1 \\
+Cycles? & no \\
+Cache & 1 \\
+\end{tabular}
+
+\noindent Owned by: public.psql\_serial\_tab.id \\
+
+\pset tuples_only true
+\df exp
+\begin{tabular}{c|l}
+\hline
+Schema & pg\_catalog \\
+Name & exp \\
+Result data type & double precision \\
+Argument data types & double precision \\
+Type & func \\
+\hline
+Schema & pg\_catalog \\
+Name & exp \\
+Result data type & numeric \\
+Argument data types & numeric \\
+Type & func \\
+\end{tabular}
+
+\noindent
+\pset tuples_only false
+prepare q as
+ select 'some\more_text' as "a$title", E' &foo%\n{bar}' as "junk",
+ ' ' as "empty", n as int
+ from generate_series(1,2) as n;
+\pset expanded off
+\pset border 0
+execute q;
+\begin{longtable}{lllr}
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\midrule
+\endfirsthead
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\midrule
+\endhead
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{1} \tabularnewline
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{2} \tabularnewline
+\end{longtable}
+\pset border 1
+execute q;
+\begin{longtable}{l | l | l | r}
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\midrule
+\endfirsthead
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\midrule
+\endhead
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{1} \tabularnewline
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{2} \tabularnewline
+\end{longtable}
+\pset border 2
+execute q;
+\begin{longtable}{| l | l | l | r |}
+\toprule
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\midrule
+\endfirsthead
+\toprule
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\midrule
+\endhead
+\bottomrule
+\endfoot
+\bottomrule
+\endlastfoot
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{1} \tabularnewline
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{2} \tabularnewline
+\end{longtable}
+\pset border 3
+execute q;
+\begin{longtable}{| l | l | l | r |}
+\toprule
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\midrule
+\endfirsthead
+\toprule
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\endhead
+\bottomrule
+\endfoot
+\bottomrule
+\endlastfoot
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{1} \tabularnewline
+ \hline
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{2} \tabularnewline
+ \hline
+\end{longtable}
+\pset tableattr lr
+execute q;
+\begin{longtable}{| p{lr\textwidth} | p{lr\textwidth} | p{lr\textwidth} | r |}
+\toprule
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\midrule
+\endfirsthead
+\toprule
+\small\textbf{\textit{a\$title}} & \small\textbf{\textit{junk}} & \small\textbf{\textit{empty}} & \small\textbf{\textit{int}} \\
+\endhead
+\bottomrule
+\endfoot
+\bottomrule
+\endlastfoot
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{1} \tabularnewline
+ \hline
+\raggedright{some\backslashmore\_text}
+&
+\raggedright{ \&foo\%\\\{bar\}}
+&
+\raggedright{ }
+&
+\raggedright{2} \tabularnewline
+ \hline
+\end{longtable}
+\pset tableattr
+\pset expanded on
+\pset border 0
+execute q;
+\begin{tabular}{cl}
+\multicolumn{2}{c}{\textit{Record 1}} \\
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\multicolumn{2}{c}{\textit{Record 2}} \\
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\end{tabular}
+
+\noindent
+\pset border 1
+execute q;
+\begin{tabular}{c|l}
+\multicolumn{2}{c}{\textit{Record 1}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\multicolumn{2}{c}{\textit{Record 2}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\end{tabular}
+
+\noindent
+\pset border 2
+execute q;
+\begin{tabular}{|c|l|}
+\hline
+\multicolumn{2}{|c|}{\textit{Record 1}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\hline
+\multicolumn{2}{|c|}{\textit{Record 2}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\hline
+\end{tabular}
+
+\noindent
+\pset border 3
+execute q;
+\begin{tabular}{|c|l|}
+\hline
+\multicolumn{2}{|c|}{\textit{Record 1}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\hline
+\multicolumn{2}{|c|}{\textit{Record 2}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\hline
+\end{tabular}
+
+\noindent
+\pset tableattr lr
+execute q;
+\begin{tabular}{|c|l|}
+\hline
+\multicolumn{2}{|c|}{\textit{Record 1}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 1 \\
+\hline
+\multicolumn{2}{|c|}{\textit{Record 2}} \\
+\hline
+a\$title & some\backslashmore\_text \\
+junk & \&foo\%\\\{bar\} \\
+empty & \\
+int & 2 \\
+\hline
+\end{tabular}
+
+\noindent
+\pset tableattr
+deallocate q;
+-- test troff-ms output format
+\pset format troff-ms
+\pset border 1
+\pset expanded off
+\d psql_serial_tab_id_seq
+.LP
+.DS C
+Sequence "public.psql_serial_tab_id_seq"
+.DE
+.LP
+.TS
+center;
+l | r | r | r | r | l | r.
+\fIType\fP \fIStart\fP \fIMinimum\fP \fIMaximum\fP \fIIncrement\fP \fICycles?\fP \fICache\fP
+_
+integer 1 1 2147483647 1 no 1
+.TE
+.DS L
+Owned by: public.psql_serial_tab.id
+.DE
+\pset tuples_only true
+\df exp
+.LP
+.TS
+center;
+l | l | l | l | l.
+pg_catalog exp double precision double precision func
+pg_catalog exp numeric numeric func
+.TE
+.DS L
+.DE
+\pset tuples_only false
+\pset expanded on
+\d psql_serial_tab_id_seq
+.LP
+.DS C
+Sequence "public.psql_serial_tab_id_seq"
+.DE
+.LP
+.TS
+center;
+c s.
+\fIRecord 1\fP
+_
+.T&
+c | l.
+Type integer
+Start 1
+Minimum 1
+Maximum 2147483647
+Increment 1
+Cycles? no
+Cache 1
+.TE
+.DS L
+Owned by: public.psql_serial_tab.id
+.DE
+\pset tuples_only true
+\df exp
+.LP
+.TS
+center;
+c l;
+_
+Schema pg_catalog
+Name exp
+Result data type double precision
+Argument data types double precision
+Type func
+_
+Schema pg_catalog
+Name exp
+Result data type numeric
+Argument data types numeric
+Type func
+.TE
+.DS L
+.DE
+\pset tuples_only false
+prepare q as
+ select 'some\text' as "a\title", E' \n' as "junk",
+ ' ' as "empty", n as int
+ from generate_series(1,2) as n;
+\pset expanded off
+\pset border 0
+execute q;
+.LP
+.TS
+center;
+lllr.
+\fIa\(rstitle\fP \fIjunk\fP \fIempty\fP \fIint\fP
+_
+some\(rstext
+ 1
+some\(rstext
+ 2
+.TE
+.DS L
+(2 rows)
+.DE
+\pset border 1
+execute q;
+.LP
+.TS
+center;
+l | l | l | r.
+\fIa\(rstitle\fP \fIjunk\fP \fIempty\fP \fIint\fP
+_
+some\(rstext
+ 1
+some\(rstext
+ 2
+.TE
+.DS L
+(2 rows)
+.DE
+\pset border 2
+execute q;
+.LP
+.TS
+center box;
+l | l | l | r.
+\fIa\(rstitle\fP \fIjunk\fP \fIempty\fP \fIint\fP
+_
+some\(rstext
+ 1
+some\(rstext
+ 2
+.TE
+.DS L
+(2 rows)
+.DE
+\pset expanded on
+\pset border 0
+execute q;
+.LP
+.TS
+center;
+c s.
+\fIRecord 1\fP
+.T&
+c l.
+a\(rstitle some\(rstext
+junk
+
+empty
+int 1
+.T&
+c s.
+\fIRecord 2\fP
+.T&
+c l.
+a\(rstitle some\(rstext
+junk
+
+empty
+int 2
+.TE
+.DS L
+.DE
+\pset border 1
+execute q;
+.LP
+.TS
+center;
+c s.
+\fIRecord 1\fP
+_
+.T&
+c | l.
+a\(rstitle some\(rstext
+junk
+
+empty
+int 1
+.T&
+c s.
+\fIRecord 2\fP
+_
+.T&
+c | l.
+a\(rstitle some\(rstext
+junk
+
+empty
+int 2
+.TE
+.DS L
+.DE
+\pset border 2
+execute q;
+.LP
+.TS
+center box;
+c s.
+\fIRecord 1\fP
+_
+.T&
+c l.
+a\(rstitle some\(rstext
+junk
+
+empty
+int 1
+_
+.T&
+c s.
+\fIRecord 2\fP
+_
+.T&
+c l.
+a\(rstitle some\(rstext
+junk
+
+empty
+int 2
+.TE
+.DS L
+.DE
+deallocate q;
+-- check ambiguous format requests
+\pset format a
+\pset: ambiguous abbreviation "a" matches both "aligned" and "asciidoc"
+\pset format l
+-- clean up after output format tests
+drop table psql_serial_tab;
\pset format aligned
\pset expanded off
\pset border 1