|
3 | 3 | *
|
4 | 4 | * Copyright (c) 2000-2009, PostgreSQL Global Development Group
|
5 | 5 | *
|
6 |
| - * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.142 2009/03/24 12:57:31 petere Exp $ |
| 6 | + * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.143 2009/03/25 13:14:17 petere Exp $ |
7 | 7 | */
|
8 | 8 | #include "postgres_fe.h"
|
9 | 9 |
|
@@ -85,7 +85,7 @@ usage(void)
|
85 | 85 |
|
86 | 86 | printf(_("psql is the PostgreSQL interactive terminal.\n\n"));
|
87 | 87 | printf(_("Usage:\n"));
|
88 |
| - printf(_(" psql [OPTIONS]... [DBNAME [USERNAME]]\n\n")); |
| 88 | + printf(_(" psql [OPTION]... [DBNAME [USERNAME]]\n\n")); |
89 | 89 |
|
90 | 90 | printf(_("General options:\n"));
|
91 | 91 | /* Display default database */
|
@@ -166,110 +166,106 @@ slashUsage(unsigned short int pager)
|
166 | 166 |
|
167 | 167 | /* if you add/remove a line here, change the row count above */
|
168 | 168 |
|
169 |
| - /* |
170 |
| - * if this " is the start of the string then it ought to end there to fit |
171 |
| - * in 80 columns >> " |
172 |
| - */ |
173 | 169 | fprintf(output, _("General\n"));
|
174 |
| - fprintf(output, _(" \\copyright show PostgreSQL usage and distribution terms\n")); |
175 |
| - fprintf(output, _(" \\g [FILE] or ; execute query (and send results to file or |pipe)\n")); |
176 |
| - fprintf(output, _(" \\h [NAME] help on syntax of SQL commands, * for all commands\n")); |
177 |
| - fprintf(output, _(" \\q quit psql\n")); |
| 170 | + fprintf(output, _(" \\copyright show PostgreSQL usage and distribution terms\n")); |
| 171 | + fprintf(output, _(" \\g [FILE] or ; execute query (and send results to file or |pipe)\n")); |
| 172 | + fprintf(output, _(" \\h [NAME] help on syntax of SQL commands, * for all commands\n")); |
| 173 | + fprintf(output, _(" \\q quit psql\n")); |
178 | 174 | fprintf(output, "\n");
|
179 | 175 |
|
180 | 176 | fprintf(output, _("Query Buffer\n"));
|
181 |
| - fprintf(output, _(" \\e [FILE] edit the query buffer (or file) with external editor\n")); |
182 |
| - fprintf(output, _(" \\p show the contents of the query buffer\n")); |
183 |
| - fprintf(output, _(" \\r reset (clear) the query buffer\n")); |
| 177 | + fprintf(output, _(" \\e [FILE] edit the query buffer (or file) with external editor\n")); |
| 178 | + fprintf(output, _(" \\p show the contents of the query buffer\n")); |
| 179 | + fprintf(output, _(" \\r reset (clear) the query buffer\n")); |
184 | 180 | #ifdef USE_READLINE
|
185 |
| - fprintf(output, _(" \\s [FILE] display history or save it to file\n")); |
| 181 | + fprintf(output, _(" \\s [FILE] display history or save it to file\n")); |
186 | 182 | #endif
|
187 |
| - fprintf(output, _(" \\w FILE write query buffer to file\n")); |
| 183 | + fprintf(output, _(" \\w FILE write query buffer to file\n")); |
188 | 184 | fprintf(output, "\n");
|
189 | 185 |
|
190 | 186 | fprintf(output, _("Input/Output\n"));
|
191 |
| - fprintf(output, _(" \\copy ... perform SQL COPY with data stream to the client host\n")); |
192 |
| - fprintf(output, _(" \\echo [STRING] write string to standard output\n")); |
193 |
| - fprintf(output, _(" \\i FILE execute commands from file\n")); |
194 |
| - fprintf(output, _(" \\o [FILE] send all query results to file or |pipe\n")); |
195 |
| - fprintf(output, _(" \\qecho [STRING] write string to query output stream (see \\o)\n")); |
| 187 | + fprintf(output, _(" \\copy ... perform SQL COPY with data stream to the client host\n")); |
| 188 | + fprintf(output, _(" \\echo [STRING] write string to standard output\n")); |
| 189 | + fprintf(output, _(" \\i FILE execute commands from file\n")); |
| 190 | + fprintf(output, _(" \\o [FILE] send all query results to file or |pipe\n")); |
| 191 | + fprintf(output, _(" \\qecho [STRING] write string to query output stream (see \\o)\n")); |
196 | 192 | fprintf(output, "\n");
|
197 | 193 |
|
198 | 194 | fprintf(output, _("Informational\n"));
|
199 |
| - fprintf(output, _(" Modifiers: S = show system objects + = Additional detail\n")); |
200 |
| - fprintf(output, _(" \\l[+] list all databases\n")); |
201 |
| - fprintf(output, _(" \\d[S+] list tables, views, and sequences\n")); |
202 |
| - fprintf(output, _(" \\d[S+] NAME describe table, view, sequence, or index\n")); |
203 |
| - fprintf(output, _(" \\da[S] [PATTERN] list aggregate functions\n")); |
204 |
| - fprintf(output, _(" \\db[+] [PATTERN] list tablespaces\n")); |
205 |
| - fprintf(output, _(" \\dc[S] [PATTERN] list conversions\n")); |
206 |
| - fprintf(output, _(" \\dC [PATTERN] list casts\n")); |
207 |
| - fprintf(output, _(" \\dd[S] [PATTERN] show comments on objects\n")); |
208 |
| - fprintf(output, _(" \\dD[S] [PATTERN] list domains\n")); |
209 |
| - fprintf(output, _(" \\des[+] [PATTERN] list foreign servers\n")); |
210 |
| - fprintf(output, _(" \\deu[+] [PATTERN] list user mappings\n")); |
211 |
| - fprintf(output, _(" \\dew[+] [PATTERN] list foreign-data wrappers\n")); |
212 |
| - fprintf(output, _(" \\df[S+] [PATTERN] list functions\n")); |
213 |
| - fprintf(output, _(" \\dF[+] [PATTERN] list text search configurations\n")); |
214 |
| - fprintf(output, _(" \\dFd[+] [PATTERN] list text search dictionaries\n")); |
215 |
| - fprintf(output, _(" \\dFp[+] [PATTERN] list text search parsers\n")); |
216 |
| - fprintf(output, _(" \\dFt[+] [PATTERN] list text search templates\n")); |
217 |
| - fprintf(output, _(" \\dg [PATTERN] list roles (groups)\n")); |
218 |
| - fprintf(output, _(" \\di[S+] [PATTERN] list indexes\n")); |
219 |
| - fprintf(output, _(" \\dl list large objects, same as \\lo_list\n")); |
220 |
| - fprintf(output, _(" \\dn[+] [PATTERN] list schemas\n")); |
221 |
| - fprintf(output, _(" \\do[S] [PATTERN] list operators\n")); |
222 |
| - fprintf(output, _(" \\dp [PATTERN] list table, view, and sequence access privileges\n")); |
223 |
| - fprintf(output, _(" \\z [PATTERN] same as \\dp\n")); |
224 |
| - fprintf(output, _(" \\ds[S+] [PATTERN] list sequences\n")); |
225 |
| - fprintf(output, _(" \\dt[S+] [PATTERN] list tables\n")); |
226 |
| - fprintf(output, _(" \\dT[S+] [PATTERN] list data types\n")); |
227 |
| - fprintf(output, _(" \\du [PATTERN] list roles (users)\n")); |
228 |
| - fprintf(output, _(" \\dv[S+] [PATTERN] list views\n")); |
| 195 | + fprintf(output, _(" (options: S = show system objects, + = additional detail)\n")); |
| 196 | + fprintf(output, _(" \\d[S+] list tables, views, and sequences\n")); |
| 197 | + fprintf(output, _(" \\d[S+] NAME describe table, view, sequence, or index\n")); |
| 198 | + fprintf(output, _(" \\da[S] [PATTERN] list aggregate functions\n")); |
| 199 | + fprintf(output, _(" \\db[+] [PATTERN] list tablespaces\n")); |
| 200 | + fprintf(output, _(" \\dc[S] [PATTERN] list conversions\n")); |
| 201 | + fprintf(output, _(" \\dC [PATTERN] list casts\n")); |
| 202 | + fprintf(output, _(" \\dd[S] [PATTERN] show comments on objects\n")); |
| 203 | + fprintf(output, _(" \\dD[S] [PATTERN] list domains\n")); |
| 204 | + fprintf(output, _(" \\des[+] [PATTERN] list foreign servers\n")); |
| 205 | + fprintf(output, _(" \\deu[+] [PATTERN] list user mappings\n")); |
| 206 | + fprintf(output, _(" \\dew[+] [PATTERN] list foreign-data wrappers\n")); |
| 207 | + fprintf(output, _(" \\df[S+] [PATTERN] list functions\n")); |
| 208 | + fprintf(output, _(" \\dF[+] [PATTERN] list text search configurations\n")); |
| 209 | + fprintf(output, _(" \\dFd[+] [PATTERN] list text search dictionaries\n")); |
| 210 | + fprintf(output, _(" \\dFp[+] [PATTERN] list text search parsers\n")); |
| 211 | + fprintf(output, _(" \\dFt[+] [PATTERN] list text search templates\n")); |
| 212 | + fprintf(output, _(" \\dg [PATTERN] list roles (groups)\n")); |
| 213 | + fprintf(output, _(" \\di[S+] [PATTERN] list indexes\n")); |
| 214 | + fprintf(output, _(" \\dl list large objects, same as \\lo_list\n")); |
| 215 | + fprintf(output, _(" \\dn[+] [PATTERN] list schemas\n")); |
| 216 | + fprintf(output, _(" \\do[S] [PATTERN] list operators\n")); |
| 217 | + fprintf(output, _(" \\dp [PATTERN] list table, view, and sequence access privileges\n")); |
| 218 | + fprintf(output, _(" \\ds[S+] [PATTERN] list sequences\n")); |
| 219 | + fprintf(output, _(" \\dt[S+] [PATTERN] list tables\n")); |
| 220 | + fprintf(output, _(" \\dT[S+] [PATTERN] list data types\n")); |
| 221 | + fprintf(output, _(" \\du [PATTERN] list roles (users)\n")); |
| 222 | + fprintf(output, _(" \\dv[S+] [PATTERN] list views\n")); |
| 223 | + fprintf(output, _(" \\l[+] list all databases\n")); |
| 224 | + fprintf(output, _(" \\z [PATTERN] same as \\dp\n")); |
229 | 225 | fprintf(output, "\n");
|
230 | 226 |
|
231 | 227 | fprintf(output, _("Formatting\n"));
|
232 |
| - fprintf(output, _(" \\a toggle between unaligned and aligned output mode\n")); |
233 |
| - fprintf(output, _(" \\C [STRING] set table title, or unset if none\n")); |
234 |
| - fprintf(output, _(" \\f [STRING] show or set field separator for unaligned query output\n")); |
235 |
| - fprintf(output, _(" \\H toggle HTML output mode (currently %s)\n"), |
| 228 | + fprintf(output, _(" \\a toggle between unaligned and aligned output mode\n")); |
| 229 | + fprintf(output, _(" \\C [STRING] set table title, or unset if none\n")); |
| 230 | + fprintf(output, _(" \\f [STRING] show or set field separator for unaligned query output\n")); |
| 231 | + fprintf(output, _(" \\H toggle HTML output mode (currently %s)\n"), |
236 | 232 | ON(pset.popt.topt.format == PRINT_HTML));
|
237 |
| - fprintf(output, _(" \\pset NAME [VALUE] set table output option\n" |
238 |
| - " (NAME := {format|border|expanded|fieldsep|footer|null|\n" |
239 |
| - " numericlocale|recordsep|tuples_only|title|tableattr|pager})\n")); |
240 |
| - fprintf(output, _(" \\t [on|off] show only rows (currently %s)\n"), |
| 233 | + fprintf(output, _(" \\pset NAME [VALUE] set table output option\n" |
| 234 | + " (NAME := {format|border|expanded|fieldsep|footer|null|\n" |
| 235 | + " numericlocale|recordsep|tuples_only|title|tableattr|pager})\n")); |
| 236 | + fprintf(output, _(" \\t [on|off] show only rows (currently %s)\n"), |
241 | 237 | ON(pset.popt.topt.tuples_only));
|
242 |
| - fprintf(output, _(" \\T [STRING] set HTML <table> tag attributes, or unset if none\n")); |
243 |
| - fprintf(output, _(" \\x [on|off] toggle expanded output (currently %s)\n"), |
| 238 | + fprintf(output, _(" \\T [STRING] set HTML <table> tag attributes, or unset if none\n")); |
| 239 | + fprintf(output, _(" \\x [on|off] toggle expanded output (currently %s)\n"), |
244 | 240 | ON(pset.popt.topt.expanded));
|
245 | 241 | fprintf(output, "\n");
|
246 | 242 |
|
247 | 243 | fprintf(output, _("Connection\n"));
|
248 | 244 | fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
|
249 |
| - " connect to new database (currently \"%s\")\n"), |
| 245 | + " connect to new database (currently \"%s\")\n"), |
250 | 246 | PQdb(pset.db));
|
251 |
| - fprintf(output, _(" \\encoding [ENCODING] show or set client encoding\n")); |
252 |
| - fprintf(output, _(" \\password [USERNAME] securely change the password for a user\n")); |
| 247 | + fprintf(output, _(" \\encoding [ENCODING] show or set client encoding\n")); |
| 248 | + fprintf(output, _(" \\password [USERNAME] securely change the password for a user\n")); |
253 | 249 | fprintf(output, "\n");
|
254 | 250 |
|
255 |
| - fprintf(output, _("External\n")); |
256 |
| - fprintf(output, _(" \\cd [DIR] change the current working directory\n")); |
257 |
| - fprintf(output, _(" \\timing [on|off] toggle timing of commands (currently %s)\n"), |
| 251 | + fprintf(output, _("Operating System\n")); |
| 252 | + fprintf(output, _(" \\cd [DIR] change the current working directory\n")); |
| 253 | + fprintf(output, _(" \\timing [on|off] toggle timing of commands (currently %s)\n"), |
258 | 254 | ON(pset.timing));
|
259 |
| - fprintf(output, _(" \\! [COMMAND] execute command in shell or start interactive shell\n")); |
| 255 | + fprintf(output, _(" \\! [COMMAND] execute command in shell or start interactive shell\n")); |
260 | 256 | fprintf(output, "\n");
|
261 | 257 |
|
262 |
| - fprintf(output, _("Variable\n")); |
263 |
| - fprintf(output, _(" \\prompt [TEXT] NAME prompt user to set internal variable\n")); |
264 |
| - fprintf(output, _(" \\set [NAME [VALUE]] set internal variable, or list all if no parameters\n")); |
265 |
| - fprintf(output, _(" \\unset NAME unset (delete) internal variable\n")); |
| 258 | + fprintf(output, _("Variables\n")); |
| 259 | + fprintf(output, _(" \\prompt [TEXT] NAME prompt user to set internal variable\n")); |
| 260 | + fprintf(output, _(" \\set [NAME [VALUE]] set internal variable, or list all if no parameters\n")); |
| 261 | + fprintf(output, _(" \\unset NAME unset (delete) internal variable\n")); |
266 | 262 | fprintf(output, "\n");
|
267 | 263 |
|
268 |
| - fprintf(output, _("Large Object\n")); |
| 264 | + fprintf(output, _("Large Objects\n")); |
269 | 265 | fprintf(output, _(" \\lo_export LOBOID FILE\n"
|
270 | 266 | " \\lo_import FILE [COMMENT]\n"
|
271 | 267 | " \\lo_list\n"
|
272 |
| - " \\lo_unlink LOBOID large object operations\n")); |
| 268 | + " \\lo_unlink LOBOID large object operations\n")); |
273 | 269 |
|
274 | 270 | if (output != stdout)
|
275 | 271 | {
|
|
0 commit comments