Meta-Commands Quick Reference

Syntax Summary Command‑line Options
\! [cmd] Executes a command in a Linux shell (passing arguments as entered) or starts an interactive shell.  
\? Displays help information about all meta-commands, the same as \h. ?
\a

Toggles output format alignment. For details, see \pset format aligned.

‑A
‑no‑align

\b Toggles beep on command completion.  
\c[connect] [db [user‑name]]

Establishes a connection to database db, under the specified user user‑name. For details, see \connect.

 
\C ['title-str']

Sets a title title‑str that precedes query result output. For details, see \pset title title-str.

 
\cd [dir] Changes the current working directory to dir, changes to your home directory if you omit specifying a directory.  
\d commands See \d Meta-Commands  
\e[dit] [file] Edits the query buffer (or specified file) with an external editor. For details, see \edit.  
\echo [str]

Writes str to standard output.

Use \qecho to redirect query output to the query output stream, as set by \o.

 
\f [str] Sets the field separator for unaligned query output. The default is the vertical bar (|). ‑F
‑‑field‑separator
\g [file‑name | shell‑command] Sends the query in the input buffer (see \p) to the server. You can send query results to file‑name, or pipe results to shell‑comand; otherwise, \g sends query results to standard output.  
\H Renders output in HTML markup as a table. For details, see \pset format aligned. ‑H
‑‑html
\h[elp] Displays help information about the meta-commands, the same as \?. ‑‑help
\i file Reads and executes input from filename. ‑f
‑‑file
\l
\list
Lists available databases and owners. ‑l
‑‑list
\locale [locale] Displays the current locale setting or sets a new locale for the session. For details, see \locale.  
\o [file‑name | shell‑command]

Controls where vsql directs query output. You can send query results to file‑name, or pipe results to shell‑comand; otherwise, \o sends query results to standard output.

‑o
‑‑output
\p Prints the current query buffer to standard output.  
\password [user‑name] Starts the password change process. Superusers can specify a user name to change that user's password; otherwise, users can only change their own passwords.  
\pset output‑option Sets options that control how Vertica formats query result output. For details, see \pset. ‑P
‑‑pset
\q Quits the vsql program  
\qecho [str] Writes str to the query output stream, as specified by by \o.  
\r Clears (resets) the query buffer  
\s [file] Valid only if vsql is configured to use the GNU Readline library, prints or saves the command line history to file, or to standard output if no file name is supplied.  
\set [var [value]…]

Sets internal variable var to value. If you specify multiple values, var is set to their concantenated values. If no values are specified, var is set to no value.

‑‑set
‑v
‑‑variable

\t Toggles between tuples only and full display. For details, see \pset format tuples_only. ‑t
‑‑tuples-only
\T html‑attribute[…] Specifies attributes to be placed inside the HTML table tag—for example, cellpadding or bgcolor, the same as \pset tableattr html‑attribute[…]. For sample usage, see Output Formatting Examples. ‑T
‑‑table-attr
\timing If set to on, returns how long (in milliseconds) each SQL statement runs. For details, see \timing. ‑i
‑‑ timing
\unset var Deletes internal variable var that was set by the meta-command \set .  
\w file‑name Outputs the current query buffer to file file‑name.  
\x

Toggles between regular and expanded format. For details, see \pset format expanded.

‑x
‑‑expanded
\z

Returns a summary of privileges on all objects in system table V_CATALOG.GRANTS: grantee, grantor, privileges, schema, and object name (equivalent to \dp).

\z supports the same options as \dp for filtering output by schema and object name patterns, . For example:

> \z *.*myseq*
     Access privileges for database "dbadmin"
 Grantee | Grantor | Privileges | Schema |  Name
---------+---------+------------+--------+--------
 dbadmin | dbadmin | SELECT*    | public | mySeq
 dbadmin | dbadmin | SELECT*    | public | mySeq2
(2 rows)