\ir FILE as \i, but relative to location of current script \echo write string to standard output (-n for no newline) perform SQL COPY with data stream to the client host \ev ] edit view definition with external editor \ef ] edit function definition with external editor \e edit the query buffer (or file) with external editor \h help on syntax of SQL commands, * for all commands \? variables show help on special variables \? options show help on psql command-line options \gx as \g, but forces expanded output mode \gset execute query and store result in psql variables \gexec execute query, then execute each value in its result \gdesc describe result of query, without executing it \g with no arguments is equivalent to a semicolon \g execute query (and send result to file or |pipe) \errverbose show most recent error message at maximum verbosity \crosstabview execute query and display result in crosstab \copyright show PostgreSQL usage and distribution terms W, -password force password prompt (should happen automatically)įor more information, type "\?" (for internal commands) or "\help" (for SQLĬommands) from within psql, or consult the psql section in the PostgreSQL w, -no-password never prompt for password U, -username=USERNAME database user name (default: "postgres") p, -port=PORT database server port (default: "5432") h, -host=HOSTNAME database server host or socket directory (default: "local socket") Set record separator for unaligned output to zero byte Set field separator for unaligned output to zero byte x, -expanded turn on expanded table output T, -table-attr=TEXT set HTML table tag attributes (e.g., width, border) Record separator for unaligned output (default: newline) P, -pset=VAR set printing option VAR to ARG (see \pset command) csv CSV (Comma-Separated Values) table output modeįield separator for unaligned output (default: "|") A, -no-align unaligned table output mode S, -single-line single-line mode (end of line terminates SQL command) s, -single-step single-step mode (confirm each query) q, -quiet run quietly (no messages, only query output) o, -output=FILENAME send query results to file (or |pipe) n, -no-readline disable enhanced command line editing (readline) L, -log-file=FILENAME send session log to file E, -echo-hidden display queries that internal commands generate e, -echo-queries echo commands sent to server help=variables list special variables, then exit help=commands list backslash commands, then exit X, -no-psqlrc do not read startup file (~/.psqlrc)Įxecute as a single transaction (if non-interactive) V, -version output version information, then exit l, -list list available databases, then exit f, -file=FILENAME execute commands from file, then exit d, -dbname=DBNAME database name to connect to (default: "postgres") c, -command=COMMAND run only single command (SQL or internal) and exit Psql is the PostgreSQL interactive terminal.
0 Comments
Leave a Reply. |