Internal slash options
The following table describes the nzsql internal slash options.
Option | Description |
---|---|
\a | Toggles between unaligned and aligned mode |
\act | Shows the current active sessions |
\c[onnect] [dbname [user] [password]] | Connects to a new database |
\C title | Table title |
\copy ... | Performs a SQL COPY with data stream to the client machine |
\d table | Describes the table (or view, index, sequence, synonym) Note: For
the \d options, you can add a plus sign (+) for verbose
output. For example, \d+ table or \dpu+ name.
|
\d{t|v|i|s|e|x} | Lists tables/views/indices/sequences/temp tables/external tables |
\d{m|y} | Lists materialized views/synonyms |
\dS{t|v|i|s} | Lists system tables/views/indexes/sequences |
\dM{t|v|i|s} | Lists system management tables/views/indexes/sequences |
\dp name | Lists user permissions |
\dpu name | Lists permissions that are granted to a user |
\dpg name | Lists permissions that are granted to a group |
\dgp name | Lists grant permissions for a user |
\dgpu name | Lists grant permissions that are granted to a user |
\dgpg name | Lists grant permissions that are granted to a group |
\d{u|U} | Lists users/User Groups |
\d{g|G|Gr} | Lists groups/Group Users/Resource Group Users |
\da[+] name | Lists aggregates, + for more fields |
\dd [object] | Lists comment for table, type, function, or operator |
\df[+] name | Lists functions, + for more fields |
\dl[+] name | Lists libraries, + for more fields |
\do | Lists operators |
\dO name | Lists the columns for a table or a view in alphabetical order by column name. |
\dT | Lists data types |
\e [file] | Edits the current query buffer or [file] with external editor. This option is not supported for nzsql on Windows clients. |
\echo text | Writes the text to stdout |
\f sep | Changes the field separator |
\g [file] | Sends the query to the backend (and the results in [file] or | pipe) |
\h [cmd] | Provides help on syntax of SQL commands, type * for all commands |
\H | Toggles HTML mode (currently off) |
\i file | Reads and executes queries from file |
\l | Lists all databases |
\o [file] | Sends all query results to [file], or |pipe |
\p | Shows the content of the current query buffer |
\pset opt | Set table output opt = {format|border|expanded|fieldsep| null|recordsep|tuples_only|title|tableattr|pager} |
\q | Quits the nzsql command |
\qecho text | Writes text to query output stream (see \o) |
\r | Resets (clears) the query buffer |
\s [file] | Prints the history or saves it in [file]. This option is not supported for nzsql on Windows clients. |
\set var value | Sets an internal variable. The \set specified without any variable or argument displays a list of the current session variables and their values. |
\t | Displays only rows (currently off) |
\time | Prints the time that is taken by queries |
\T tags | HTML table tags |
\unset var | Unsets (deletes) the internal variable |
\w file | Writes current query buffer to file |
\x | Toggles expanded output (currently off) |
\! [cmd] | Shell escape or command. This option is not supported for nzsql on Windows clients. |