General
\copyright Show PostgreSQL license terms for use and distribution
\g [file] or; execute query (and write result to file or |pipe)
\gset [PREFIX] execute query and store result in psql variable
\q quit psql \watch [SEC] Execute query help
every SEC seconds \? [commands] show help on backslash commands \? options show help on psql command-line options \? variables show help on special variables \h [name] SQL command Syntax description, use * to show all command syntax description query buffer \e [FILE] [LINE] Use external editor to edit query buffer (or file) \ef [FUNCNAME [LINE]] Use external editor to edit function define \p show the contents of the query buffer \r reset (clear) the query buffer \s [file] show the history or save the history in a file
\w file write query buffer contents to file
input/output
\copy ... execute SQL COPY, send data stream to client host
\echo [string] write string to stdout
\i file from file Execute commands in
\ir FILE Similar to \i, but relative to the current script position
\o [file] Write all query results to a file or | pipe
\qecho [string] Write a string to the query output stream (see \o)
informative
(options: S = show system objects, + = rest of the details)
\d[S+] list table, view and sequence
\d[S+] name describe table, view, sequence, or index
\da [S] [pattern] list aggregate functions
\db[+] [pattern] list tablespaces
\dc[S+] [PATTERN] list transformations
\dC[+] [PATTERN] list type casts
\dd[S] [PATTERN] show object descriptions not shown elsewhere
\ddp [pattern] list default permissions
\dD[S+] [PATTERN] list common value domains
\det[+] [PATTERN] list reference table
\des[+] [mode] list foreign servers
\deu[+] [mode] list user mappings
\dew[+] [mode] list foreign-data wrappers
\df[antw][S+] [mode] column out [aggregate/regular/trigger/window only] functions
\dF[+] [pattern] list text search
configs\dFd[+] [pattern] list text search dictionaries
\dFp[+] [pattern] list text search parsers
\dFt[+] [pattern] list text search templates
\dg[+] [PATTERN] list roles
\di[S+] [pattern] list indices
\dl list large objects, functions like \lo_list same
\dL[S+] [PATTERN] list all procedural languages
\dm[S+] [PATTERN] list all materialized views
\dn[S+] [PATTERN] list all schemas
\do[S] [schema] list operations character
\dO[S+] [PATTERN] List all collation rules
\dp [pattern] List access rights for tables, views and sequences
\drds [pattern 1 [pattern 2]] List role settings for each database
\ds[ S+] [pattern] list sequence
\dt[S+] [pattern] list table
\dT[S+] [pattern] list data types
\du[+] [PATTERN] list roles
\dv[S+] [pattern] list views
\dE[S+] [PATTERN] list reference tables
\dx[+ ] [PATTERN] list extensions
\dy [PATTERN] list all event triggers
\l[+] [PATTERN] list all databases
\sf[+] FUNCNAME show the definition of a function
\z [pattern] and \dp Same function
formatting
\a Switch between unaligned and aligned mode
\C [string] Set the title of the table, or cancel if there is no title
\f [string] Display or set the unaligned mode query output Field separator
\H Switch HTML output mode (currently off)
\pset [NAME [VALUE]] set table output option
(NAME := {border|columns|expanded|fieldsep|fieldsep_zero|
footer|format|linestyle|null|numericlocale |pager|
pager_min_lines|recordsep|recordsep_zero|tableattr|title|
tuples_only|unicode_border_linestyle|
unicode_column_linestyle|unicode_header_linestyle})
\t [on|off] only show records (currently off)
\T [string] Set HTML <table> tag attribute, or if If not, cancel the setting
\x [on|off|auto] Toggle extended output mode (currently off)
Connect
\c[onnect] {[DBNAME|- USER|- HOST|- PORT|-] | conninfo}
to connect to a new database (currently "testdb")
\encoding [encoding name] show or set client encoding
\password [USERNAME] change password securely for user
\conninfo show information about current connection
operating system
\cd [directory] change current job Directory
\setenv NAME [VALUE] Set or clear environment variables
\timing [on|off] Toggle command timing switch (currently off)
\! [command] execute a command in the shell or start an interactive shell
variable
\prompt [text] name prompts the user to set the internal variable
\set [name[value]] sets the internal variable, or lists all if there are no parameters variable
\unset name clear (delete) internal variable
large object
\lo_export LOBOID file
\lo_import file [comment]
\lo_list
\lo_unlink LOBOID large object operation
pgadmin3
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325609805&siteId=291194637
Recommended
Ranking