psql (CLI)
Connect to Canner Enterprise using PostgreSQL's CLI tool (psql
) as an example.
- Enter the
psql
command
psql -h <IP or host> -p <port> -d <workspace> -U canner
Example: psql -h 52.195.6.107 -p 7432 -d test1_15598 -U canner
- Password Enter Personal Access Token
Support Commands
Category | Name | Description | Supported |
---|---|---|---|
General | \copyright | show PostgreSQL usage and distribution terms | ✅ |
General | \crosstabview | exexecute query and display results in crosstabecute query and display results in crosstab | ✅ |
General | \errverbose | show most recent error message at maximum verbosity | ✅ |
General | \g | execute query (and send results to file or pipe) | ✅ |
General | \gdesc | describe result of query, without executing it | ❌ |
General | \gexec | execute query, then execute each value in its result | ✅ |
General | \gset | execute query and store results in psql variables | ✅ |
General | \gx | as \g, but forces expanded output mode | ✅ |
General | \q | quit psql | ✅ |
General | \watch | execute query every SEC seconds | ✅ |
Help | \h | help on syntax of SQL commands, * for all commands | ✅ |
Help | \? | show help | ✅ |
Query Buffer | \e | Edit the query buffer | ✅ |
Query Buffer | \ef | Edit function definition with external editor | ✅ |
Query Buffer | \ev | Edit view | ✅ |
Query Buffer | \p | show the contents of the query buffer | ✅ |
Query Buffer | \r | reset (clear) the query buffer | ✅ |
Query Buffer | \s | display history or save it to file | ✅ |
Query Buffer | \w | write query buffer to file | ✅ |
Input/Output | \copy | perform SQL COPY with data stream to the client host | ❌ |
Input/Output | \echo | write string to standard output | ✅ |
Input/Output | \i | execute commands from file | ✅ |
Input/Output | \ir | as \i, but relative to location of current script | ✅ |
Input/Output | \o | send all query results to file or | pipe |
Input/Output | \qecho | write string to \o output stream | ✅ |
Input/Output | \warn | write string to standard error | ✅ |
Conditional | \if | begin conditional block | ✅ |
Conditional | \elif | alternative within current conditional block | ✅ |
Conditional | \else | final alternative within current conditional block | ✅ |
Conditional | \endif | end conditional block | ✅ |
Informational | \d | list tables, views, and sequences | ✅ |
Informational | \da | list aggregates | ❌ |
Informational | \dA | list access methods | ✅ |
Informational | \dAc | list operator classes | ❌ |
Informational | \dAf | list operator families | ❌ |
Informational | \dAo | list operators of operator families | ❌ |
Informational | \dAp | list support functions of operator families | ❌ |
Informational | \db | list tablespaces | ✅ |
Informational | \dc | list conversions | ❌ |
Informational | \dC | list casts | ❌ |
Informational | \dd | show object descriptions not displayed elsewhere | ❌ |
Informational | \dD | list domains | ❌ |
Informational | \ddp | list default privileges | ❌ |
Informational | \dE | list foreign tables | ❌ |
Informational | \des | list foreign servers | ❌ |
Informational | \det | list foreign tables | ❌ |
Informational | \deu | list user mappings | ❌ |
Informational | \dew | list foreign-data wrappers | ❌ |
Informational | \df | list [only agg/normal/procedure/trigger/window] functions | ✅ |
Informational | \dF | list text search configurations | ❌ |
Informational | \dFd | list text search dictionaries | ❌ |
Informational | \dFp | list text search parsers | ❌ |
Informational | \dFt | list text search templates | ❌ |
Informational | \dg | list roles | ✅ |
Informational | \di | list indexes | ✅ |
Informational | \dl | list large objects, same as \lo_list | ❌ |
Informational | \dL | list procedural languages | ❌ |
Informational | \dm | list materialized views | ✅ |
Informational | \dn | list schemas | ✅ |
Informational | \do | list operators | ❌ |
Informational | \dO | list collations | ❌ |
Informational | \dp | list table, view, and sequence access privileges | ❌ |
Informational | \dP | list [only index/table] partitioned relations | ❌ |
Informational | \drds | list per-database role settings | ❌ |
Informational | \dRp | list replication publications | ❌ |
Informational | \dRs | list replication subscriptions | ❌ |
Informational | \ds | list sequences | ❌ |
Informational | \dt | list tables | ✅ |
Informational | \dT | list data types | ❌ |
Informational | \du | list roles | ✅ |
Informational | \dv | list views | ✅ |
Informational | \dx | list extensions | ❌ |
Informational | \dy | list event triggers | ❌ |
Informational | \l | list databases | ✅ |
Informational | \sf | show a function's definition | ❌ |
Informational | \sv | show a view's definition | ❌ |
Informational | \z | same as \dp | ❌ |
Formatting | \a | toggle between unaligned and aligned output mode | ✅ |
Formatting | \C | set table title, or unset if none | ✅ |
Formatting | \f | show or set field separator for unaligned query output | ✅ |
Formatting | \H | toggle HTML output mode | ✅ |
Formatting | \pset | set table output option | ✅ |
Formatting | \t | show only rows (currently off) | ✅ |
Formatting | \T | set HTML table tag attributes, or unset if none | ✅ |
Formatting | \x | toggle expanded output (currently off) | ✅ |
Connection | \c | connect to new database | ✅ |
Connection | \conninfo | display information about current connection | ✅ |
Connection | \encoding | show or set client encoding | ✅ |
Connection | connection with PAT tailed with = | Before PG 14, if PAT tailed with = , the = char will be trimmed. | ✅ |
Connection | \password | securely change the password for a user | ❌ |
Operating System | \cd | change the current working directory | ✅ |
Operating System | \setenv | set or unset environment variable | ✅ |
Operating System | \timing | toggle timing of commands (currently on) | ✅ |
Operating System | \ ! | execute command in shell or start interactive shell | ✅ |
Variables | \prompt | prompt user to set internal variable | ✅ |
Variables | \set | set internal variable, or list all if no parameters | ✅ |
Variables | \unset | unset (delete) internal variable | ✅ |
Large Objects | \lo_export | ✅ | |
Large Objects | \lo_import | ✅ | |
Large Objects | \lo_list | ✅ | |
Large Objects | \lo_unlink | large object operations | ✅ |