Abstract:

C dbname Switch database, which is equivalent to mysql use dbname

L List databases, equivalent to show databases of mysql

Dt enumerates tables, equivalent to Show tables

D tblname view the table structure, equivalent to desc tblname, show the columns from tbname general c [onnect] [database name | | | – username – host – port | -]

Connect to a new database (currently"test")Copy the code

CD [directory] change current working directory copyright display PostgreSQL usage and distribution terms encoding [encoding]

Displays or sets the client character encodingCopy the code

H [name] syntax description of SQL commands, with * to display all command prompt [text] names

Prompts the user to set internal variablesCopy the code

password [USERNAME]

             securely change the password for a userCopy the code

Q Exit PSQL set [name [value]]

Set internal variables, list all variables if there is no parameterCopy the code

Timing Command Timing switch (currently off) unset Name Clear (delete) internal variables! To execute a command or start a shell in a shell

Query cache area e [archive] use an external editor to edit the query cache area (or file) g [archive] will be sent to the server query cache area (and place the results to write files or | line “pipe”) p displays the contents of the query cache area r reset (clear) query cache area w files will write file query cache area

Input/output echo [string] string to write to standard output I execute commands in the file from the file o [archive] to write all the query results into the file or “pipe” qecho | pipe string []

Write the string to the query output stream (see \o)Copy the code

Information sex d [name] for data tables, indexes, sequence number or annotated visual view table d {t | | | s | v I s} model

Lists tables/indexes/sequence numbers/viewtables/system tablesCopy the code

Da [model] lists aggregation functions DB [model] lists table Spaces (add “+” for more information) DC [model] lists character encoding transformations DC Lists type transformations DD [model] lists annotations to display objects DD [model] Lists common range df [model] lists functions (plus “+” for more information) dF [model] lists text search configurations (plus “+” for more information) dFb [model] lists text search dictionaries (plus “+” for more information) dFt [model] lists text search styles dFp [model] lists text search profilers (plus “+” for more information) dg [model] lists group DN [model] lists schema patterns (add “+” for more information) do [name] lists operator dl Lists large objects, Same as lo_list dp [model] lists access permissions for tables, viewtables, and sequence numbers dT [model] lists data types (add “+” for more information) du [model] Lists roles L Lists all databases (add “+” for more information) z [model] List tables, viewtables, and sequence number access permissions (same as DP)

Format a Toggles unaligned and aligned modes C sets table titles or unaligns f shows or sets unaligned field delimiters H Toggles HTML output modes (currently off) pset names

Set data sheet output options (name: = {format | border | expanded | fieldsep | footer | null | recordsep | tuples_only | in the | tableattr | pager})Copy the code

T [string] sets HTML table tag properties x Toggles extended output mode (currently off) Copy, Large Object Copy… Run the SQL COPY command to point the data flow to the client host lo_export LOBOID file lo_import file [COMMENT] lo_list lo_unlink LOBOID large object operator

The original link