Search PostgreSQL documentation
PG 18 · Browse by category, or enter a name or keyword
Category index802
postgres -P-P
Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.postgres › Options › Semi-Internal Options
postgres -p port-p port
Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT envi…postgres › Options › General Purpose
postgres -r-r filename
Send all server log output to filename. This option is only honored when supplied as a command-line option.postgres › Options › Options for Single-User Mode
postgres -s-s
Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.postgres › Options › General Purpose
postgres -t-t pa[rser] | pl[anner] | e[xecutor]
Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.postgres › Options › Semi-Internal Options
postgres -v-v protocol
Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.postgres › Options › Semi-Internal Options
postgres -W-W seconds
A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the …postgres › Options › Semi-Internal Options
psqlpsql psql — PostgreSQL interactive terminal
Synopsis psql [option...] [dbname [username]]psql
psql --command=command-c command--command=command
Specifies that psql is to execute the given command string, command. This option can be repeated and combined in any order with the -f option. When either -c or -…psql › Options
psql --csv--csv
Switches to CSV (Comma-Separated Values) output mode. This is equivalent to \pset format csv.psql › Options
psql --dbname=dbname-d dbname--dbname=dbname
Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a c…psql › Options
psql --echo-all-a--echo-all
Print all nonempty input lines to standard output as they are read. (This does not apply to lines read interactively.) This is equivalent to setting the variable ECHO to all.psql › Options
psql --echo-errors-b--echo-errors
Print failed SQL commands to standard error output. This is equivalent to setting the variable ECHO to errors.psql › Options
psql --echo-hidden-E--echo-hidden
Echo the actual queries generated by \d and other backslash commands. You can use this to study psql's internal operations. This is equivalent to setting the variable ECHO_HI…psql › Options
psql --echo-queries-e--echo-queries
Copy all SQL commands sent to the server to standard output as well. This is equivalent to setting the variable ECHO to queries.psql › Options
psql --expanded-x--expanded
Turn on the expanded table formatting mode. This is equivalent to \x or \pset expanded.psql › Options
psql --field-separator-zero-z--field-separator-zero
Set the field separator for unaligned output to a zero byte. This is equivalent to \pset fieldsep_zero.psql › Options
psql --field-separator=separator-F separator--field-separator=separator
Use separator as the field separator for unaligned output. This is equivalent to \pset fieldsep or \f.psql › Options
psql --file=filename-f filename--file=filename
Read commands from the file filename, rather than standard input. This option can be repeated and combined in any order with the -c option. When either -c or -f is…psql › Options
psql --help[=topic]-?--help[=topic]
Show help about psql and exit. The optional topic parameter (defaulting to options) selects which part of psql is explained: commands describes psql's backslash commands; op…psql › Options
psql --host=hostname-h hostname--host=hostname
Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix-domain socket.psql › Options
psql --html-H--html
Switches to HTML output mode. This is equivalent to \pset format html or the \H command.psql › Options
psql --list-l--list
List all available databases, then exit. Other non-connection options are ignored. This is similar to the meta-command \list. When this option is used, psql will connect to the data…psql › Options
psql --log-file=filename-L filename--log-file=filename
Write all query output into file filename, in addition to the normal output destination.psql › Options
psql --no-align-A--no-align
Switches to unaligned output mode. (The default output mode is aligned.) This is equivalent to \pset format unaligned.psql › Options
psql --no-password-w--no-password
Never issue a password prompt. If the server requires password authentication and a password is not available from other sources such as a .pgpass file, the connection attemp…psql › Options
psql --no-psqlrc-X--no-psqlrc
Do not read the start-up file (neither the system-wide psqlrc file nor the user's ~/.psqlrc file).psql › Options
psql --no-readline-n--no-readline
Do not use Readline for line editing and do not use the command history (see the section called “Command-Line Editing” below).psql › Options
psql --output=filename-o filename--output=filename
Put all query output into file filename. This is equivalent to the command \o.psql › Options
psql --password-W--password
Force psql to prompt for a password before connecting to a database, even if the password will not be used. If the server requires password authentication and a password is not …psql › Options
psql --port=port-p port--port=port
Specifies the TCP port or the local Unix-domain socket file extension on which the server is listening for connections. Defaults to the value of the PGPORT environment var…psql › Options
psql --pset=assignment-P assignment--pset=assignment
Specifies printing options, in the style of \pset. Note that here you have to separate name and value with an equal sign instead of a space. For example, to se…psql › Options
psql --quiet-q--quiet
Specifies that psql should do its work quietly. By default, it prints welcome messages and various informational output. If this option is used, none of this happens. This is usefu…psql › Options
psql --record-separator-zero-0--record-separator-zero
Set the record separator for unaligned output to a zero byte. This is useful for interfacing, for example, with xargs -0. This is equivalent to \pset recordsep_zero…psql › Options
psql --record-separator=separator-R separator--record-separator=separator
Use separator as the record separator for unaligned output. This is equivalent to \pset recordsep.psql › Options
psql --single-line-S--single-line
Runs in single-line mode where a newline terminates an SQL command, as a semicolon does. Note This mode is provided for those who insist on it, but you are not necessarily en…psql › Options
psql --single-step-s--single-step
Run in single-step mode. That means the user is prompted before each command is sent to the server, with the option to cancel execution as well. Use this to debug scripts.psql › Options
psql --single-transaction-1--single-transaction
This option can only be used in combination with one or more -c and/or -f options. It causes psql to issue a BEGIN command before the first such option and a COMMIT co…psql › Options
psql --table-attr=table_options-T table_options--table-attr=table_options
Specifies options to be placed within the HTML table tag. See \pset tableattr for details.psql › Options
psql --tuples-only-t--tuples-only
Turn off printing of column names and result row count footers, etc. This is equivalent to \t or \pset tuples_only.psql › Options
More results
Find definitions in the PostgreSQL manuals, reference library, and extension catalogue.
pg17: choose a version ex: extensions only ↑↓ select ↵ open