0</userinput>
Border style is 0.
peter@localhost testdb=> <userinput>SELECT * FROM my_table;</userinput>
first second
----- ------
1 one
2 two
3 three
4 four
(4 rows)
peter@localhost testdb=> <userinput>\pset border 1</userinput>
Border style is 1.
peter@localhost testdb=> <userinput>\pset format csv</userinput>
Output format is csv.
peter@localhost testdb=> <userinput>\pset tuples_only</userinput>
Tuples only is on.
peter@localhost testdb=> <userinput>SELECT second, first FROM my_table;</userinput>
one,1
two,2
three,3
four,4
peter@localhost testdb=> <userinput>\pset format unaligned</userinput>
Output format is unaligned.
peter@localhost testdb=> <userinput>\pset fieldsep '\t'</userinput>
Field separator is " ".
peter@localhost testdb=> <userinput>SELECT second, first FROM my_table;</userinput>
one 1
two 2
three 3
four 4
</programlisting>
Alternatively, use the short commands:
<programlisting>
peter@localhost testdb=> <userinput>\a \t \x</userinput>
Output format is aligned.
Tuples only is off.
Expanded display is on.
peter@localhost testdb=> <userinput>SELECT * FROM my_table;</userinput>
-[ RECORD 1 ]-
first | 1
second | one
-[ RECORD 2 ]-
first | 2
second | two
-[ RECORD 3 ]-
first | 3
second | three
-[ RECORD 4 ]-
first | 4
second | four
</programlisting>
</para>
<para>
Also, these output format options can be set for just one query by using
<literal>\g</literal>:
<programlisting>
peter@localhost testdb=> <userinput>SELECT * FROM my_table</userinput>
peter@localhost testdb-> <userinput>\g (format=aligned tuples_only=off expanded=on)</userinput>
-[ RECORD 1 ]-
first | 1
second | one
-[ RECORD 2 ]-
first | 2
second | two
-[ RECORD 3 ]-
first | 3
second | three
-[ RECORD 4 ]-
first | 4
second | four
</programlisting>
</para>
<para>
Here is an example of using the <command>\df</command> command to
find only functions with names matching <literal>int*pl</literal>
and whose second argument is of type <type>bigint</type>:
<programlisting>
testdb=> <userinput>\df int*pl * bigint</userinput>
List of functions
Schema | Name | Result data type | Argument data types | Type
------------+---------+------------------+---------------------+------
pg_catalog | int28pl | bigint | smallint, bigint | func
pg_catalog