Go to the source code of this file.
◆ helpSQL()
void helpSQL |
( |
const char * |
topic, |
|
|
unsigned short int |
pager |
|
) |
| |
◆ helpVariables()
void helpVariables |
( |
unsigned short int |
pager | ) |
|
◆ print_copyright()
void print_copyright |
( |
void |
| ) |
|
◆ slashUsage()
void slashUsage |
( |
unsigned short int |
pager | ) |
|
Definition at line 176 of file help.c.
References _, buf, ClosePager(), _psqlSettings::db, printTableOpt::expanded, printTableOpt::format, HELP0, HELPN, initPQExpBuffer(), ON, output, PageOutput(), _psqlSettings::popt, PQdb(), PRINT_HTML, pset, termPQExpBuffer(), _psqlSettings::timing, printQueryOpt::topt, and printTableOpt::tuples_only.
Referenced by exec_command_slash_command_help(), and parse_psql_options().
◆ usage()
void usage |
( |
unsigned short int |
pager | ) |
|
Definition at line 51 of file help.c.
61 user = getenv(
"PGUSER");
75 HELP0(
"psql is the PostgreSQL interactive terminal.\n\n");
77 HELP0(
" psql [OPTION]... [DBNAME [USERNAME]]\n\n");
79 HELP0(
"General options:\n");
81 env = getenv(
"PGDATABASE");
84 HELP0(
" -c, --command=COMMAND run only single command (SQL or internal) and exit\n");
85 HELPN(
" -d, --dbname=DBNAME database name to connect to (default: \"%s\")\n",
87 HELP0(
" -f, --file=FILENAME execute commands from file, then exit\n");
88 HELP0(
" -l, --list list available databases, then exit\n");
89 HELP0(
" -v, --set=, --variable=NAME=VALUE\n"
90 " set psql variable NAME to VALUE\n"
91 " (e.g., -v ON_ERROR_STOP=1)\n");
92 HELP0(
" -V, --version output version information, then exit\n");
93 HELP0(
" -X, --no-psqlrc do not read startup file (~/.psqlrc)\n");
94 HELP0(
" -1 (\"one\"), --single-transaction\n"
95 " execute as a single transaction (if non-interactive)\n");
96 HELP0(
" -?, --help[=options] show this help, then exit\n");
97 HELP0(
" --help=commands list backslash commands, then exit\n");
98 HELP0(
" --help=variables list special variables, then exit\n");
100 HELP0(
"\nInput and output options:\n");
101 HELP0(
" -a, --echo-all echo all input from script\n");
102 HELP0(
" -b, --echo-errors echo failed commands\n");
103 HELP0(
" -e, --echo-queries echo commands sent to server\n");
104 HELP0(
" -E, --echo-hidden display queries that internal commands generate\n");
105 HELP0(
" -L, --log-file=FILENAME send session log to file\n");
106 HELP0(
" -n, --no-readline disable enhanced command line editing (readline)\n");
107 HELP0(
" -o, --output=FILENAME send query results to file (or |pipe)\n");
108 HELP0(
" -q, --quiet run quietly (no messages, only query output)\n");
109 HELP0(
" -s, --single-step single-step mode (confirm each query)\n");
110 HELP0(
" -S, --single-line single-line mode (end of line terminates SQL command)\n");
112 HELP0(
"\nOutput format options:\n");
113 HELP0(
" -A, --no-align unaligned table output mode\n");
114 HELP0(
" --csv CSV (Comma-Separated Values) table output mode\n");
115 HELPN(
" -F, --field-separator=STRING\n"
116 " field separator for unaligned output (default: \"%s\")\n",
118 HELP0(
" -H, --html HTML table output mode\n");
119 HELP0(
" -P, --pset=VAR[=ARG] set printing option VAR to ARG (see \\pset command)\n");
120 HELP0(
" -R, --record-separator=STRING\n"
121 " record separator for unaligned output (default: newline)\n");
122 HELP0(
" -t, --tuples-only print rows only\n");
123 HELP0(
" -T, --table-attr=TEXT set HTML table tag attributes (e.g., width, border)\n");
124 HELP0(
" -x, --expanded turn on expanded table output\n");
125 HELP0(
" -z, --field-separator-zero\n"
126 " set field separator for unaligned output to zero byte\n");
127 HELP0(
" -0, --record-separator-zero\n"
128 " set record separator for unaligned output to zero byte\n");
130 HELP0(
"\nConnection options:\n");
132 env = getenv(
"PGHOST");
133 HELPN(
" -h, --host=HOSTNAME database server host or socket directory (default: \"%s\")\n",
134 env ? env :
_(
"local socket"));
136 env = getenv(
"PGPORT");
137 HELPN(
" -p, --port=PORT database server port (default: \"%s\")\n",
138 env ? env : DEF_PGPORT_STR);
140 HELPN(
" -U, --username=USERNAME database user name (default: \"%s\")\n",
142 HELP0(
" -w, --no-password never prompt for password\n");
143 HELP0(
" -W, --password force password prompt (should happen automatically)\n");
145 HELP0(
"\nFor more information, type \"\\?\" (for internal commands) or \"\\help\" (for SQL\n"
146 "commands) from within psql, or consult the psql section in the PostgreSQL\n"
147 "documentation.\n\n");
148 HELPN(
"Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
149 HELPN(
"%s home page: <%s>\n", PACKAGE_NAME, PACKAGE_URL);
153 for (
const char *ptr =
buf.data; *ptr; ptr++)
void ClosePager(FILE *pagerpipe)
FILE * PageOutput(int lines, const printTableOpt *topt)
void initPQExpBuffer(PQExpBuffer str)
void termPQExpBuffer(PQExpBuffer str)
#define DEFAULT_FIELD_SEP
const char * get_user_name(char **errstr)
References _, buf, ClosePager(), DEFAULT_FIELD_SEP, get_user_name(), HELP0, HELPN, initPQExpBuffer(), output, PageOutput(), pg_fatal, _psqlSettings::popt, pset, termPQExpBuffer(), printQueryOpt::topt, and user.