Search PostgreSQL documentation
PG 18 · Browse by category, or enter a name or keyword
Category index100
\d\d[Sx+] [ pattern ]
For each relation (table, view, materialized view, index, sequence, or foreign table) or composite type matching the pattern, show all columns, their types, the tablespac…psql › Usage › Meta-Commands
\!\! [ command ]
With no argument, escapes to a sub-shell; psql resumes when the sub-shell exits. With an argument, executes the shell command command. Unlike most other meta-commands, the ent…psql › Usage › Meta-Commands
\;\;
Backslash-semicolon is not a meta-command in the same way as the preceding commands; rather, it simply causes a semicolon to be added to the query buffer without any further processing. N…psql › Usage › Meta-Commands
\?\? [ topic ]
Shows help information. The optional topic parameter (defaulting to commands) selects which part of psql is explained: commands describes psql's backslash commands; options desc…psql › Usage › Meta-Commands
\C\C [ title ]
Sets the title of any tables being printed as the result of a query or unset any such title. This command is equivalent to \pset title title. (The name of this command derives f…psql › Usage › Meta-Commands
\H\H or \html
Turns on HTML query output format. If the HTML format is already on, it is switched back to the default aligned text format. This command is for compatibility and convenience, bu…psql › Usage › Meta-Commands
\T\T table_options
Specifies attributes to be placed within the table tag in HTML output format. This command is equivalent to \pset tableattr table_options.psql › Usage › Meta-Commands
\a\a
If the current table output format is unaligned, it is switched to aligned. If it is not unaligned, it is set to unaligned. This command is kept for backwards compatibility. See \pset for…psql › Usage › Meta-Commands
\bind\bind [ parameter ] ...
Sets query parameters for the next query execution, with the specified parameters passed for any parameter placeholders ($1 etc.). Example: INSERT INTO tbl1 VALUES ($…psql › Usage › Meta-Commands
\c\c or \connect [ -reuse-previous=on|off ] [ dbname [ username ] [ host ] [ port ] | conninfo ]
Establishes a new connection to a PostgreSQL server. The connection parameters to use can be sp…psql › Usage › Meta-Commands
\cd\cd [ directory ]
Changes the current working directory to directory. Without argument, changes to the current user's home directory. For details on how home directories are found, see Secti…psql › Usage › Meta-Commands
\close\close_prepared prepared_statement_name
Closes the specified prepared statement. An empty string denotes the unnamed prepared statement. If no prepared statement exists with this name, the o…psql › Usage › Meta-Commands
\conninfo\conninfo
Outputs information about the current database connection, including SSL-related information if SSL is in use. Note that the Client User field shows the user at the time of connect…psql › Usage › Meta-Commands
\copy\copy { table [ ( column_list ) ] } from { 'filename' | program 'command' | stdin | pstdin } [ [ with ] ( option [, ...] ) ] [ where condition ]\copy { table [ ( column_list ) ] | ( query ) …psql › Usage › Meta-Commands
\copyright\copyright
Shows the copyright and distribution terms of PostgreSQL.psql › Usage › Meta-Commands
\crosstabview\crosstabview [ colV [ colH [ colD [ sortcolH ] ] ] ]
Executes the current query buffer (like \g) and shows the results in a crosstab grid. The query must return at least three columns. The …psql › Usage › Meta-Commands
\dA\dA[x+] [ pattern ]
Lists access methods. If pattern is specified, only access methods whose names match the pattern are shown. If x is appended to the command name, the results are displaye…psql › Usage › Meta-Commands
\dAc\dAc[x+] [access-method-pattern [input-type-pattern]]
Lists operator classes (see Section 36.16.1). If access-method-pattern is specified, only operator classes associated with access method…psql › Usage › Meta-Commands
\dAf\dAf[x+] [access-method-pattern [input-type-pattern]]
Lists operator families (see Section 36.16.5). If access-method-pattern is specified, only operator families associated with access meth…psql › Usage › Meta-Commands
\dAo\dAo[x+] [access-method-pattern [operator-family-pattern]]
Lists operators associated with operator families (see Section 36.16.2). If access-method-pattern is specified, only members of ope…psql › Usage › Meta-Commands
\dAp\dAp[x+] [access-method-pattern [operator-family-pattern]]
Lists support functions associated with operator families (see Section 36.16.3). If access-method-pattern is specified, only functi…psql › Usage › Meta-Commands
\dC\dC[x+] [ pattern ]
Lists type casts. If pattern is specified, only casts whose source or target types match the pattern are listed. If x is appended to the command name, the results are dis…psql › Usage › Meta-Commands
\dD\dD[Sx+] [ pattern ]
Lists domains. If pattern is specified, only domains whose names match the pattern are shown. By default, only user-created objects are shown; supply a pattern or the S …psql › Usage › Meta-Commands
\dE\dE[Sx+] [ pattern ]\di[Sx+] [ pattern ]\dm[Sx+] [ pattern ]\ds[Sx+] [ pattern ]\dt[Sx+] [ pattern ]\dv[Sx+] [ pattern ]
In this group of commands, the letters E, i, m, s, t, and v stand for…psql › Usage › Meta-Commands
\dF\dF[x+] [ pattern ]
Lists text search configurations. If pattern is specified, only configurations whose names match the pattern are shown. If x is appended to the command name, the results …psql › Usage › Meta-Commands
\dFd\dFd[x+] [ pattern ]
Lists text search dictionaries. If pattern is specified, only dictionaries whose names match the pattern are shown. If x is appended to the command name, the results are…psql › Usage › Meta-Commands
\dFp\dFp[x+] [ pattern ]
Lists text search parsers. If pattern is specified, only parsers whose names match the pattern are shown. If x is appended to the command name, the results are displayed…psql › Usage › Meta-Commands
\dFt\dFt[x+] [ pattern ]
Lists text search templates. If pattern is specified, only templates whose names match the pattern are shown. If x is appended to the command name, the results are displ…psql › Usage › Meta-Commands
\dL\dL[Sx+] [ pattern ]
Lists procedural languages. If pattern is specified, only languages whose names match the pattern are listed. By default, only user-created languages are shown; supply t…psql › Usage › Meta-Commands
\dO\dO[Sx+] [ pattern ]
Lists collations. If pattern is specified, only collations whose names match the pattern are listed. By default, only user-created objects are shown; supply a pattern or…psql › Usage › Meta-Commands
\dP\dP[itnx+] [ pattern ]
Lists partitioned relations. If pattern is specified, only entries whose name matches the pattern are listed. The modifiers t (tables) and i (indexes) can be appended …psql › Usage › Meta-Commands
\dRp\dRp[x+] [ pattern ]
Lists replication publications. If pattern is specified, only those publications whose names match the pattern are listed. If x is appended to the command name, the resu…psql › Usage › Meta-Commands
\dRs\dRs[x+] [ pattern ]
Lists replication subscriptions. If pattern is specified, only those subscriptions whose names match the pattern are listed. If x is appended to the command name, the re…psql › Usage › Meta-Commands
\dT\dT[Sx+] [ pattern ]
Lists data types. If pattern is specified, only types whose names match the pattern are listed. If x is appended to the command name, the results are displayed in expand…psql › Usage › Meta-Commands
\dX\dX[x] [ pattern ]
Lists extended statistics. If pattern is specified, only those extended statistics whose names match the pattern are listed. If x is appended to the command name, the resu…psql › Usage › Meta-Commands
\da\da[Sx] [ pattern ]
Lists aggregate functions, together with their return type and the data types they operate on. If pattern is specified, only aggregates whose names match the pattern are …psql › Usage › Meta-Commands
\db\db[x+] [ pattern ]
Lists tablespaces. If pattern is specified, only tablespaces whose names match the pattern are shown. If x is appended to the command name, the results are displayed in e…psql › Usage › Meta-Commands
\dc\dc[Sx+] [ pattern ]
Lists conversions between character-set encodings. If pattern is specified, only conversions whose names match the pattern are listed. By default, only user-created obje…psql › Usage › Meta-Commands
\dconfig\dconfig[x+] [ pattern ]
Lists server configuration parameters and their values. If pattern is specified, only parameters whose names match the pattern are listed. Without a pattern, only pa…psql › Usage › Meta-Commands
\dd\dd[Sx] [ pattern ]
Shows the descriptions of objects of type constraint, operator class, operator family, rule, and trigger. All other comments may be viewed by the respective backslash com…psql › Usage › Meta-Commands
More results
Find definitions in the PostgreSQL manuals, reference library, and extension catalogue.
pg17: choose a version ex: extensions only ↑↓ select ↵ open