Change the VSQL Result Set Border

Jim_KnicelyJim_Knicely - Select Field - Administrator
edited October 2018 in Tips from the Team

vsql is a character-based, interactive, front-end utility that lets you type SQL statements and see the results. The results from vsql are formatted nicely with a border between columns. You are probably used to viewing border style 1, the default, but you may prefer border styles 0 or 2!

Example:

dbadmin=> \pset border
Border style is 1.

dbadmin=> SELECT * FROM test_table;
  name   | age | hair_color
---------+-----+-------------
Captain |   2 | Brown
Jane    |  39 | Black
Josh    |  17 | N/A
Lucy    |   5 | White/Brown
(4 rows)

dbadmin=> \pset border 0
Border style is 0.

dbadmin=> SELECT * FROM test_table;
name   age hair_color
------- --- -----------
Captain   2 Brown
Jane     39 Black
Josh     17 N/A
Lucy      5 White/Brown
(4 rows)

dbadmin=> \pset border 2
Border style is 2.

dbadmin=> SELECT * FROM test_table;
+---------+-----+-------------+
|  name   | age | hair_color  |
+---------+-----+-------------+
| Captain |   2 | Brown       |
| Jane    |  39 | Black       |
| Josh    |  17 | N/A         |
| Lucy    |   5 | White/Brown |
+---------+-----+-------------+
(4 rows)

Helpful link:
https://www.vertica.com/docs/9.1.x/HTML/index.htm#Authoring/ConnectingToVertica/vsql/Meta-Commands/psetNAMEVALUE.htm

Have fun!

Sign In or Register to comment.