Skip to main content
Version: v4

CLI 工具

設定 Canner Enterprise 為 psql 資料來源​

  • 輸入 psql 指令

    psql -h <IP or host> -p <port> -d <workspace> -U canner

    範例: psql -h 52.195.6.107 -p 7432 -d test1_15598 -U canner
  • Password 輸入 Personal Access Token

pg cli

支援指令​

CategoryNameDescriptionSupported
General\copyrightshow PostgreSQL usage and distribution terms✅
General\crosstabviewexexecute query and display results in crosstabecute query and display results in crosstab✅
General\errverboseshow most recent error message at maximum verbosity✅
General\gexecute query (and send results to file or pipe)✅
General\gdescdescribe result of query, without executing it❌
General\gexecexecute query, then execute each value in its result✅
General\gsetexecute query and store results in psql variables✅
General\gxas \g, but forces expanded output mode✅
General\qquit psql✅
General\watchexecute query every SEC seconds✅
Help\hhelp on syntax of SQL commands, * for all commands✅
Help\?show help✅
Query Buffer\eEdit the query buffer✅
Query Buffer\efEdit function definition with external editor✅
Query Buffer\evEdit view✅
Query Buffer\pshow the contents of the query buffer✅
Query Buffer\rreset (clear) the query buffer✅
Query Buffer\sdisplay history or save it to file✅
Query Buffer\wwrite query buffer to file✅
Input/Output\copyperform SQL COPY with data stream to the client host❌
Input/Output\echowrite string to standard output✅
Input/Output\iexecute commands from file✅
Input/Output\iras \i, but relative to location of current script✅
Input/Output\osend all query results to file orpipe
Input/Output\qechowrite string to \o output stream✅
Input/Output\warnwrite string to standard error✅
Conditional\ifbegin conditional block✅
Conditional\elifalternative within current conditional block✅
Conditional\elsefinal alternative within current conditional block✅
Conditional\endifend conditional block✅
Informational\dlist tables, views, and sequences✅
Informational\dalist aggregates❌
Informational\dAlist access methods✅
Informational\dAclist operator classes❌
Informational\dAflist operator families❌
Informational\dAolist operators of operator families❌
Informational\dAplist support functions of operator families❌
Informational\dblist tablespaces✅
Informational\dclist conversions❌
Informational\dClist casts❌
Informational\ddshow object descriptions not displayed elsewhere❌
Informational\dDlist domains❌
Informational\ddplist default privileges❌
Informational\dElist foreign tables❌
Informational\deslist foreign servers❌
Informational\detlist foreign tables❌
Informational\deulist user mappings❌
Informational\dewlist foreign-data wrappers❌
Informational\dflist [only agg/normal/procedure/trigger/window] functions✅
Informational\dFlist text search configurations❌
Informational\dFdlist text search dictionaries❌
Informational\dFplist text search parsers❌
Informational\dFtlist text search templates❌
Informational\dglist roles✅
Informational\dilist indexes✅
Informational\dllist large objects, same as \lo_list❌
Informational\dLlist procedural languages❌
Informational\dmlist materialized views✅
Informational\dnlist schemas✅
Informational\dolist operators❌
Informational\dOlist collations❌
Informational\dplist table, view, and sequence access privileges❌
Informational\dPlist [only index/table] partitioned relations❌
Informational\drdslist per-database role settings❌
Informational\dRplist replication publications❌
Informational\dRslist replication subscriptions❌
Informational\dslist sequences❌
Informational\dtlist tables✅
Informational\dTlist data types❌
Informational\dulist roles✅
Informational\dvlist views✅
Informational\dxlist extensions❌
Informational\dylist event triggers❌
Informational\llist databases✅
Informational\sfshow a function's definition❌
Informational\svshow a view's definition❌
Informational\zsame as \dp❌
Formatting\atoggle between unaligned and aligned output mode✅
Formatting\Cset table title, or unset if none✅
Formatting\fshow or set field separator for unaligned query output✅
Formatting\Htoggle HTML output mode✅
Formatting\psetset table output option✅
Formatting\tshow only rows (currently off)✅
Formatting\Tset HTML table tag attributes, or unset if none✅
Formatting\xtoggle expanded output (currently off)✅
Connection\cconnect to new database✅
Connection\conninfodisplay information about current connection✅
Connection\encodingshow or set client encoding✅
Connectionconnection with PAT tailed with =Before PG 14, if PAT tailed with = , the = char will be trimmed.✅
Connection\passwordsecurely change the password for a user❌
Operating System\cdchange the current working directory✅
Operating System\setenvset or unset environment variable✅
Operating System\timingtoggle timing of commands (currently on)✅
Operating System\ !execute command in shell or start interactive shell✅
Variables\promptprompt user to set internal variable✅
Variables\setset internal variable, or list all if no parameters✅
Variables\unsetunset (delete) internal variable✅
Large Objects\lo_export✅
Large Objects\lo_import✅
Large Objects\lo_list✅
Large Objects\lo_unlinklarge object operations✅