select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Search PostgreSQL documentation

PG 18 · Browse by category, or enter a name or keyword

Category index100
\ddppsql CommandsPG18\ddp[x] [ pattern ] Lists default access privilege settings. An entry is shown for each role (and schema, if applicable) for which the default privilege settings have been changed from the b…psql › Usage › Meta-Commands \despsql CommandsPG18\des[x+] [ pattern ] Lists foreign servers (mnemonic: “external servers”). If pattern is specified, only those servers whose name matches the pattern are listed. If x is appended to the comm…psql › Usage › Meta-Commands \detpsql CommandsPG18\det[x+] [ pattern ] Lists foreign tables (mnemonic: “external tables”). If pattern is specified, only entries whose table name or schema name matches the pattern are listed. If x is appende…psql › Usage › Meta-Commands \deupsql CommandsPG18\deu[x+] [ pattern ] Lists user mappings (mnemonic: “external users”). If pattern is specified, only those mappings whose user names match the pattern are listed. If x is appended to the com…psql › Usage › Meta-Commands \dewpsql CommandsPG18\dew[x+] [ pattern ] Lists foreign-data wrappers (mnemonic: “external wrappers”). If pattern is specified, only those foreign-data wrappers whose name matches the pattern are listed. If x is…psql › Usage › Meta-Commands \dfpsql CommandsPG18\df[anptwSx+] [ pattern [ arg_pattern ... ] ] Lists functions, together with their result data types, argument data types, and function types, which are classified as “agg” (aggregate), “nor…psql › Usage › Meta-Commands \dgpsql CommandsPG18\dg[Sx+] [ pattern ] Lists database roles. (Since the concepts of “users” and “groups” have been unified into “roles”, this command is now equivalent to \du.) By default, only user-created r…psql › Usage › Meta-Commands \dlpsql CommandsPG18\dl[x+] This is an alias for \lo_list, which shows a list of large objects. If x is appended to the command name, the results are displayed in expanded mode. If + is appended to the command …psql › Usage › Meta-Commands \dnpsql CommandsPG18\dn[Sx+] [ pattern ] Lists schemas (namespaces). If pattern is specified, only schemas whose names match the pattern are listed. By default, only user-created objects are shown; supply a pat…psql › Usage › Meta-Commands \dopsql CommandsPG18\do[Sx+] [ pattern [ arg_pattern [ arg_pattern ] ] ] Lists operators with their operand and result types. If pattern is specified, only operators whose names match the pattern are listed. If…psql › Usage › Meta-Commands \dppsql CommandsPG18\dp[Sx] [ pattern ] Lists tables, views and sequences with their associated access privileges. If pattern is specified, only tables, views and sequences whose names match the pattern are lis…psql › Usage › Meta-Commands \drdspsql CommandsPG18\drds[x] [ role-pattern [ database-pattern ] ] Lists defined configuration settings. These settings can be role-specific, database-specific, or both. role-pattern and database-pattern are us…psql › Usage › Meta-Commands \drgpsql CommandsPG18\drg[Sx] [ pattern ] Lists information about each granted role membership, including assigned options (ADMIN, INHERIT and/or SET) and grantor. See the GRANT command for information about rol…psql › Usage › Meta-Commands \dupsql CommandsPG18\du[Sx+] [ pattern ] Lists database roles. (Since the concepts of “users” and “groups” have been unified into “roles”, this command is now equivalent to \dg.) By default, only user-created r…psql › Usage › Meta-Commands \dxpsql CommandsPG18\dx[x+] [ pattern ] Lists installed extensions. If pattern is specified, only those extensions whose names match the pattern are listed. If x is appended to the command name, the results are…psql › Usage › Meta-Commands \dypsql CommandsPG18\dy[x+] [ pattern ] Lists event triggers. If pattern is specified, only those event triggers whose names match the pattern are listed. If x is appended to the command name, the results are d…psql › Usage › Meta-Commands \epsql CommandsPG18\e or \edit [ filename ] [ line_number ] If filename is specified, the file is edited; after the editor exits, the file's content is copied into the current query buffer. If no filename is g…psql › Usage › Meta-Commands \echopsql CommandsPG18\echo text [ ... ] Prints the evaluated arguments to standard output, separated by spaces and followed by a newline. This can be useful to intersperse information in the output of scripts. F…psql › Usage › Meta-Commands \efpsql CommandsPG18\ef [ function_description [ line_number ] ] This command fetches and edits the definition of the named function or procedure, in the form of a CREATE OR REPLACE FUNCTION or CREATE OR REPLAC…psql › Usage › Meta-Commands \encodingpsql CommandsPG18\encoding [ encoding ] Sets the client character set encoding. Without an argument, this command shows the current encoding.psql › Usage › Meta-Commands \errverbosepsql CommandsPG18\errverbose Repeats the most recent server error message at maximum verbosity, as though VERBOSITY were set to verbose and SHOW_CONTEXT were set to always.psql › Usage › Meta-Commands \evpsql CommandsPG18\ev [ view_name [ line_number ] ] This command fetches and edits the definition of the named view, in the form of a CREATE OR REPLACE VIEW command. Editing is done in the same way as for \ed…psql › Usage › Meta-Commands \fpsql CommandsPG18\f [ string ] Sets the field separator for unaligned query output. The default is the vertical bar (|). It is equivalent to \pset fieldsep.psql › Usage › Meta-Commands \gpsql CommandsPG18\g [ (option=value [...]) ] [ filename ]\g [ (option=value [...]) ] [ |command ] Sends the current query buffer to the server for execution. If parentheses appear after \g, they surround a s…psql › Usage › Meta-Commands \gdescpsql CommandsPG18\gdesc Shows the description (that is, the column names and data types) of the result of the current query buffer. The query is not actually executed; however, if it contains some type of sy…psql › Usage › Meta-Commands \getenvpsql CommandsPG18\getenv psql_var env_var Gets the value of the environment variable env_var and assigns it to the psql variable psql_var. If env_var is not defined in the psql process's environment, psql_va…psql › Usage › Meta-Commands \gexecpsql CommandsPG18\gexec Sends the current query buffer to the server, then treats each column of each row of the query's output (if any) as an SQL statement to be executed. For example, to create an index on…psql › Usage › Meta-Commands \gsetpsql CommandsPG18\gset [ prefix ] Sends the current query buffer to the server and stores the query's output into psql variables (see Variables below). The query to be executed must return exactly one row. E…psql › Usage › Meta-Commands \gxpsql CommandsPG18\gx [ (option=value [...]) ] [ filename ]\gx [ (option=value [...]) ] [ |command ] \gx is equivalent to \g, except that it forces expanded output mode for this query, as if expanded=on were …psql › Usage › Meta-Commands \hpsql CommandsPG18\h or \help [ command ] Gives syntax help on the specified SQL command. If command is not specified, then psql will list all the commands for which syntax help is available. If command is an…psql › Usage › Meta-Commands \ipsql CommandsPG18\i or \include filename Reads input from the file filename and executes it as though it had been typed on the keyboard. If filename is - (hyphen), then standard input is read until an EOF in…psql › Usage › Meta-Commands \ifpsql CommandsPG18\if expression\elif expression\else\endif This group of commands implements nestable conditional blocks. A conditional block must begin with an \if and end with an \endif. In between there m…psql › Usage › Meta-Commands \irpsql CommandsPG18\ir or \include_relative filename The \ir command is similar to \i, but resolves relative file names differently. When executing in interactive mode, the two commands behave identically. How…psql › Usage › Meta-Commands \lpsql CommandsPG18\l[x+] or \list[x+] [ pattern ] List the databases in the server and show their names, owners, character set encodings, and access privileges. If pattern is specified, only databases whose n…psql › Usage › Meta-Commands \lopsql CommandsPG18\lo_export loid filename Reads the large object with OID loid from the database and writes it to filename. Note that this is subtly different from the server function lo_export, which acts w…psql › Usage › Meta-Commands \opsql CommandsPG18\o or \out [ filename ]\o or \out [ |command ] Arranges to save future query results to the file filename or pipe future results to the shell command command. If no argument is specified, th…psql › Usage › Meta-Commands \ppsql CommandsPG18\p or \print Print the current query buffer to the standard output. If the current query buffer is empty, the most recently executed query is printed instead.psql › Usage › Meta-Commands \parsepsql CommandsPG18\parse statement_name Creates a prepared statement from the current query buffer, based on the name of a destination prepared-statement object. An empty string denotes the unnamed prepared s…psql › Usage › Meta-Commands \passwordpsql CommandsPG18\password [ username ] Changes the password of the specified user (by default, the current user). This command prompts for the new password, encrypts it, and sends it to the server as an ALT…psql › Usage › Meta-Commands \promptpsql CommandsPG18\prompt [ text ] name Prompts the user to supply text, which is assigned to the variable name. An optional prompt string, text, can be specified. (For multiword prompts, surround the text wi…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