The meta commands of usql v0.19.13-0.20261129074835-be3acfadfc0c, in the sections of \?. A meta command starts with a backslash. An argument in brackets, such as [PATTERN], can be left out.
A group of letters in brackets after a name adds each combination of its letters. So\d[Sx+] is \d, \dS, \d+, \dS+ and the rest. S shows the objects of the system, xshows the result in expanded mode, and + shows more columns. \? leaves out the aliases, and \? commands lists them.
General
| Command | Description |
|---|
\q | quit usql |
\quit | alias for \q |
\copyright | show usage and distribution terms for usql |
\errverbose | show most recent error message at maximum verbosity |
\drivers | show database drivers available to usql |
Help
| Command | Description |
|---|
\? | show help on usql's meta (backslash) commands |
\? commands | as \?, but shows all command aliases |
\? options | show help on usql command-line options |
\? variables | show help on special usql variables |
\? styles | show usql syntax highlighting styles |
Connection
Query Execute
Query View
Query Buffer
(options: S = show system objects, x = expanded mode, + = additional detail)
| Command | Description |
|---|
\d[Sx+] [NAME] | list tables, views, and sequences or describe table, view, sequence, or index |
\d[tvmsEi][Sx+] | alias for \d[Sx+] |
\da[Sx+] [PATTERN] | list aggregates |
\dA[x+] [PATTERN] | list access methods |
\dAc[x+] [AMPTRN [PATTERN]] | list operator classes |
\dAf[x+] [AMPTRN [PATTERN]] | list operator families |
\dAo[x+] [AMPTRN [PATTERN]] | list operators of operator families |
\dAp[x+] [AMPTRN [PATTERN]] | list support functions of operator families |
\db[x+] [PATTERN] | list tablespaces |
\dc[Sx+] [PATTERN] | list conversions |
\dconfig[x+] [PATTERN] | list configuration parameters |
\dC[x+] [PATTERN] | list casts |
\dd[Sx] [PATTERN] | show object descriptions not displayed elsewhere |
\dD[Sx+] [PATTERN] | list domains |
\ddp[x] [PATTERN] | list default privileges |
\dE[Sx+] [PATTERN] | list foreign tables |
\des[x+] [PATTERN] | list foreign servers |
\det[x+] [PATTERN] | list foreign tables and their servers |
\deu[x+] [PATTERN] | list user mappings |
\dew[x+] [PATTERN] | list foreign-data wrappers |
\df[anptw][Sx+] [NAME [TYPES]] | list [only agg/normal/procedure/trigger/window] functions |
\dF[x+] [PATTERN] | list text search configurations |
\dFd[x+] [PATTERN] | list text search dictionaries |
\dFp[x+] [PATTERN] | list text search parsers |
\dFt[x+] [PATTERN] | list text search templates |
\dg[Sx+] [PATTERN] | list roles |
\di[Sx+] [PATTERN] | list indexes |
\dl[x+] | list large objects, same as \lo_list |
\dL[Sx+] [PATTERN] | list procedural languages |
\dm[Sx+] [PATTERN] | list materialized views |
\dn[Sx+] [PATTERN] | list schemas |
\do[Sx+] [NAME [TYPES]] | list operators |
\dO[Sx+] [PATTERN] | list collations |
\dp[Sx] [PATTERN] | list table, view, and sequence access privileges |
\dP[itn][x+] [PATTERN] | list [only index/table] partitioned relations [n=nested] |
\drds[x] [ROLEPTRN [DBPTRN]] | list per-database role settings |
\drg[Sx] [PATTERN] | list role grants |
\dRp[x+] [PATTERN] | list replication publications |
\dRs[x+] [PATTERN] | list replication subscriptions |
\ds[Sx+] [PATTERN] | list sequences |
\dt[Sx+] [PATTERN] | list tables |
\dT[Sx+] [PATTERN] | list data types |
\du[Sx+] [PATTERN] | list roles |
\dv[Sx+] [PATTERN] | list views |
\dx[x+] [PATTERN] | list extensions |
\dX[x] [PATTERN] | list extended statistics |
\dy[x+] [PATTERN] | list event triggers |
\l[x+] [PATTERN] | list databases |
\list[x+] | alias for \l |
\lo_list[x+] | alias for \dl |
\z[Sx] [PATTERN] | same as \dp |
\sf[+] FUNCNAME | show a function's definition |
\sv[+] VIEWNAME | show a view's definition |
\ss[+] TABLE [k] | show stats for the columns of a table |
\k[+] [OPTIONS] [SCOPE] | list databases in Kubernetes, with the URL for \c (OPTIONS: -A, -n NAMESPACE, --context NAME) |
\kube[+] | alias for \k |
Settings
| Command | Description |
|---|
\config [OPTIONS] [NAME [VALUE]] | set configuration option NAME (SECTION.NAME), or show the settings of usql and print if no parameters (OPTIONS: -all shows every section, -password shows passwords) |
\pset [NAME [VALUE]] | set table print formatting option, or show all print formatting options if no parameters |
\a | toggle between unaligned and aligned output mode Deprecated. |
\C [TITLE] | set table title, or unset if none Deprecated. |
\f [SEPARATOR] | show or set field separator for unaligned query output Deprecated. |
\H | toggle HTML output mode Deprecated. |
\html | alias for \H |
\T [ATTRIBUTES] | set HTML <table> tag attributes, or unset if none Deprecated. |
\t [on|off] | show only rows Deprecated. |
\x [on|off|auto] | toggle expanded output Deprecated. |
\uset [NAME [VALUE]] | set usql configuration option, or show all usql settings if no parameters |
\cset [NAME [URL]] | set named connection, or show all named connections if no parameters |
\cset NAME DRIVER PARAMS... | set named connection for driver and parameters |
| Command | Description |
|---|
\echo [-n] [MESSAGE]... | write message to standard output (-n for no newline) |
\qecho [-n] [MESSAGE]... | write message to \o output stream (-n for no newline) |
\warn [-n] [MESSAGE]... | write message to standard error (-n for no newline) |
\o [FILE] | send all query results to file or |pipe |
\out | alias for \o |
\copy SRC DST QUERY TABLE | copy results of query from source database into table on destination database |
\copy SRC DST QUERY TABLE(A,...) | copy results of query from source database into table's columns on destination database |
\dump [OPTIONS] [FILE] | write the database as a usql script to the output, a file or |pipe (OPTIONS: -target DRIVER, -schema-only, -data-only, -schema PATTERN, -exclude-schema PATTERN, -table PATTERN, -exclude-table PATTERN, -allow-lossy, -allow-text, -restrict-key KEY) |
Control/Conditional
Transaction
Operating System/Environment