Database Reference
In-Depth Information
------
1
(1 row)
You can tell when you're seeing a regular output because it will end up showing the
number of rows.
This type of output is hard to fit into the text of a topic like this. It's easier to print the
output from what the program calls the expanded display, which breaks each column
into a separate line. You can switch to expanded using either the -x command-line
switch, or by sending \x to the psql program. Here is an example of using each:
$ psql -x -c "SELECT 1 AS test"
-[ RECORD 1 ]
test | 1
$ psql
psql (9.2.1)
Type "help" for help.
postgres=# \x
Expanded display is on.
postgres=# SELECT 1 AS test;
-[ RECORD 1 ]
test | 1
Notice how the expanded output doesn't show the row count, and it numbers each
output row. To save space, not all of the examples in the topic will show the expan-
ded output being turned on. You can normally tell which type you're seeing by differ-
ences like this, whether you're seeing rows or RECORD . The expanded mode will be
normally preferred when the output of the query is too wide to fit into the available
width of the topic.
Search WWH ::




Custom Search